Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pop_pred_samp

generate population prediction sample from parameters


Description

This [EXPERIMENTAL] function combines several sampling tricks to compute a version of an importance sample (based on flat priors) for the parameters.

Usage

pop_pred_samp(object, n = 1000, n_imp = n * 10, return_wts = FALSE,
  impsamp = FALSE, PDify = FALSE, PDmethod = NULL, tol = 1e-06,
  return_all = FALSE, rmvnorm_method = c("mvtnorm", "MASS"),
  fix_params = NULL)

Arguments

object

a fitted mle2 object

n

number of samples to return

n_imp

number of total samples from which to draw, if doing importance sampling

return_wts

return a column giving the weights of the samples, for use in weighted summaries?

impsamp

subsample values (with replacement) based on their weights?

PDify

use Gill and King generalized-inverse procedure to correct non-positive-definite variance-covariance matrix if necessary?

PDmethod

method for fixing non-positive-definite covariance matrices

tol

tolerance for detecting small eigenvalues

return_all

return a matrix including all values, and weights (rather than taking a sample)

rmvnorm_method

package to use for generating MVN samples

fix_params

parameters to fix (in addition to parameters that were fixed during estimation)

References

Gill, Jeff, and Gary King. "What to Do When Your Hessian Is Not Invertible: Alternatives to Model Respecification in Nonlinear Estimation." Sociological Methods & Research 33, no. 1 (2004): 54-87. Lande, Russ and Steinar Engen and Bernt-Erik Saether, Stochastic Population Dynamics in Ecology and Conservation. Oxford University Press, 2003.


bbmle

Tools for General Maximum Likelihood Estimation

v1.0.23.1
GPL
Authors
Ben Bolker [aut, cre], R Development Core Team [aut], Iago Giné-Vázquez [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.