Applies a user-specified function to each particle contained in the
global variables peach
and pall
, collecting the
output in a data.frame
papply(fun, verb = 1, pre = "", ...)
Returns a data frame with the collected output of the user-specified
function fun
a user-defined function which which takes a particle as its first
input; the output of fun
should be a vector, matrix
or data.frame
a scalar logical
indicating whether progress statements
should be printed to the screen
an optional character
prefix used in the progress print
statements; ignored if verb = 0
these ellipses arguments are used to pass extra optional
arguments to the user-supplied function fun
Robert B. Gramacy, rbg@vt.edu
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
Carvalho, C., Johannes, M., Lopes, H., and Polson, N. (2008). “Particle Learning and Smoothing.” Discussion Paper 2008-32, Duke University Dept. of Statistical Science.
PL
, pred.GP
## See the demos via demo(package="plgp") and the examples
## section of ?plgp
Run the code above in your browser using DataLab