View source: R/importance_sampling_functions.R
create_particle | R Documentation |
Creates an R environment to contain the particles for SMC Fusion
create_particle(samples, multivariate, number_of_steps = 2)
multivariate |
logical value indicating if the samples are multivariate (TRUE) or not (FALSE) |
number_of_steps |
integer value for number of steps in the Fusion algorithm (default is 2 for Monte Carlo Fusion) |
samples_to_fuse |
a list of samples (vector if univariate, matrix is multivariate) that you wish to perform fusion with |
A particle environment with components
samples for y in particle set (initialised as the samples given)
a list where x_samples[[i]] is the ith x sample for in particle set (all initialised as NA)
the corresponding means for x_samples (initialised as NA)
associated logarithm of the weights (initialised as the logarithm of 1/number of samples)
associated normalised weights (initialised as 1/number of samples)
effective sample size of particles (initialised as the number of samples)
conditional effective sample size of particles after each step of the algorithm (initialised as NA for each step)
logical value to indicate if particles have been resampled after each step (initialised as FALSE for each step besides the last step, which is set to TRUE)
number of steps in the Fusion algorithm (initialised as the number_of_steps provided)
Number of particles
p <- create_particle(samples = rnorm(10, 0, 1), multivariate = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.