Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.fitsimts

Time Series Prediction


Description

This function plots the time series forecast.

Usage

## S3 method for class 'fitsimts'
predict(object, n.ahead = 10, show_last = 100,
  level = NULL, xlab = NULL, ylab = NULL, main = NULL,
  plot = TRUE, ...)

Arguments

object

A fitsimts object obtained from estimate function.

n.ahead

An integer indicating number of units of time ahead for which to make forecasts.

show_last

A integer indicating the number of last observations to show in the forecast plot.

level

A double or vector indicating confidence level of prediction interval. By default, it uses the levels of 0.50 and 0.95.

xlab

A string for the title of x axis.

ylab

A string for the title of y axis.

main

A string for the over all title of the plot.

plot

A logical value. logical. If TRUE(the default) the predictions are plotted.

...

Additional arguments.

Author(s)

Stéphane Guerrier and Yuming Zhang

Examples

Xt = gen_gts(300, AR(phi = c(0, 0, 0.8), sigma2 = 1))
model = estimate(AR(3), Xt)
predict(model)
predict(model, level = 0.95)

x = gts(as.vector(lynx), start = 1821, end = 1934, freq = 1, 
unit_ts = bquote(paste(10^8," ",m^3)), name_ts = "Numbers", 
unit_time = "year", data_name = "Annual Numbers of Lynx Trappings")
model = estimate(AR(1), x)
predict(model, n.ahead = 20)
predict(model, n.ahead = 20, level = 0.95)
predict(model, n.ahead = 20, level = c(0.50, 0.80, 0.95))

simts

Time Series Analysis Tools

v0.1.1
AGPL-3 | file LICENSE
Authors
Stéphane Guerrier [aut, cre, cph], James Balamuta [aut, cph], Roberto Molinari [aut, cph], Justin Lee [aut], Yuming Zhang [aut], Wenchao Yang [ctb], Nathanael Claussen [ctb], Yunxiang Zhang [ctb], Christian Gunning [cph], Romain Francois [cph], Ross Ihaka [cph], R Core Team [cph]
Initial release
2019-07-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.