Description Usage Arguments Value
Runs the expectation maximization algorithm for Model B Input:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | fit_modelB(
X,
y,
u = NULL,
d,
alpha = NULL,
beta_00 = NULL,
Gamma = NULL,
P_00 = 1000 * diag(ncol(X) * d),
Sigma = NULL,
Omega = NULL,
Omega_diagonal = FALSE,
maxit = 100,
silent = FALSE,
tol_finish = 0.001,
tol_EMstep = 0.001,
return_covariances = FALSE,
initialize = "RRR",
Gamma_rrr = "identity"
)
|
X |
predictors (t x q-dimensional) |
y |
target (t x p-dimensional) |
u |
additional predictors (t x q-dimensional) |
d |
latent dimension |
alpha |
starting value for the algorithm, default NULL (RRR) |
beta_00 |
starting value for beta', default NULL (RRR) |
Gamma |
starting value for the fixed full-rank coefficient matrix, default NULL (RRR) |
P_00 |
starting state covariance (default 1000 * diag(p x d)) |
Sigma |
column covariance of states (default 0.01 * diag(d)) |
Omega |
error covariance (defaults to residual covariance from RRR, or respective starting values) |
Omega_diagonal |
logical, indicates whether Omega is assumed to be a diagonal matrix (advisable if p is large) |
maxit |
maximum number of iterations for the EM algorithm |
silent |
logical, indicates whether progress should be printed during model fitting |
tol_finish |
tolerance for stopping the EM algorithm |
tol_EMstep |
tolerance for iterative estimation during EM step Output: |
return_covariances |
logical, indicates whether the state covariances should be returned (might be necessary for evaluation of the likelihood). |
initialize |
either |
Gamma_rrr |
type of normalization for the starting values obtained from RRR |
A named list of lists with elements
states: filtered (the filtered states) smoothed (the smoothed states)
covariances: the filtered and smoothed covariances and lag-1 covariances
(if return_covariances = TRUE
)
P_t^t
filtered covariances
P_t^t-1
predicted covariances
P_t^T
smoothed covariances
P_t-1t-2^T
smoothed lag-1 covariances
data: the data handed over to the algorithms
X
predictors
y
responses
Z
transition matrices (X_t'beta (x) I_p)
parameters used during filtering: Sigma, Omega, beta
likelihoods: list containing Q and data loglikelihood for each iteration
convergence_information: Message containing parameter stages at convergence
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.