Home > database >  Matlab beyond time series array search
Matlab beyond time series array search

Time:11-13

T=1:40;
X=[384 360 342 331 295 329 335 343 350 356 364 372 380 387 391 388 378 363 349 341 306 343 353 372 390 398 397 390 381 366 351 339 328 321 284 317 317, 321, 332, 345].
X=[' ones (40, 1), t '];
Y=log (x) ';
[B, BINT, RINT, STATS]=regress (Y, X);
Y2=exp (B + B (1) (2). * t);
Figure (1)
The plot (t, x, t, Y2, '+')
Hold on
R=x - Y2;
Figure (2)
The plot (t, r, '*');
R1=diff (r);
R11=r1 [0];
Figure (3)
The plot (t, r11, 'o');
Hold on
R2=diff (r1);
R21=[0 0 r2];
Figure (4)
The plot (t, r21, '*')
Hold on
W=r2 - scheme (r2);
Gamao=var (w);
For j=1; 37.
Gama (j)=w (j + 1: end) * w (1: end - j) '/38;
End
Rho=gama/gamao
Figure (5)
Bar (rho)
F (1, 1)=rho (1);
for k=2:38
S1=rho (k);
S2=1;
For j=1, k - 1
S1=s1 - rho (k - j) * f (k - 1, j);
S2=s2 - rho (j) * f (k - 1, j);
End
End
Pcorr=diag (f) ';
Figure (6)
Bar (pcorr)
For I=3-0
For j=3-0
Spec=garchset (' R ', I 'M, j,' Display ', 'off');
[coeffx, errorsX, LLFX]=garchfit (spec, w);
Num=garchcount (coeffX);
[aic and bic]=aicbic (LLFX, NUM, 27);
Fprintf (' R=% d, M=% d, AIC=% f, BIC=f \ % n ', I, j, AIC and BIC);
End
End
The class=garchset (' R ', 1, 'M', 3);
[coeff, errors, LLF, innovation, sigmas and summary]=garchfit (spec, w);
H=lbqtest (innovations);
[sigmaForecast, x_Forecast]=garchpred (coeff, w, 3);


Index exceeded the number of array elements (1),

Error Untitled11 (line 33)
S1=rho (k);
  • Related