vSMC  v3.0.0
Scalable Monte Carlo
Classes | Typedefs | Functions
Resampling algorithms

Resampling algorithm functor classes. More...

Classes

class  vsmc::ResampleAlgorithm< U01SeqType, Residual >
 Resampling algorithm. More...
 
class  vsmc::ResampleIndex< IntType >
 Record and trace resampling index. More...
 
class  vsmc::ResampleTypeTrait< ResampleScheme >
 Type trait of ResampleScheme parameter. More...
 
class  vsmc::ResampleTypeTrait< Multinomial >
 Type trait of Multinomial scheme. More...
 
class  vsmc::ResampleTypeTrait< Residual >
 Type trait of Residual scheme. More...
 
class  vsmc::ResampleTypeTrait< ResidualStratified >
 Type trait of ResidualStratified scheme. More...
 
class  vsmc::ResampleTypeTrait< ResidualSystematic >
 Type trait of ResidualSystematic scheme. More...
 
class  vsmc::ResampleTypeTrait< Stratified >
 Type trait of Stratified scheme. More...
 
class  vsmc::ResampleTypeTrait< Systematic >
 Type trait of Systematic scheme. More...
 

Typedefs

using vsmc::ResampleMultinomial = ResampleAlgorithm< U01SequenceSorted, false >
 Multinomial resampling. More...
 
using vsmc::ResampleResidual = ResampleAlgorithm< U01SequenceSorted, true >
 Residual resampling. More...
 
using vsmc::ResampleResidualStratified = ResampleAlgorithm< U01SequenceStratified, true >
 Residual stratified resampling. More...
 
using vsmc::ResampleResidualSystematic = ResampleAlgorithm< U01SequenceSystematic, true >
 Residual systematic resampling. More...
 
using vsmc::ResampleStratified = ResampleAlgorithm< U01SequenceStratified, false >
 Stratified resampling. More...
 
using vsmc::ResampleSystematic = ResampleAlgorithm< U01SequenceSystematic, false >
 Systematic resampling. More...
 
template<ResampleScheme Scheme>
using vsmc::ResampleType = typename ResampleTypeTrait< Scheme >::type
 Type of resample class corresponding to ResampleScheme parameter. More...
 

Functions

template<typename InputIter , typename OutputIter >
OutputIter vsmc::resample_trans_rep_index (std::size_t N, std::size_t M, InputIter replication, OutputIter index)
 Transform replication numbers into parent indices. More...
 
template<typename InputIter , typename OutputIterR , typename OutputIterI >
std::size_t vsmc::resample_trans_residual (std::size_t N, std::size_t M, InputIter weight, OutputIterR resid, OutputIterI integ)
 Transform normalized weights to normalized residual and integrals,. More...
 
template<typename InputIter , typename OutputIter , typename U01SeqType >
OutputIter vsmc::resample_trans_u01_rep (std::size_t N, std::size_t M, InputIter weight, U01SeqType &&u01seq, OutputIter replication)
 Transform uniform [0, 1) sequence into replication numbers. More...
 

Detailed Description

Resampling algorithm functor classes.

Typedef Documentation

using vsmc::ResampleMultinomial = typedef ResampleAlgorithm<U01SequenceSorted, false>

Multinomial resampling.

Definition at line 161 of file algorithm.hpp.

using vsmc::ResampleResidual = typedef ResampleAlgorithm<U01SequenceSorted, true>

Residual resampling.

Definition at line 173 of file algorithm.hpp.

using vsmc::ResampleResidualStratified = typedef ResampleAlgorithm<U01SequenceStratified, true>

Residual stratified resampling.

Definition at line 178 of file algorithm.hpp.

using vsmc::ResampleResidualSystematic = typedef ResampleAlgorithm<U01SequenceSystematic, true>

Residual systematic resampling.

Definition at line 183 of file algorithm.hpp.

using vsmc::ResampleStratified = typedef ResampleAlgorithm<U01SequenceStratified, false>

Stratified resampling.

Definition at line 165 of file algorithm.hpp.

using vsmc::ResampleSystematic = typedef ResampleAlgorithm<U01SequenceSystematic, false>

Systematic resampling.

Definition at line 169 of file algorithm.hpp.

template<ResampleScheme Scheme>
using vsmc::ResampleType = typedef typename ResampleTypeTrait<Scheme>::type

Type of resample class corresponding to ResampleScheme parameter.

Definition at line 247 of file algorithm.hpp.

Function Documentation

template<typename InputIter , typename OutputIter >
OutputIter vsmc::resample_trans_rep_index ( std::size_t  N,
std::size_t  M,
InputIter  replication,
OutputIter  index 
)
inline

Transform replication numbers into parent indices.

Parameters
NSample size before resampling
MSample size after resampling
replicationN-vector of replication numbers
indexM-vector of parent indices

Definition at line 130 of file transform.hpp.

template<typename InputIter , typename OutputIterR , typename OutputIterI >
std::size_t vsmc::resample_trans_residual ( std::size_t  N,
std::size_t  M,
InputIter  weight,
OutputIterR  resid,
OutputIterI  integ 
)
inline

Transform normalized weights to normalized residual and integrals,.

Parameters
NSample size before resampling
MSample size after resampling
weightN-vector of normalized weights
residN-vector of normalized residuals
integN-vector of integral parts
Returns
The number of remaining elements to be resampled

Definition at line 50 of file transform.hpp.

template<typename InputIter , typename OutputIter , typename U01SeqType >
OutputIter vsmc::resample_trans_u01_rep ( std::size_t  N,
std::size_t  M,
InputIter  weight,
U01SeqType &&  u01seq,
OutputIter  replication 
)
inline

Transform uniform [0, 1) sequence into replication numbers.

Parameters
NSample size before resampling
MSample size after resampling
weightN-vector of normalized weights
u01seqM ordered uniform [0, 1) random numbers
replicationN-vector of replication numbers

Definition at line 90 of file transform.hpp.