lagdata: Create hhsmm data of lagged time series

View source: R/lagdata.R

lagdataR Documentation

Create hhsmm data of lagged time series

Description

Creates a data of class hhsmmdata containing lagged time series which can be used for fitting auto-regressive hidden hybrid Makrov/semi-Markov model (AR-HHSMM)

Usage

lagdata(data, lags = 1)

Arguments

data

a data of class hhsmmdata containing a multivariate and multi-state time series

lags

a positive integer which is the number of lags to be calculated

Value

a data of class hhsmmdata containing lagged time series

Author(s)

Morteza Amini, morteza.amini@ut.ac.ir

Examples

J <- 3
initial <- c(1, 0, 0)
semi <- rep(FALSE, 3)
P <- matrix(c(0.5, 0.2, 0.3, 0.2, 0.5, 0.3, 0.1, 0.4, 0.5), nrow = J, 
byrow = TRUE)
par <- list(intercept = list(0.1, -0.1, 0.2),
coefficient = list(-0.6, 0.7, -0.5),
csigma = list(5.5, 4, 3.5), mix.p = list(1, 1, 1))
model <- hhsmmspec(init = initial, transition = P, parms.emis = par,
dens.emis = dmixlm, semi = semi)
train <- simulate(model, nsim = c(50, 60, 84, 100), seed = 1234, 
emission.control = list(autoregress = TRUE))
laggedtrain = lagdata(train)


hhsmm documentation built on May 29, 2024, 6:08 a.m.

Related to lagdata in hhsmm...