lagdata | R Documentation |
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)
lagdata(data, lags = 1)
data |
a data of class |
lags |
a positive integer which is the number of lags to be calculated |
a data of class hhsmmdata
containing lagged time series
Morteza Amini, morteza.amini@ut.ac.ir
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.