lts: Generate Latent Time Series Object Based on Data

Description Usage Arguments Value Author(s) Examples

View source: R/lts.R

Description

Create a lts object based on a supplied matrix or data frame.

Usage

1
2
lts(data, start = 0, end = NULL, freq = 1, unit = NULL,
  name = NULL, process = NULL)

Arguments

data

A multiple-column matrix or data.frame. It must contain at least 2 columns. The last column must equal to the sum of all previous columns.

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.

Value

A lts object with the following attributes:

start

The time of the first observation

end

The time of the last observation

freq

Numeric representation of frequency

unit

String representation of the unit

name

Name of the dataset

process

A vector that contains model names of decomposed and combined processes

Author(s)

Wenchao

Examples

1
2
3
4
5
6
7
model1 = AR1(phi = .99, sigma2 = 1) 
model2 = WN(sigma2 = 1)
col1 = gen_gts(1000, model1)
col2 = gen_gts(1000, model2)
testMat = cbind(col1, col2, col1+col2)
testLts = lts(testMat, unit = 'sec', process = c('AR1', 'WN', 'AR1+WN'))
plot(testLts)

SMAC-Group/gmwm documentation built on Sept. 11, 2021, 10:06 a.m.