[R] Is this is correct way to calculate AIC value for time series ?

sagarnikam123 sagarnikam123 at gmail.com
Sat Mar 31 14:17:49 CEST 2012


i have attached time series file
http://r.789695.n4.nabble.com/file/n4521545/1A1I_A_phi_psi_pot_r_k.txt
1A1I_A_phi_psi_pot_r_k.txt 
i am not understanding formula() function,but what i read,from that

1 st method:-

> t<-read.table(file.choose())   #choosing attached file
> lm<-lm(t$V1~ 1) # i used Tilde sign
> loglik<-logLik(lm)
> AIC(loglik)
-----------------------------------------------------------------------------------------------------------------------------------

2 nd method:-

>arr<-ar(t$V1)
> str(arr)
> arr$aic
        0         1         2         3         4         5         6 
 4.273791  4.397484  2.258405  3.008703  1.884487  0.000000  1.476055 
        7         8         9        10        11        12        13 
 3.204865  3.544783  5.474194  3.787079  3.873081  5.872812  7.085577 
       14        15        16        17        18        19 
 8.762945 10.758352 11.484045 12.837440  7.465485  8.729661 

but which is perfect aic value to take ? ? ? ? ? 
----------------------------------------------------------------------------------------------------------------------------------
which method correct to calculate classical/general AIC value
or my both method are wrong,if yes,then how should i proceed?

--
View this message in context: http://r.789695.n4.nabble.com/Is-this-is-correct-way-to-calculate-AIC-value-for-time-series-tp4521545p4521545.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list