This code reads in data from an Excel file named "sss1.xlsx" and selects the first column as x, and the second, third, and fourth columns as y, yy, and yyy respectively. It then plots the data for y, yy, and yyy against x, along with a line graph of the function generated by the "hanshu" function using the data from the first 8 rows of y, with the legend for each graph displayed.

The "hanshu" function takes in an array of data (ld) and applies a logarithmic transformation to the first eight values. It then uses this transformed data to estimate a vector autoregressive moving average model (varm) with one lag and one innovation. It then checks whether the model is stable (i.e., whether all its eigenvalues have a modulus less than one), and returns a logical value indicating whether it is stable or not. Finally, it generates a forecast for the next 32 values using the estimated model, and exponentiates the forecasted values before returning them as a vector. The function returns both the stability of the model and the forecasted values.

In the main code, the forecasted values from the "hanshu" function are combined with the original data and plotted against x, with the legend indicating that it represents the "Unlimited" situation. The other plots represent the "Acceleration situation", "Take measures", and "Hinder growth" situations, respectively

clc clear data=xlsreadsss1xlsx; x=data1; y=data2; yy=data3; yyy=data4; picture data1=data182; ld=logdata1; wyf=hanshuld; zongdata1=data1;yf; plotxzongdata1 legendUnlimited; hold on plotxy legendAcce

原文地址: https://www.cveoy.top/t/topic/e3qe 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录