atsa-es / MARSS

Multivariate Autoregressive State-Space Modeling with R
https://atsa-es.github.io/MARSS/
GNU General Public License v3.0
51 stars 28 forks source link

Add automatic building of covariate factors #148

Open eeholmes opened 2 years ago

eeholmes commented 2 years ago

Currently

d <- rep(1:2, each=10)
MARSS(dat, model=list(d=d))

This will treat d as numeric (as it is).

But if d is character or a factor,

d <- as.factor(rep(1:2, each=10))
MARSS(dat, model=list(d=d))

MARSS will not construct the factor matrix for you.