This summary is divided into 3 parts (accorordered according to the main project goals
The following sections summarize the pull request and commits made for this project. They refer to different packages and repositories:
RcppSMC: the main R package with its underlying C++ template library; PRs and commits refer to extensions of this template librarySVmodelRcppSMC: an R package that illustrates how a potential user of RcppSMC can develop her own package quickly start implementing new algorithms that make use of the facilities implemented under 1.; taking the SV model as a toy example, ancestral line tracking and the Particle Gibbs algorithm are implementedSVmodelExamples: a demo repository of R scripts that run the implemented example facilities of SVmodelRcppSMC for different parameter setups and algorithmic settingsThe final section Miscellaneous summarizes PRs and additions that were made during the project. They do not directly relate to the project goals but rather focus on minor “nice to have” additions such as the improvement of user output readability of existing package examples or updates to the documentation prior to a new release on CRAN that is currently discusses.
RcppSMCancestorIndices: stores resampling indicesSetAIndices: sets ancestorindices of historyelement object; overload history.Set() to also allow setting the ancestor indicesGetAIndices: returns ancestorIndices of historyelement objectGetAPop: re-orders population elements stored in History according to ancestral lines; add some documentationGeALineInd: returns a vector of ancestor indices given particle index (of the final iteration)GetALineSpace: returns ancestral line (i.e. a vector of Space-class objects of length corresponding to the length of the History container) given particle index (of the final iteration)GetuRSIndices: returns current resampling indicesGetuRSIndex: returns n’th element of current resampling indicessampler.h to allow for tracking of ancestral lines:
htHistoryMode == HistoryType::AL added to enforce storage of ancestral lines; use “switch”-type cases for setting the historymode typeuRSIndices are set to 0,1,...,N-1 if resampling is not performed; in case of htHistoryMode == HistoryType::AL this sets the ancestors correctly but is redundant if htHistoryMode == HistoryType::RAMHistoryType::NONE to switch to avoid compiler warningsChangeLogmoveset.hsampler.h:
htHistoryMode == HistoryType::ALgetALineInd and getALineSpace: long N = GetNumber() is never usedmoveset.h
pfWeight, DoConditionalMove, *defaultWeight - update constructor for moveset-class accordingly to provide placeholder for weighting functionsampler.h: changes to conditionalSampler-class
referenceTrajectoryIndices for storing specifically index assignment of the conditional reference path which is useful for cond. SMC resampling schemesreferenceTrajectoryIndices(T) = referenceTrajectoryIndices(T-1) if no resampling is performed and add a conditionalResampling() function (instead of sampler<Space,Params>::Resample) that does a proper conditional resampling not necessarily permuting the particle set but allowing to draw from the lambda-density (see @adam ’s WP)conditionalResampling() currently only supports multinomial resampling for the trivial lambda()=1/N density case (with other resampling schemes to be adjusted for conditional resampling)conditionalSampler class to separate header filefloor(unif_rand()*N) instead of a call to Rcpp::sample() that produced too much overhead when drawing just one uniform index.referenceTrajectoryIndices is never initialized with proper length; now takes length of referenceTrajectoryconditionalSampler class used Resample instead of conditionalResamplereferenceTrajectoryIndices.at(T) = referenceTrajectoryIndices.at(T - 1); changed to correct version referenceTrajectoryIndices.at(T_ + 1) = referenceTrajectoryIndices.at(T);uRSIndices uninitialized in call to conditionalResample();Rcpp::Rcout statementsusing where possible.
conditionalSampler class from explicit naming to using which improves readability of the code.conditionalSampler derived class e.g. adaptation and MCMC moves.conditionalSampler.hnRepeats)SetAdaptMethods) throw an exceptionadaptMethods<Space,Params>;) through a pointer (pAdapt->updateForMCMC()) are deletedhistory.hSet()-member of the historyelement class that does not use nAccepted or nRepeat since that need not be tracked within a conditional sampler that doesn’t make use of adaptation or MCMC movessmc-exception.hconditionalSampler class.
ostream<< operator overload for derived class to print:
digitsPrint integer so that rounding is performed for digitsPrint number of digitsconditionalSampler (within e.g. other packages or .cpp files sourced via Rcpp::source()) is safest for Rcpp::Rcout().print() member may be useful..print() member)MoveReferenceParticle() function to call DoConditionalMove member function of moveset-class similar to MoveParticles() function in sampler.hoperator<< overload when printing conditional class:operator<< overload for Space-class cannot be assumed (or should be well documented so the user implements this herself)ChangeLog with commit history of this branch. conditionalSampler.h:
conditionalSampler class.conditionalResampling():pPopulation values before replicatoin (based on ancestor indices) such that previous ancestor value won’t be overwritten in for loopsmc-exception.h:
ChangeLog:
ChangeLogconditionalSampler.h:break; in switch statements from conditionalResample()N-1 vs. N sizes in construction of the tmpIteratorarma::linspaceSVmodelRcppSMCTo save space, and since this is an accompanying R package with work preliminary for illustration purposes and not additions to the main RcppSMC library, an overview of commits is linked here..
SVmodelExamplesTo save space, and since this is an accompanying repository with work preliminary for demo purposes and not additions to the main RcppSMC library, an overview of commits is linked here.
nonLinPMMH_impl() and nonLinPMMH() to alter user output:
TRUE, then (additionally to percentage completion) mean parameter estimates, current estimated log-likelihood and log-prior values are reported; if FALSE, only percentage of completion is printedmsg_frq: number of iterations after which percentage completion is printed; defaults to every 100 iterationsChangeLog entrystatic_cast() instead of double() for all (both) occasionsNumericVector acceptance_rate to output of nonLinPMMH_impl() to store all acceptance ratesnonLinPMMH() (or moving documentation to roxygen)msg_feq -> msg_freq and fequencies -> frequenciesTHIS PR IS WIP
TODO, README, ChangeLog, standardize copyright headers.
TODO:
SVmodelRcppSMC and SVmodelExamples as package and demo repository, respectively, to be listed along the other references in “More Examples”sampler.h: fix documentation error SMC_HISTORY_NONE -> HistoryType::NONENEWS.Rd for release 0.2.4