demo_lts: Generate a Demo about the Latent Time Series

View source: R/lts.R

demo_ltsR Documentation

Generate a Demo about the Latent Time Series

Description

Creates a time series based on the supplied model, then generate a demo about its latent structure

Usage

demo_lts(n, model, start = 0, end = NULL, freq = 1, unit = NULL,
  name = NULL, process = NULL, ...)

Arguments

n

An interger indicating the amount of observations generated in this function.

model

A ts.model or gmwm object containing one of the allowed models.

start

A numeric that provides the time of the first observation.

end

A numeric that provides the time of the last observation.

freq

A numeric that provides the rate of samples. Default value is 1.

unit

A string that contains the unit expression of the frequency. Default value is NULL.

name

A string that provides an identifier to the data. Default value is NULL.

process

A vector that contains model names of decomposed and combined processes.

...

Additional parameters passed to autoplot.lts

Details

This function accepts either a ts.model object (e.g. AR1(phi = .3, sigma2 =1) + WN(sigma2 = 1)) or a gmwm object.

Author(s)

Wenchao

Examples

# AR
set.seed(1336)
model = AR1(phi = .99, sigma = 1) + WN(sigma2=1)
demo_lts(1000, model)

# Modify the graph aesthetics
demo_lts(100, model, line.color = c('blue', 'green', 'black'), 
         point.size = c(1,1,1), process = c('AR1', 'WN', 'Sum'))

schoi355/gmwm documentation built on April 11, 2022, 1:21 a.m.