papply {plgp} | R Documentation |
Extending apply to particles
Description
Applies a user-specified function to each particle contained in the
global variables peach
and pall
, collecting the
output in a data.frame
Usage
papply(fun, verb = 1, pre = "", ...)
Arguments
fun |
a user-defined function which which takes a particle as its first
input; the output of |
verb |
a scalar |
pre |
an optional |
... |
these ellipses arguments are used to pass extra optional
arguments to the user-supplied function |
Details
This is a extension to the built-in apply
family of
function to particles, intended to be used with the particles created
by PL
. Perhaps the most common use of this function is
in obtaining samples form the posterior predictive distribution, i.e.,
with the user supplied fun = pred.GP
The particles applied over must be present in the global variables
pall
, containing sufficient information common to all
particles, peach
, containing sufficient information
particular to each particle, as constructed by PL
Value
Returns a data frame with the collected output of the user-specified
function fun
Author(s)
Robert B. Gramacy, rbg@vt.edu
References
Carvalho, C., Johannes, M., Lopes, H., and Polson, N. (2008). “Particle Learning and Smoothing.” Discussion Paper 2008-32, Duke University Dept. of Statistical Science.
https://bobby.gramacy.com/r_packages/plgp/
See Also
Examples
## See the demos via demo(package="plgp") and the examples
## section of ?plgp