The R Project SVN R

Rev

Rev 69588 | Rev 89698 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69588 Rev 70613
Line 127... Line 127...
127
ts.plot(AirPassengers, 10^tl, 10^tu, log = "y", lty = c(1,2,2))
127
ts.plot(AirPassengers, 10^tl, 10^tu, log = "y", lty = c(1,2,2))
128
 
128
 
129
## full ML fit is the same if the series is reversed, CSS fit is not
129
## full ML fit is the same if the series is reversed, CSS fit is not
130
ap0 <- rev(log10(AirPassengers))
130
ap0 <- rev(log10(AirPassengers))
131
attributes(ap0) <- attributes(AirPassengers)
131
attributes(ap0) <- attributes(AirPassengers)
132
arima(ap0, c(0, 1, 1), seasonal = list(order=c(0, 1 ,1), period=12))
132
fr1 <- arima(ap0, c(0, 1, 1), seasonal = list(order=c(0, 1 ,1), period=12))
133
arima(ap0, c(0, 1, 1), seasonal = list(order=c(0, 1 ,1), period=12),
133
fr2 <- arima(ap0, c(0, 1, 1), seasonal = list(order=c(0, 1 ,1), period=12),
134
      method = "CSS")
134
             method = "CSS")
-
 
135
i <- c("coef", "sigma2", "var.coef")
-
 
136
stopifnot(all.equal(fr1[i], fit[i], tol=4e-4))# 64b: 9e-5 is ok
135
 
137
 
136
## Structural Time Series
138
## Structural Time Series
137
ap <- log10(AirPassengers) - 2
139
ap <- log10(AirPassengers) - 2
138
(fit <- StructTS(ap, type= "BSM"))
140
(fit <- StructTS(ap, type= "BSM"))
139
par(mfrow=c(1,2))
141
par(mfrow=c(1,2))