Computes an approximation of the predictive density based on a posterior parameters sample. Only allowed in the three-dimensional case.
posterior.predictive3D(
post.sample,
densityGrid,
from = post.sample$Nbin + 1,
to = post.sample$Nsim,
thin = 40,
npoints = 40,
eps = 10^(-3),
equi = T,
displ = T,
...
)A npoints*npoints matrix: the posterior predictive density.
A posterior sample as returned by posteriorMCMC
A function returning a npoints*npoints
matrix, representing a discretized version of the spectral density
on the two dimensional simplex.
The function should be compatible with dgridplot.
In particular, it must use discretize to produce
the discretization grid. It must be of type
function(par, npoints, eps, equi, displ,invisible,
... ).
See Details below.
Integer or NULL. If NULL, the default value is used. Otherwise, should be greater than post.sample$Nbin. Indicates the index where the averaging process should start. Default to post.sample$Nbin +1
Integer or NULL. If NULL, the default
value is used. Otherwise, must be lower than Nsim+1.
Indicates where the averaging process should stop.
Default to post.sample$Nsim.
Thinning interval.
The number of grid nodes on the squared grid containing the desired triangle.
Positive number: minimum distance from any node inside the simplex to the simplex boundary
logical. Is the simplex represented as an equilateral triangle (if TRUE) or a right triangle (if FALSE) ?
logical. Should a plot be produced ?
Additional graphical parameters and arguments to be passed
to contour and image.
Anne Sabourin
The posterior predictive density is approximated by averaging the
densities produced by the function
densityGrid(par, npoints, eps, equi, displ,invisible, ...) for
par in a subset of the parameters sample stored in
post.sample. The arguments of densityGrid must be
par: A vector containing the parameters.
npoints, eps, equi: Discretization parameters
to be passed to dgridplot.
displ: logical. Should a plot be produced ?
invisible: logical. Should the result be returned as invisible ?
... additional arguments to be passed to
dgridplot
Only a sub-sample is used: one out of thin parameters is used
(thinning). Further, only the parameters produced between time
from and time to (included) are kept.
dgridplot, posteriorMCMC.