R : Copyright 2003, The R Development Core Team Version 1.7.1 (2003-06-16) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type `license()' or `licence()' for distribution details. R is a collaborative project with many contributors. Type `contributors()' for more information. Type `demo()' for some demos, `help()' for on-line help, or `help.start()' for a HTML browser interface to help. Type `q()' to quit R. [Previously saved workspace restored] > help(ts) > scan(file="lake.tsm") Read 98 items [1] 10.38 11.86 10.97 10.80 9.79 10.39 10.42 10.82 11.40 11.32 11.44 11.68 [13] 11.17 10.53 10.01 9.91 9.14 9.16 9.55 9.67 8.44 8.24 9.10 9.09 [25] 9.35 8.82 9.32 9.01 9.00 9.80 9.83 9.72 9.89 10.01 9.37 8.69 [37] 8.19 8.67 9.55 8.92 8.09 9.37 10.13 10.14 9.51 9.24 8.66 8.86 [49] 8.05 7.79 6.75 6.75 7.82 8.64 10.58 9.48 7.38 6.90 6.94 6.24 [61] 6.84 6.85 6.90 7.79 8.18 7.51 7.23 8.42 9.61 9.05 9.26 9.22 [73] 9.38 9.10 7.95 8.12 9.75 10.85 10.41 9.96 9.61 8.76 8.18 7.21 [85] 7.13 9.10 8.25 7.91 6.89 5.96 6.80 7.68 8.38 8.52 9.74 9.31 [97] 9.89 9.96 > lake.ts <- ts(data=scan(file="lake.tsm"), start = 1875) Read 98 items > lake.ts Time Series: Start = 1875 End = 1972 Frequency = 1 [1] 10.38 11.86 10.97 10.80 9.79 10.39 10.42 10.82 11.40 11.32 11.44 11.68 [13] 11.17 10.53 10.01 9.91 9.14 9.16 9.55 9.67 8.44 8.24 9.10 9.09 [25] 9.35 8.82 9.32 9.01 9.00 9.80 9.83 9.72 9.89 10.01 9.37 8.69 [37] 8.19 8.67 9.55 8.92 8.09 9.37 10.13 10.14 9.51 9.24 8.66 8.86 [49] 8.05 7.79 6.75 6.75 7.82 8.64 10.58 9.48 7.38 6.90 6.94 6.24 [61] 6.84 6.85 6.90 7.79 8.18 7.51 7.23 8.42 9.61 9.05 9.26 9.22 [73] 9.38 9.10 7.95 8.12 9.75 10.85 10.41 9.96 9.61 8.76 8.18 7.21 [85] 7.13 9.10 8.25 7.91 6.89 5.96 6.80 7.68 8.38 8.52 9.74 9.31 [97] 9.89 9.96 > plot(lake.ts, ylab="Nivel del Lago Huron (en pies)") > ar(lake.ts, order.max = 2, method = "yule-walker") Call: ar(x = lake.ts, order.max = 2, method = "yule-walker") Coefficients: 1 2 1.0538 -0.2668 Order selected 2 sigma^2 estimated as 0.5075 > ar(lake.ts, order.max = 2, method = "yule-walker") -> ar.2.lake > ar.2.lake$order [1] 2 > ar.2.lake$ar [1] 1.0538249 -0.2667516 > ar.2.lake$var.pred [1] 0.5075296 > ar.2.lake$x.mean [1] 9.004082 >