dynr.cook: Cook a dynr model to estimate its free parameters

Description Usage Arguments Details See Also Examples

View source: R/dynrCook.R


Cook a dynr model to estimate its free parameters


dynr.cook(dynrModel, conf.level = 0.95, infile, optimization_flag = TRUE,
  hessian_flag = TRUE, verbose = TRUE, weight_flag = FALSE,
  debug_flag = FALSE)



a dynr model compiled using dynr.model, consisting of recipes for submodels, starting values, parameter names, and C code for each submodel


a cumulative proportion indicating the level of desired confidence intervals for the final parameter estimates (default is .95)


(not required for models specified through the recipe functions) the name of a file that has the C codes for all dynr submodels for those interested in specifying a model directly in C


a flag (TRUE/FALSE) indicating whether optimization is to be done.


a flag (TRUE/FALSE) indicating whether the Hessian matrix is to be calculated.


a flag (TRUE/FALSE) indicating whether more detailed intermediate output during the estimation process should be printed


a flag (TRUE/FALSE) indicating whether the negative log likelihood function should be weighted by the length of the time series for each individual


a flag (TRUE/FALSE) indicating whether users want additional dynr output that can be used for diagnostic purposes


Free parameter estimation uses the SLSQP routine from NLOPT.

The typical items returned in the cooked model are the filtered and smoothed latent variable estimates. eta_smooth_final, error_cov_smooth_final and pr_t_given_T are respectively time-varying smoothed latent variable mean estimates, smoothed error covariance estimates, and smoothed regime probability. eta_filtered, error_cov_filtered and pr_t_given_t are respectively time-varying filtered latent variable mean estimates, filtered error covariance matrix estimates, and filtered regime probability.

When debug_flag is TRUE, then additional information is passed into the cooked model. eta_predicted, error_cov_predicted, innov_vec, and residual_cov are respectively time-varying predicted latent variable mean estimates, predicted error covariance matrix estimates, the error/residual estimates (innovation vector), and the error/residual covariance matrix estimates.

See Also

autoplot, coef, confint, deviance, initialize, logLik, names, nobs, plot, print, show, summary, vcov.


#fitted.model <- dynr.cook(model)

dynr documentation built on June 20, 2017, 9:03 a.m.

Search within the dynr package
Search all R packages, documentation and source code