110 likes | 250 Views
Model selection/diagnostics. Akaike’s Information Criterion (AIC) A measure of fit plus a penalty term for the number of parameters. AIC(k)= log(mle est. of the noise variance) + 2k/T , where T is the sample size and k is the number of parameters in the model
E N D
Model selection/diagnostics • Akaike’s Information Criterion (AIC) • A measure of fit plus a penalty term for the number of parameters. • AIC(k)= log(mle est. of the noise variance) + 2k/T , where T is the sample size and k is the number of parameters in the model • Corrected AIC – stronger penalty (makes a difference with smaller sample sizes) • Choose model that minimizes this adjusted measure of fit. K. Ensor, STAT 421
White noise tests based on sample autocorrelations • The sample autocorrelation computed from an independent identically distributed set of observations and multiplied by the square root of the sample size will be asymptotically normal with mean zero and variance one. • Box-Pierce test for m sample autocorrelations or Ljung-Box-Pierce test (autocorTest) • Test whether the first m correlations are zero vs. the alternative that at least one differs from zero. • Basically the sum of the first m squared correlation coefficients • Scaled so that you obtain a chi-squared distribution with M degrees of freedom. K. Ensor, STAT 421
Tests for Normality • Qqplot – plot the empirical quantiles vs. those of the standard normal distribution. • Formal tests included in Splus-finmetrics (normalTest) • Shapiro-Wilks test (test of correlation between empirical and standard normal quantiles) • Jarque-Bera test (tests that the skewness and kurtosis follow that of a normal distribution) K. Ensor, STAT 421
AR modeling – example 2.1 pg 33 • Process – quarterly growth rate of U.S. real GNP, seasonally adjusted • Quarterly observations beginning 2nd quarter of 1947 to the first quarter of 1991. • Fitted model r(t)=0.0047 + 0.35r(t-1) + 0.18r(t-2)-0.14r(t-3) + a(t) Std. Dev. Of a(t) is 0.0098 K. Ensor, STAT 421
Fitting this model in Splus… > gnpfitar<-ar(x=gnp,aic=T,order.max=10) > gnpfitar $order: [1] 3 $ar: , , 1 [,1] [1,] 0.3462541 [2,] 0.1769673 [3,] -0.1420867 $var.pred: [,1] [1,] 0.00009675547 $aic: [1] 27.5691310 2.6081086 1.5895550 0.0000000 0.2734771 2.2034466 4.0171066 5.9916210 5.8264833 7.5230025 7.8223499 K. Ensor, STAT 421
gnpres<-gnpfitar$resid[4:length(gnp)] > gnpres<-gnpres/(sqrt(gnpfitar$var.pred)) > kdescripb(gnpres,"GNP Standardized Residuals after AR(3) Fit" K. Ensor, STAT 421
Roots of characteristic polynomial • Examine roots of corresponding homogeneous difference equation. • The behavior of these roots can tell you something about the behavior of the series. • For example, • 2 distinct real roots – process can be factored into the product of two pieces • 2 imaginary roots • complex conjugate pair • correspond to the stochastic periodicity in the series • formula is given on page 33 for the average length of the corresponding business cycle • Common in economic time series. • The roots can also tell you if the series is stationary. K. Ensor, STAT 421
For the GNP example • The homogeneous difference equation corresponding to the GNP fitted model is (1-0.35B-0.18B2+0.14B3)=0 or (1+0.52B)(1-0.87B+0.27B2)=0 Two complex conjugate roots – stochastic cycle of average length 10.83 quarters. Exp. Decay in GNP growth rate. K. Ensor, STAT 421
For an MA model • An MA model is always stationary as it is the linear function of uncorrelated or independent random variables • Let’s show this plus derive the ACF for the MA(1) model. • Any stationary AR model can be written as a MA model of infinite order. • Any invertable MA model (roots of characteristic polynomial are greater than one in modulus) can be written as an AR model of inifinite order. • Therefore, we often use the characterization that yields the fewest parameters. K. Ensor, STAT 421
For ARMA model • Let’s write out the ARMA model… • The mean, variance and autocorrelation are derived in your text on page 49 – you review. • Note that the autocorrelation begins decaying exponential to zero after lag 1 (after the largest lag of the MA component). • General comments • The MA and AR operators should • Possess the same characteristics as in the MA and AR models • Should not have common roots (or the model would simplify) • ARMA models can be written as MA or AR models of infinite order. K. Ensor, STAT 421