You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: BayesianTools/R/SMC.R
+20-10Lines changed: 20 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,18 @@
1
1
2
2
#' SMC sampler
3
-
#' @author Florian Hartig, Matthias Speich
4
-
#' @description Sequential Monte Carlo Sampler
3
+
#'
4
+
#' @description A Sequential Monte Carlo (SMC) Sampler with differential evolution updating to avoid particle depletion
5
+
#'
5
6
#' @param bayesianSetup either an object of class bayesianSetup created by \code{\link{createBayesianSetup}} (recommended), or a log target function
6
7
#' @param initialParticles initial particles - either a draw from the prior, provided as a matrix with the single parameters as columns and each row being one particle (parameter vector), or a numeric value with the number of desired particles. In this case, the sampling option must be provided in the prior of the BayesianSetup.
7
8
#' @param iterations number of iterations
8
-
#'
9
9
#' @param exponents series of exponents to build the intermediate distributions
10
10
#' @param lastMutateSteps how many resampling (MCMC) steps after the SMC iterations to increase sample diversity.
11
11
#' @param proposal optional proposal class
12
12
#' @param x Parameter to generate the exponential sequence for building intermediary distributions. Default value from Jeremiah et al. (2012)
13
13
#' @param m Parameter to generate the exponential sequence for building intermediary distributions. Default value from Jeremiah et al. (2012)
14
14
#' @param sampling Which algorithm to use for particle (re)sampling. Options are "multinomial" (default), "residual" and "systematic"
15
-
#' @param ess.limit Threshold value of effective sample size below which resampling is done (fraction of effective sample size). By default, the value is set to half the number of particles. To resample at each step, use a value >= the number of particles.
16
-
#' @param ess.factor
15
+
#' @param ess.limit Threshold value (as a fraction between 0 and 1) of the effective sample compared to the number of particles at which resampling is done. To resample at each step, use a value > 1.
17
16
#' @param lastResample Iteration (starting from the end) at which particle resampling is forced. To deactivate this, set to a value < 0
18
17
#'
19
18
#' @param resampling deprecated, use resamplingSteps to modify resampling
@@ -28,6 +27,9 @@
28
27
#'
29
28
#' @details The sampler can be used for rejection sampling as well as for sequential Monte Carlo. For the former case set the iterations to one.
30
29
#' @note The SMC currently assumes that the initial particle is sampled from the prior. If a better initial estimate of the posterior distribution is available, this the sampler should be modified to include this. Currently, however, this is not included in the code, so the appropriate adjustments have to be done by hand.
0 commit comments