approx.smooth {FVDDPpkg} | R Documentation |
Approximate the smoothing distribution of a Fleming-Viot latent signal
Description
Approximate the smoothing distribution of a Fleming-Viot latent signal
Usage
approx.smooth(fvddp.past, fvddp.future, t.past, t.future, y.new, N)
Arguments
fvddp.past |
An instance of class |
fvddp.future |
Same as |
t.past |
The time between the last collection of data (in the past) and the time at which the smoothing is performed. |
t.future |
Same as |
y.new |
The data collected at the time the smoothing is performed. |
N |
the amount of samples to be drawn in order to perform the approximation. |
Value
An object of class fvddp
, with the same hyperparmeters as fvddp.past
and fvddp.future
. Since this function is a Monte-Carlo based
approximation of smooth()
, the outputs are similar.
See Also
smooth()
for a (slower) exact computation
Examples
FVDDP = initialize(3, function(x) rbinom(x, 10, .2),
function(x) dbinom(x, 10, .2), TRUE)
FVDDP.PAST = update(FVDDP, c(2,3))
FVDDP.FUTURE = update(FVDDP, c(4))
FVDDP.FUTURE = propagate(FVDDP.FUTURE, 0.5)
FVDDP.FUTURE = update(FVDDP.FUTURE, c(1))
approx.smooth(fvddp.past = FVDDP.PAST, fvddp.future = FVDDP.FUTURE,
t.past = 0.4, t.future = 0.3, y.new = c(1,3), N = 20000)