Learn R Programming

crawl (version 2.3.0)

crwPostIS: Simulate a value from the posterior distribution of a CTCRW model

Description

The crwPostIS draws a set of states from the posterior distribution of a fitted CTCRW model. The draw is either conditioned on the fitted parameter values or "full" posterior draw with approximated parameter posterior

Usage

crwPostIS(object.sim, fullPost = TRUE, df = Inf, scale = 1, thetaSamp = NULL)

Value

List with the following elements:

alpha.sim.y

A matrix a simulated latitude state values

alpha.sim.x

Matrix of simulated longitude state values

locType

Indicates prediction types with a "p" or observation times with an "o"

Time

Initial state covariance for latitude

loglik

log likelihood of simulated parameter

par

Simulated parameter value

log.isw

non normalized log importance sampling weight

Arguments

object.sim

A crwSimulator object from crwSimulator.

fullPost

logical. Draw parameter values as well to simulate full posterior

df

degrees of freedom for multivariate t distribution approximation to parameter posterior

scale

Extra scaling factor for t distribution approximation

thetaSamp

If multiple parameter samples are available in object.sim, setting thetaSamp=n will use the nth sample. Defaults to the last.

Author

Devin S. Johnson

Details

The crwPostIS draws a posterior sample of the track state matrices. If fullPost was set to TRUE when the object.sim was build in crwSimulator then a pseudo-posterior draw will be made by first sampling a parameter value from a multivariate t distribution which approximates the marginal posterior distribution of the parameters. The covariance matrix from the fitted model object is used to scale the MVt approximation. In addition, the factor "scale" can be used to further adjust the approximation. Further, the parameter simulations are centered on the fitted values.

To correct for the MVt approximation, the importance sampling weight is also supplied. When calculating averages of track functions for Bayes estimates one should use the importance sampling weights to calculate a weighted average (normalizing first, so the weights sum to 1).

See Also

See demo(northernFurSealDemo) for example.