Hi there, we are beginners in R and we are trying to fit the following time series using ar(2):
> x <- c(1.89, 2.46, 3.23, 3.95, 4.56, 5.07, 5.62, 6.16, 6.26, 6.56, 6.98, > 7.36, 7.53, 7.84, 8.09) The reason of choosing the present time series is that the we have previously calculated analitically the autoregressive coefficients using the direct inversion method as 1.1, 0.765, 0.1173. Since those coefficients fits well our time series, we wanted to learn how to do it in R and check that it would give us the same autoregressive coefficients as the direct inversion method. So as first step in R we have initially applied the OLS method and obtained the following autoregression coefficients: > ar(x, method="ols", order.max=2, demean=FALSE, intercept=TRUE) Call: ar(x = x, order.max = 2, method = "ols", demean = FALSE, intercept = TRUE) Coefficients: 1 2 0.8049 0.0834 Intercept: 1.103 (0.2321) Order selected 2 sigma^2 estimated as 0.009756 Those are very close to the ones obtained with the direct inversion method so the fitting is good. Then we tried to apply the other techniques available in R, namely Yule/Walker, Burg, MLE, obtaining different coefficients, which do not give a good fit of the series at all. Since there isnt anything useful in the R help or its interpretation is very complicated to beginners, can anybody please help us telling how to get a reasonable good fit with YW, Burg and MLE, reporting also the code that needs to be used and commenting the coefficients obtained by comparing those with the ones obtained with OLS. Thanks in advance. -- View this message in context: http://r.789695.n4.nabble.com/Simple-AR-2-tp3416560p3416560.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.