data(sin_data)
ts <- ts_data(sin_data$y, 0)
ts_head(ts, 3)
samp <- ts_sample(ts, test_size= 5)
io_train <- ts_projection(samp$train)
io_test <- ts_projection(samp$test)
model <- ts_arima()
model <- fit(model, x=io_train$input, y=io_train$output)
adjust <- predict(model, io_train$input)
prediction <- predict(model, x=io_test$input, steps_ahead=5)
prediction <- as.vector(prediction)
yvalues <- c(io_train$output, io_test$output)
grf <- plot_ts_pred(y=yvalues, yadj=adjust, ypre=prediction)
plot(grf)
Run the code above in your browser using DataLab