predict.fitsimts: Time Series Prediction

View source: R/fitsimts.R

predict.fitsimtsR Documentation

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 documentation built on Aug. 31, 2023, 5:07 p.m.