Dear Nglthu,
Not sure what you mean by scale(x1,x2), this:
library(depmixS4)
data(speed)
x1 <- rnorm(nrow(speed))
x2 <- rnorm(nrow(speed))
scale(x1,x2)
produces an error ...
but, the use of two predictors or covariates on the transition matrix is
possible:
speed$x2 <- x2
mod1 <- depmix(list(rt~1,corr~1),data=speed,transition=~Pacc+x2,nstates=2,
family=list(gaussian(),multinomial("identity")),ntimes=c(168,134,137))
set.seed(3)
fmod1 <- fit(mod1)
Above code produces sensible results.
Hth, Ingmar Visser
On Fri, Apr 20, 2012 at 5:14 AM, nglthu <nglthu@gmail.com> wrote:
> Dear helpers,
> is there any possible that transition (in depmixS4) is in scale of two
> variable, e.g transition=~scale(x1,x2)?
> If it can be, how transition of two variable (covariate time) can be worked
> in depmixS4-hidden markov model for time series.
>
> Many thanks,
> nglthu
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/depmixS4-transition-tp4572726p4572726.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]