update {FVDDPpkg} | R Documentation |
Update the FVDDP when new observations are collected
Description
Update the FVDDP when new observations are collected
Usage
update(fvddp, y.new)
Arguments
fvddp |
An object of class |
y.new |
A vector of new values to update the process. |
Value
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.
References
Papaspiliopoulos O, Ruggiero M, Spanò D (2016). “Conjugacy properties of time-evolving Dirichlet and gamma random measures.” Electronic Journal of Statistics, 10(2), 3452 – 3489. doi:10.1214/16-EJS1194.
Examples
#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))
[Package FVDDPpkg version 0.1.2 Index]