| nested_std_dev_from_params | R Documentation |
Helper function - wraps single execution of the log-likelihood & deviation parameters calculations. Used for nested version of SEM likelihood.
nested_std_dev_from_params(
params,
data,
df,
timestamp_col,
entity_col,
dep_var_col,
n_entities,
n_periods
)
params |
A matrix (with named rows) with each column corresponding to a model. Each row specifies model parameters. Compare with optim_model_space_params |
data |
List of the SEM setup matrices, shared along different models |
df |
Data frame with data for the SEM analysis. |
timestamp_col |
The name of the column with timestamps |
entity_col |
Column with entities (e.g. countries) |
dep_var_col |
Column with the dependent variable |
n_entities |
Number of entities - passed to save calc. time |
n_periods |
Number of periods - passed to save calc. time |
Matrix with columns describing likelihood and standard deviations for each
model. The first row is the likelihood for the model (computed using the
parameters in the provided model space). The second row is the marginal
likelihood approximation used to weight the models, namely
exp((loglik - (k/2) * log(N * T)) / N); note that it is not a BIC.
Then there are rows with standard deviations for each parameter, followed by
rows with robust standard deviations. The last three rows hold
tr(H^-1 J), where H is the observed information and J
the outer product of the entity-level scores, the dimension of the
parameter vector, and the numerical rank of J. These are the
ingredients of the magnitude adjustment for misspecified likelihoods,
whose rate is rank(J) / tr(H^-1 J); see score_rank for
why J is typically rank deficient, and bma for why no
weighting option is built on it.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.