update | R Documentation |
Update the FVDDP when new observations are collected
update(fvddp, y.new)
fvddp |
An object of class |
y.new |
A vector of new values to update the process. |
An object which is similar to the one given as an input. In particular,
the multiplicities of y.new
will be added to each row of M
, and the weights
w
will be multiplied times the probability of drawing y.new
form each row
of the matrix M
according to Polya urn sampling scheme.
PapaspiliopoulosRuggieroSpanò2016FVDDPpkg
#initialize and propagate a object
FVDDP = initialize(1, function(x) rpois(x, 3),
function(x) dpois(x, 3), TRUE)
update(fvddp = FVDDP, y.new = c(4,5))
#in this case, update after a propagation to see the diiffent effect of polya urn on the weights
FVDDP=initialize(3, function(x) rnorm(x, -1,3),
function(x) dnorm(x, -1, 3), FALSE)
FVDDP = update(FVDDP, c(-1.145, 0.553, 0.553))
FVDDP = propagate(FVDDP, 0.6)
update(fvddp = FVDDP, y.new = c(0.553, -0.316, -1.145))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.