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

View source: R/crwPostIS.R

crwPostISR Documentation

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)

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.

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).

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

Author(s)

Devin S. Johnson

See Also

See demo(northernFurSealDemo) for example.


crawl documentation built on Oct. 10, 2022, 1:07 a.m.