Learn R Programming

gmwm (version 2.0.0)

lts: Generate Latent Time Series Object Based on Data

Description

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

Usage

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

Examples

Run this code
model1 = AR1(phi = .99, sigma = 1) 
model2 = WN(sigma2=1)
col1 = gen.gts(model1, N = 1000)
col2 = gen.gts(model2, N = 1000)
testMat = cbind(col1, col2, col1+col2)
testLts = lts(testMat, unit = 'sec', process = c('AR1', 'WN', 'AR1+WN'))
plot(testLts)

Run the code above in your browser using DataLab