The R Project SVN R

Rev

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

Rev 59039 Rev 61153
Line 23... Line 23...
23
require(stats); require(graphics)
23
require(stats); require(graphics)
24
JJ <- log10(JohnsonJohnson)
24
JJ <- log10(JohnsonJohnson)
25
plot(JJ)
25
plot(JJ)
26
## This example gives a possible-non-convergence warning on some
26
## This example gives a possible-non-convergence warning on some
27
## platforms, but does seem to converge on x86 Linux and Windows.
27
## platforms, but does seem to converge on x86 Linux and Windows.
28
(fit <- StructTS(JJ, type="BSM"))
28
(fit <- StructTS(JJ, type = "BSM"))
29
tsdiag(fit)
29
tsdiag(fit)
30
sm <- tsSmooth(fit)
30
sm <- tsSmooth(fit)
31
plot(cbind(JJ, sm[, 1], sm[, 3]-0.5), plot.type = "single",
31
plot(cbind(JJ, sm[, 1], sm[, 3]-0.5), plot.type = "single",
32
     col = c("black", "green", "blue"))
32
     col = c("black", "green", "blue"))
33
abline(h = -0.5, col = "grey60")
33
abline(h = -0.5, col = "grey60")