| MAP_Fit | R Documentation |
MAP fit object
MAP fit object
An R6 class storing optimization results from maximum a posteriori (MAP) estimation.
BayesRTMB::RTMB_Fit_Base -> map_fit
modelThe 'RTMB_Model' object used for estimation.
par_vecParameter vector on the unconstrained scale (constrained values unlisted).
parParameter list on the constrained scale.
par_uncParameter vector on the unconstrained scale (raw unconstrained values).
ci_methodMethod used for CI estimation ("wald", "sampling", or "none").
objectiveRTMB objective function object.
log_mlLog marginal likelihood or related model criterion.
convergenceOptimizer convergence code.
sd_repStandard deviation report object.
df_fixedSummary table for fixed-effect parameters.
random_effectsRandom effect estimates.
df_transformSummary table for transformed parameter estimates.
df_generateSummary table for generated quantity estimates.
opt_historyA vector of optimize objective history.
transformList of transformed parameters maintaining their original dimensions.
generateList of generated quantities maintaining their original dimensions.
se_samplesList of simulated samples for standard error estimation.
laplaceLogical; whether Laplace approximation was used.
vcov_uncVariance-covariance matrix of parameters in unconstrained space.
mapList; the parameter mapping used.
marginal_varsCharacter vector of parameter names requested through 'optimize(marginal = ...)'.
laplace_random_varsCharacter vector of all parameter names passed to 'MakeADFun(random = ...)' during Laplace approximation.
idx_fix_activeNumeric vector; mapping between active parameters and full unconstrained vector.
show_dfLogical; whether to display degrees of freedom in the summary output.
viewCharacter vector of parameter names to prioritize in summary.
fallback_neededLogical; whether Hessian/SE fallback was used during optimization.
get_point_estimate()Get point estimate for a target parameter.
MAP_Fit$get_point_estimate(target, ...)
targetTarget parameter name.
...Additional arguments, ignored for MAP fits.
Matrix, array, vector, or scalar point estimate.
new()Create a new 'MAP_Fit' object.
MAP_Fit$new( model, par_vec = NULL, par = NULL, objective = NULL, log_ml = NULL, convergence = NULL, sd_rep = NULL, df_fixed = NULL, random_effects = NULL, df_transform = NULL, df_generate = NULL, opt_history = NULL, transform = NULL, generate = NULL, se_samples = NULL, par_unc = NULL, ci_method = "wald", laplace = TRUE, map = NULL, vcov_unc = NULL, marginal_vars = NULL, laplace_random_vars = NULL, idx_fix_active = NULL, show_df = TRUE, view = NULL, fallback_needed = NULL )
modelThe 'RTMB_Model' object used for estimation.
par_vecParameter vector on the unconstrained scale (constrained values unlisted).
parParameter list on the constrained scale.
objectiveThe objective function value at the optimum.
log_mlLog marginal likelihood.
convergenceOptimizer convergence code.
sd_repThe 'sdreport' object from TMB.
df_fixedData frame of fixed effects estimates and CIs.
random_effectsData frame of random effects estimates and CIs.
df_transformData frame of transformed parameters.
df_generateData frame of generated quantities.
opt_historyData frame of optimization history.
transformList of transformed parameters maintaining their original dimensions.
generateList of generated quantities maintaining their original dimensions.
se_samplesList of simulated samples for standard error estimation.
par_uncParameter vector on the unconstrained scale (raw values).
ci_methodMethod used for CI estimation ("wald", "sampling", or "none").
laplaceLogical; whether Laplace approximation was used.
mapList; the parameter mapping used.
vcov_uncVariance-covariance matrix of parameters in unconstrained space.
marginal_varsCharacter vector of parameter names requested through 'optimize(marginal = ...)'.
laplace_random_varsCharacter vector of all parameter names passed to 'MakeADFun(random = ...)' during Laplace approximation.
idx_fix_activeNumeric vector; mapping between active parameters and full unconstrained vector.
show_dfLogical; whether to display degrees of freedom in the summary output. Default is TRUE.
viewCharacter vector of parameter names to prioritize in summary.
fallback_neededLogical; whether Hessian/SE fallback was used during optimization.
ranef()Return random effect estimates as a named list.
MAP_Fit$ranef()
A named list of random effect estimates.
draws()Extract samples from the asymptotic posterior distribution.
MAP_Fit$draws( pars = NULL, inc_random = FALSE, inc_transform = TRUE, inc_generate = TRUE, ... )
parsCharacter or numeric vector specifying the names or indices of parameters to extract.
inc_randomLogical; whether to include random effects.
inc_transformLogical; whether to include transformed parameters.
inc_generateLogical; whether to include generated quantities.
...Ignored.
An array of samples [iterations, 1, parameters].
summary()Summarize MAP estimates.
MAP_Fit$summary( pars = NULL, max_rows = 10, digits = 5, ranef = FALSE, view = NULL )
parsCharacter vector specifying the names of parameters to summarize. If NULL, all available parameters are summarized.
max_rowsMaximum number of rows to print in summaries. Default is 10.
digitsNumber of digits to print.
ranefLogical; whether to also display random effect estimates. Default is FALSE.
viewCharacter vector of parameter names to prioritize or filter by.
A summary object, typically a data frame.
print()Print a brief summary of the fitted object.
MAP_Fit$print(pars = NULL, max_rows = 10, digits = 5, ...)
parsCharacter vector specifying the names of parameters to summarize.
max_rowsMaximum number of rows to print in summaries.
digitsNumber of digits to print.
...Additional arguments passed to the 'summary' method.
The object itself, invisibly.
generated_quantities()Compute generated quantities from the MAP estimate.
MAP_Fit$generated_quantities(code)
codeAn 'rtmb_code({ ... })' or '{ ... }' block containing the logic to be calculated using the MAP estimate.
The 'MAP_Fit' object itself (invisibly). Results are added or updated in the 'generate' list and 'df_generate'.
WAIC()Compute an approximate WAIC from sampling-based uncertainty propagation.
MAP_Fit$WAIC()
A 'waic_BayesRTMB' object.
diagnose()Run basic diagnostics for the MAP fit.
MAP_Fit$diagnose(...)
...Additional arguments passed to 'diagnose_map_fit()'.
A 'diagnose_BayesRTMB' object.
profile()Calculate Profile Likelihood confidence intervals for specific parameters.
MAP_Fit$profile( pars = NULL, level = 0.95, trace = FALSE, digits = 5, show_plot = FALSE, quiet = FALSE, jacobian = "none", ... )
parsCharacter vector of parameter names to profile. If NULL, all fixed parameters are profiled.
levelConfidence level (default is 0.95).
traceLogical; whether to print profiling progress. Default is FALSE.
digitsInteger; number of decimal places to print. Default is 5.
show_plotLogical; whether to plot the profile likelihood curves. Default is FALSE.
quietLogical; whether to suppress text output. Default is FALSE.
jacobianCharacter; "none" (default), "random", or "all". Whether to include Jacobian adjustments for transformations.
...Additional arguments passed to TMB::tmbprofile (e.g., ytol).
A data frame containing the profile-based confidence intervals, with the raw profile objects stored in the "profiles" attribute.
clone()The objects of this class are cloneable with this method.
MAP_Fit$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.