maximum.context {VLMCX} | R Documentation |
Build the largest context tree, which is the biggest context tree such that all elements in it have been observed at least n.min
times.
maximum.context(y, X, max.depth = 5, n.min = 5)
y |
a "time series" vector (numeric, charachter, or factor) |
X |
Numeric matrix of predictors with rows corresponding to the y observations (over time) and columns corresponding to covariates. |
max.depth |
Maximum depth of the desired tree. |
n.min |
Minimum number of observations per coefficient to be estimated. |
maximum.context returns an object of class "VLMCX"
. The generic functions coef
, AIC
,BIC
, draw
, and LogLik
extract various useful features of the value returned by VLMCX.
An object of class "VLMCX"
is a list containing at least the following components:
y |
the time series data corresponding to the states inputed by the user. |
X |
the time series covariates data inputed by the user. |
tree |
the estimated rooted tree estimated by the algorithm. Each node contains the |
LogLik |
the log-likelihood of the data using the estimated context tree. |
baseline.state |
the state used as a baseline fore the multinomial regression. |
Adriano Zanin Zambom <adriano.zambom@csun.edu>
n = 1000
d = 2
X = cbind(rnorm(n), rnorm(n))
y = rbinom(n,1,.5)
fit = maximum.context(y, X)