Learn R Programming

crawl (version 1.3-1)

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)

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.

Value

  • List with the following elements:
  • alpha.sim.yA matrix a simulated latitude state values
  • alpha.sim.xMatrix of simulated longitude state values
  • locTypeIndicates prediction types with a "p" or observation times with an "o"
  • TimeInitial state covariance for latitude
  • logliklog likelihood of simulated parameter
  • parSimulated parameter value
  • log.iswnon normalized log importance sampling weight

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 psuedo-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 calulating 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 northernFurSeal for example.