# NOT RUN {
muX.a = function(t){ 8 + t + sin(pi*t) } ; muX.b = function(t){ muX.a(t) + 2 }
muY.a = function(t){sqrt(t) + cos(pi*t/2) } ; muY.b = function(t){ 2*muY.a(t) + 2 }
N = 100; t=seq(0.1,2*pi,length = N);
set.seed(1)
e.x = rnorm(100); e.y = rnorm(100);
a.X = muX.a(t) + e.x; b.X = a.X + 2
a.Y = muY.a(t) + e.y ; b.Y = 2*a.Y + 2
A <- cbind(a.X, a.Y); B <- cbind(b.X, b.Y)
y <- mitsframe(dates=t, A=A, B = B)
fit <- misst(y)
fit$l;
fit$m;
fit$vertical
# Estimated trendlines:
head(fit$trendlines$A,5)
head(fit$trendlines$B,5)
## Estimated interval trendlines
plot(fit)
## Scree-plot
plot(fit, options = list(type = "screeplots"))
## Per
plot(fit, options = list(type = "cpgrams"))
## ERC
plot(fit, options=list(type='components',ncomp=1:3))
##################################
### Forecasting with misst ###
##################################
pred = predict(fit, p = 5)
pred$forecasts # Forecast organized in an array.
# End
# }
Run the code above in your browser using DataLab