pf
pf_base.h
Go to the documentation of this file.
1 #ifndef PF_BASE_H
2 #define PF_BASE_H
3 
4 #include <map>
5 #include <string>
6 #include <vector>
7 
8 #ifdef DROPPINGTHISINRPACKAGE
9  #include <RcppEigen.h>
10  // [[Rcpp::depends(RcppEigen)]]
11 #else
12  #include <Eigen/Dense>
13 #endif
14 
15 
16 
17 namespace pf {
18 
19 namespace bases {
20 
21 
22 
23 /************************************************************************************************************/
24 
25 
34 template<typename float_t, size_t dimobs, size_t dimstate>
35 class pf_base {
36 public:
37 
38  /* expose float type to users of this ABCTP */
39  using float_type = float_t;
40 
41  /* expose observation-sized vector type to users */
42  using obs_sized_vec = Eigen::Matrix<float_t,dimobs,1>;
43 
44  /* expose state-sized vector type to users */
45  using state_sized_vec = Eigen::Matrix<float_t,dimstate,1>;
46 
47  /* expose state-sized vector to users */
48  using dynamic_matrix = Eigen::Matrix<float_t,Eigen::Dynamic,Eigen::Dynamic>;
49 
50  /* a function */
51  using func = std::function<const dynamic_matrix(const state_sized_vec&)>;
52 
53  /* functions */
54  using func_vec = std::vector<func>;
55 
56  /* the dimension of each observation vector (allows indirect access to template parameters)*/
57  static constexpr unsigned int dim_obs = dimobs;
58 
59  /* the dimension of the state vector (allows indirect access to template parameters)*/
60  static constexpr unsigned int dim_state = dimstate;
61 
62 
68  virtual void filter(const obs_sized_vec &data, const func_vec& fs = func_vec() ) = 0;
69 
70 
75  virtual float_t getLogCondLike() const = 0;
76 
77 
81  virtual ~pf_base(){};
82 };
83 
84 
85 /************************************************************************************************************/
86 
87 
97 template<typename float_t, size_t dimobs, size_t dimstate, size_t dimcov>
99 public:
100 
101  /* expose float type to users of this ABCTP */
102  using float_type = float_t;
103 
104  /* expose observation-sized vector type to users */
105  using obs_sized_vec = Eigen::Matrix<float_t,dimobs,1>;
106 
107  /* expose state-sized vector type to users */
108  using state_sized_vec = Eigen::Matrix<float_t,dimstate,1>;
109 
111  using cov_sized_vec = Eigen::Matrix<float_t,dimcov,1>;
112 
113  /* expose state-sized vector to users */
114  using dynamic_matrix = Eigen::Matrix<float_t,Eigen::Dynamic,Eigen::Dynamic>;
115 
116  /* a function */
117  using func = std::function<const dynamic_matrix(const state_sized_vec&,
118  const cov_sized_vec&)>;
119 
120  /* functions */
121  using func_vec = std::vector<func>;
122 
123  /* the dimension of each observation vector (allows indirect access to template parameters)*/
124  static constexpr unsigned int dim_obs = dimobs;
125 
126  /* the dimension of the state vector (allows indirect access to template parameters)*/
127  static constexpr unsigned int dim_state = dimstate;
128 
129 
135  virtual void filter(const obs_sized_vec &data,
136  const cov_sized_vec &cov,
137  const func_vec& fs = func_vec() ) = 0;
138 
139 
144  virtual float_t getLogCondLike() const = 0;
145 
146 
150  virtual ~pf_withcov_base(){};
151 };
152 
153 
154 /************************************************************************************************************/
155 
165 template<typename float_t, size_t dim_s_state, size_t dim_ns_state, size_t dimobs>
166 class rbpf_base {
167 public:
168 
169  /* expose observation-sized vector type to users */
170  using obs_sized_vec = Eigen::Matrix<float_t,dimobs,1>;
171 
172  /* expose sampled-state-size vector type to users */
173  using sampled_state_sized_vec = Eigen::Matrix<float_t,dim_s_state,1>;
174 
175  /* expose not-sampled-state-sized vector type to users */
176  using not_sampled_state_sized_vec = Eigen::Matrix<float_t,dim_ns_state,1>;
177 
178  /* expose state-sized vector to users */
179  using dynamic_matrix = Eigen::Matrix<float_t,Eigen::Dynamic,Eigen::Dynamic>;
180 
181  /* a function */
182  using func = std::function<const dynamic_matrix(const not_sampled_state_sized_vec&, const sampled_state_sized_vec&)>;
183 
184  /* functions */
185  using func_vec = std::vector<func>;
186 
187  /* the size of the sampled state portion */
188  static constexpr unsigned int dim_sampled_state = dim_s_state;
189 
190  /* the size of the not sampled state portion */
191  static constexpr unsigned int dim_not_sampled_state = dim_ns_state;
192 
193  /* the size of the observations */
194  static constexpr unsigned int dim_obs = dimobs;
195 
196 
202  virtual void filter(const obs_sized_vec &data, const func_vec& fs = func_vec() ) = 0;
203 
204 
208  virtual ~rbpf_base(){};
209 };
210 
211 
212 /************************************************************************************************************/
213 
214 
221 template<size_t dimx, size_t dimy, typename float_t>
222 class ForwardMod {
223 private:
224 
225  /* expose observation-sized vector type to users (private because they clash with pf_base) */
226  using obs_sized_vec = Eigen::Matrix<float_t,dimy,1>;
227 
228  /* expose state-sized vector type to users (private because they clash with pf_base) */
229  using state_sized_vec = Eigen::Matrix<float_t,dimx,1>;
230 
231 public:
232 
233  /* a pair of paths (xts first, yts second) */
234  using aPair = std::pair<std::vector<state_sized_vec>, std::vector<obs_sized_vec> >;
235 
236 
240  aPair sim_forward(unsigned int T);
241 
242 
247  virtual state_sized_vec muSamp() = 0;
248 
249 
256  virtual state_sized_vec fSamp (const state_sized_vec &xtm1) = 0;
257 
258 
265  virtual obs_sized_vec gSamp (const state_sized_vec &xt) = 0;
266 };
267 
268 
269 template<size_t dimx, size_t dimy, typename float_t>
270 auto ForwardMod<dimx,dimy,float_t>::sim_forward(unsigned int T) -> aPair {
271 
272  std::vector<state_sized_vec> xs;
273  std::vector<obs_sized_vec> ys;
274 
275  // time 1
276  xs.push_back(this->muSamp());
277  ys.push_back(this->gSamp(xs[0]));
278 
279  // time > 1
280  for(size_t i = 1; i < T; ++i) {
281 
282  auto xt = this->fSamp(xs[i-1]);
283  xs.push_back(xt);
284  ys.push_back(this->gSamp(xt));
285  }
286 
287  return aPair(xs, ys);
288 }
289 
290 
291 /************************************************************************************************************/
292 
293 
301 template<size_t dimx, size_t dimy, typename float_t>
303 private:
304 
305  /* expose observation-sized vector type to users (private because they clash with pf_base) */
306  using obs_sized_vec = Eigen::Matrix<float_t,dimy,1>;
307 
308  /* expose state-sized vector type to users (private because they clash with pf_base) */
309  using state_sized_vec = Eigen::Matrix<float_t,dimx,1>;
310 
311 public:
312 
313  /* a pair of paths (xts first, yts second) */
314  using aPair = std::pair<std::vector<state_sized_vec>, std::vector<obs_sized_vec> >;
315 
316 
320  aPair sim_forward(unsigned int T);
321 
322 
327  virtual state_sized_vec muSamp() = 0;
328 
329 
336  virtual state_sized_vec fSamp (const state_sized_vec &xtm1, const obs_sized_vec &ytm1) = 0;
337 
338 
345  virtual obs_sized_vec gSamp (const state_sized_vec &xt) = 0;
346 };
347 
348 
349 template<size_t dimx, size_t dimy, typename float_t>
350 auto GenForwardMod<dimx,dimy,float_t>::sim_forward(unsigned int T) -> aPair {
351 
352  std::vector<state_sized_vec> xs;
353  std::vector<obs_sized_vec> ys;
354 
355  // time 1
356  xs.push_back(this->muSamp());
357  ys.push_back(this->gSamp(xs[0]));
358 
359  // time > 1
360  for(size_t i = 1; i < T; ++i) {
361 
362  auto xt = this->fSamp(xs[i-1], ys[i-1]);
363  xs.push_back(xt);
364  ys.push_back(this->gSamp(xt));
365  }
366 
367  return aPair(xs, ys);
368 }
369 
370 
371 /************************************************************************************************************/
372 
380 template<size_t dimx, size_t dimy, typename float_t, size_t nparts>
382 private:
383 
384  /* expose observation-sized vector type to users (private because they clash with pf_base) */
385  using obs_sized_vec = Eigen::Matrix<float_t,dimy,1>;
386 
387  /* expose state-sized vector type to users */
388  using state_sized_vec = Eigen::Matrix<float_t,dimx,1>;
389 
390 public:
391  /* one time point's pair of of nparts states and nparts observations */
392  using timePair = std::pair<std::array<state_sized_vec, nparts>, std::array<obs_sized_vec, nparts> >;
393 
394  /* many path pairs. time, (state/obs), particle */
395  using manyPairs = std::vector<timePair>;
396 
397  /* observation paths (time, particle) */
398  using obsPaths = std::vector<std::array<obs_sized_vec, nparts> >;
399 
400  /* many state paths (time, particle) */
401  using statePaths = std::vector<std::array<state_sized_vec, nparts> >;
402 
403 
410  manyPairs sim_future(unsigned int num_time_steps);
411 
412 
419  obsPaths sim_future_obs(unsigned int num_time_steps);
420 
421 
428  statePaths sim_future_states(unsigned int num_time_steps);
429 
430 
434  virtual std::array<state_sized_vec,nparts> get_uwtd_samps() const = 0;
435 
436 
443  virtual state_sized_vec fSamp (const state_sized_vec &xtm1) = 0;
444 
445 
451  virtual obs_sized_vec gSamp (const state_sized_vec &xt) = 0;
452 };
453 
454 
455 template<size_t dimx, size_t dimy, typename float_t, size_t nparts>
456 auto FutureSimulator<dimx,dimy,float_t,nparts>::sim_future(unsigned int num_time_steps) -> manyPairs {
457 
458  // this gets returned
459  manyPairs allFutures;
460 
461  // stuff that gets changed every time loop
462  std::array<state_sized_vec, nparts> states;
463  std::array<obs_sized_vec, nparts> observations;
464  std::array<state_sized_vec,nparts> past_states;
465  std::array<state_sized_vec,nparts> first_states = this->get_uwtd_samps();
466 
467  // iterate over time
468  for(unsigned int time = 0; time < num_time_steps; ++time){
469 
470  // use particle filter's most recent information if you're going one step ahead into the future
471  // otherwise use output generated in a previous iteration of this time loop
472  if(time == 0){
473  past_states = first_states;
474  }
475 
476  // go particle by particle
477  for(size_t j = 0; j < nparts; ++j){
478  states[j] = this->fSamp( past_states[j] );
479  observations[j] = this->gSamp( states[j] );
480  }
481 
482  // add time period content
483  allFutures.push_back(timePair(states, observations)); //TODO make sure deep copy
484  past_states = states;
485  }
486 
487  return allFutures;
488 }
489 
490 
491 template<size_t dimx, size_t dimy, typename float_t, size_t nparts>
492 auto FutureSimulator<dimx,dimy,float_t,nparts>::sim_future_obs(unsigned int num_time_steps) -> obsPaths {
493 
494  // this gets returned
495  manyPairs obs_and_state_paths = this->sim_future(num_time_steps);
496  obsPaths future_obs;
497  for(size_t time = 0; time < obs_and_state_paths.size(); ++time){
498  future_obs.push_back( std::get<1>(obs_and_state_paths[time]) );
499  }
500 
501  return future_obs;
502 }
503 
504 
505 template<size_t dimx, size_t dimy, typename float_t, size_t nparts>
506 auto FutureSimulator<dimx,dimy,float_t,nparts>::sim_future_states(unsigned int num_time_steps) -> statePaths {
507 
508  // this gets returned
509  statePaths future_states;
510  manyPairs obs_and_state_paths = sim_future(num_time_steps);
511  for(size_t time = 0; time < obs_and_state_paths.size(); ++time){
512  future_states.push_back( std::get<0>(obs_and_state_paths[time]) );
513  }
514 
515  return future_states;
516 }
517 
518 
519 /************************************************************************************************************/
520 
529 template<size_t dimx, size_t dimy, typename float_t, size_t nparts>
531 private:
532 
533  /* expose observation-sized vector type to users (private because they clash with pf_base) */
534  using obs_sized_vec = Eigen::Matrix<float_t,dimy,1>;
535 
536  /* expose state-sized vector type to users */
537  using state_sized_vec = Eigen::Matrix<float_t,dimx,1>;
538 
539 public:
540  /* one time point's pair of of nparts states and nparts observations */
541  using timePair = std::pair<std::array<state_sized_vec, nparts>, std::array<obs_sized_vec, nparts> >;
542 
543  /* many path pairs. time, (state/obs), particle */
544  using manyPairs = std::vector<timePair>;
545 
546  /* observation paths (time, particle) */
547  using obsPaths = std::vector<std::array<obs_sized_vec, nparts> >;
548 
549  /* many state paths (time, particle) */
550  using statePaths = std::vector<std::array<state_sized_vec, nparts> >;
551 
552 
559  manyPairs sim_future(unsigned int num_time_steps, const obs_sized_vec &yt);
560 
561 
568  obsPaths sim_future_obs(unsigned int num_time_steps, const obs_sized_vec &yt);
569 
570 
577  statePaths sim_future_states(unsigned int num_time_steps, const obs_sized_vec &yt);
578 
579 
583  virtual std::array<state_sized_vec,nparts> get_uwtd_samps() const = 0;
584 
585 
592  virtual state_sized_vec fSamp (const state_sized_vec &xtm1, const obs_sized_vec &ytm1) = 0;
593 
594 
600  virtual obs_sized_vec gSamp (const state_sized_vec &xt) = 0;
601 };
602 
603 
604 template<size_t dimx, size_t dimy, typename float_t, size_t nparts>
605 auto GenFutureSimulator<dimx,dimy,float_t,nparts>::sim_future(unsigned int num_time_steps, const obs_sized_vec &yt) -> manyPairs {
606 
607  // this gets returned
608  manyPairs allFutures;
609 
610  // stuff that gets changed every time loop
611  std::array<state_sized_vec, nparts> states;
612  std::array<obs_sized_vec, nparts> observations;
613  std::array<state_sized_vec,nparts> past_states;
614  std::array<obs_sized_vec,nparts> past_obs;
615  std::array<state_sized_vec, nparts> first_states = this->get_uwtd_samps();
616 
617  // iterate over time
618  for(unsigned int time = 0; time < num_time_steps; ++time){
619 
620  // use particle filter's most recent information if you're going one step ahead into the future
621  // otherwise use output generated in a previous iteration of this time loop
622  if(time == 0){
623  past_states = first_states;
624  past_obs.fill(yt);
625  }
626 
627  // go particle by particle
628  for(size_t j = 0; j < nparts; ++j){
629  states[j] = this->fSamp( past_states[j], past_obs[j] );
630  observations[j] = this->gSamp( states[j] );
631  }
632 
633  // add time period content
634  allFutures.push_back(timePair(states, observations)); //TODO make sure deep copy
635  past_states = states;
636  past_obs = observations;
637  }
638 
639  return allFutures;
640 }
641 
642 
643 template<size_t dimx, size_t dimy, typename float_t, size_t nparts>
644 auto GenFutureSimulator<dimx,dimy,float_t,nparts>::sim_future_obs(unsigned int num_time_steps, const obs_sized_vec &yt) -> obsPaths {
645 
646  // this gets returned
647  manyPairs obs_and_state_paths = this->sim_future(num_time_steps, yt);
648  obsPaths future_obs;
649  for(size_t time = 0; time < obs_and_state_paths.size(); ++time){
650  future_obs.push_back( std::get<1>(obs_and_state_paths[time]) );
651  }
652 
653  return future_obs;
654 }
655 
656 
657 template<size_t dimx, size_t dimy, typename float_t, size_t nparts>
658 auto GenFutureSimulator<dimx,dimy,float_t,nparts>::sim_future_states(unsigned int num_time_steps, const obs_sized_vec &yt) -> statePaths {
659 
660  // this gets returned
661  statePaths future_states;
662  manyPairs obs_and_state_paths = sim_future(num_time_steps,yt);
663  for(size_t time = 0; time < obs_and_state_paths.size(); ++time){
664  future_states.push_back( std::get<0>(obs_and_state_paths[time]) );
665  }
666 
667  return future_states;
668 }
669 
670 /************************************************************************************************************/
671 
672 
674 
680 template<size_t dimstate, size_t dimobs, typename float_t>
681 class cf_filter{
682 
683 public:
684 
685  /* expose observation-sized vector type to users */
686  using obs_sized_vec = Eigen::Matrix<float_t,dimobs,1>;
687 
688  /* expose state-sized vector type to users */
689  using state_sized_vec = Eigen::Matrix<float_t,dimstate,1>;
690 
694  virtual ~cf_filter();
695 
696 
701  virtual float_t getLogCondLike() const = 0;
702 };
703 
704 
705 template<size_t dimstate, size_t dimobs, typename float_t>
707 
708 
709 /************************************************************************************************************/
710 
711 
723 template<typename float_t, size_t dimobs, size_t dimstate, size_t dimu, size_t dimur, size_t numparts>
724 class pf_base_crn {
725 public:
726 
727  /* expose float type to users of this ABCTP */
728  using float_type = float_t;
729 
730  /* expose observation-sized vector type to users */
731  using obs_sized_vec = Eigen::Matrix<float_t,dimobs,1>;
732 
733  /* expose state-sized vector type to users */
734  using state_sized_vec = Eigen::Matrix<float_t,dimstate,1>;
735 
736  /* expose state-sized vector to users */
737  using dynamic_matrix = Eigen::Matrix<float_t,Eigen::Dynamic,Eigen::Dynamic>;
738 
739  /* a function */
740  using func = std::function<const dynamic_matrix(const state_sized_vec&)>;
741 
742  /* functions */
743  using func_vec = std::vector<func>;
744 
745  /* type for common random numbers used for sampling state proposals*/
746  using usv = Eigen::Matrix<float_t, dimu, 1>;
747 
748  /* type for common random numbers used for resampling at a given time point */
749  using usvr = Eigen::Matrix<float_t, dimur, 1>;
750 
751  /* the dimension of each observation vector (allows indirect access to template parameters)*/
752  static constexpr unsigned int dim_obs = dimobs;
753 
754  /* the dimension of the state vector (allows indirect access to template parameters)*/
755  static constexpr unsigned int dim_state = dimstate;
756 
757 
763  virtual void filter(const obs_sized_vec &data, const std::array<usv,numparts>& Us, const usvr& Uresamp, const func_vec& fs = func_vec() ) = 0;
764 
765 
770  virtual float_t getLogCondLike() const = 0;
771 
772 
776  virtual ~pf_base_crn(){};
777 };
778 
779 } // namespace bases
780 } // namespace pf
781 #endif // PF_BASE_H
pf::bases::pf_withcov_base::~pf_withcov_base
virtual ~pf_withcov_base()
virtual destructor
Definition: pf_base.h:150
pf::bases::pf_base_crn
Definition: pf_base.h:724
pf::bases::pf_base
Definition: pf_base.h:35
pf::bases::FutureSimulator::fSamp
virtual state_sized_vec fSamp(const state_sized_vec &xtm1)=0
returns a sample from the latent Markov transition
pf::bases::GenForwardMod::fSamp
virtual state_sized_vec fSamp(const state_sized_vec &xtm1, const obs_sized_vec &ytm1)=0
returns a sample from the latent Markov transition
pf::bases::GenForwardMod::sim_forward
aPair sim_forward(unsigned int T)
simulates once forward through time from p(x_{1:T}, y_{1:T} | theta)
Definition: pf_base.h:350
pf::bases::GenFutureSimulator::sim_future
manyPairs sim_future(unsigned int num_time_steps, const obs_sized_vec &yt)
simulates future state and observations paths from p(x_{t+1:T},y_{t+1:T} | y_{1:t},...
Definition: pf_base.h:605
pf::bases::ForwardMod
Definition: pf_base.h:222
pf::bases::cf_filter::~cf_filter
virtual ~cf_filter()
The (virtual) destructor.
Definition: pf_base.h:706
pf::bases::pf_withcov_base< float_t, dimy, dimx, dimcov >::cov_sized_vec
Eigen::Matrix< float_t, dimcov, 1 > cov_sized_vec
Definition: pf_base.h:111
pf::bases::GenForwardMod::muSamp
virtual state_sized_vec muSamp()=0
samples from the first time's state distribution
pf::bases::FutureSimulator::sim_future_obs
obsPaths sim_future_obs(unsigned int num_time_steps)
simulates future observation paths from p(y_{t+1:T} | y_{1:t}, theta)
Definition: pf_base.h:492
pf::bases::rbpf_base::~rbpf_base
virtual ~rbpf_base()
virtual destructor
Definition: pf_base.h:208
pf::bases::FutureSimulator::sim_future
manyPairs sim_future(unsigned int num_time_steps)
simulates future state and observations paths from p(x_{t+1:T},y_{t+1:T} | y_{1:t},...
Definition: pf_base.h:456
pf::bases::ForwardMod::fSamp
virtual state_sized_vec fSamp(const state_sized_vec &xtm1)=0
returns a sample from the latent Markov transition
pf::bases::FutureSimulator::sim_future_states
statePaths sim_future_states(unsigned int num_time_steps)
simulates future state paths from p(x_{t+1:T} | y_{1:t}, theta)
Definition: pf_base.h:506
pf::bases::rbpf_base
Definition: pf_base.h:166
pf::bases::GenFutureSimulator
Definition: pf_base.h:530
pf::bases::GenForwardMod
Definition: pf_base.h:302
pf::bases::GenFutureSimulator::sim_future_states
statePaths sim_future_states(unsigned int num_time_steps, const obs_sized_vec &yt)
simulates future state paths from p(x_{t+1:T} | y_{1:t}, theta)
Definition: pf_base.h:658
pf::bases::pf_base::getLogCondLike
virtual float_t getLogCondLike() const =0
the getter method that must be defined (for conditional log-likelihood)
pf::bases::pf_base::filter
virtual void filter(const obs_sized_vec &data, const func_vec &fs=func_vec())=0
the filtering function that must be defined
pf::bases::GenFutureSimulator::gSamp
virtual obs_sized_vec gSamp(const state_sized_vec &xt)=0
returns a sample for the observed series
pf::bases::FutureSimulator::get_uwtd_samps
virtual std::array< state_sized_vec, nparts > get_uwtd_samps() const =0
gets the most recent unweighted samples, to be fed into sim_future()
pf::bases::GenFutureSimulator::get_uwtd_samps
virtual std::array< state_sized_vec, nparts > get_uwtd_samps() const =0
gets the most recent unweighted samples, to be fed into sim_future()
pf::bases::pf_withcov_base::getLogCondLike
virtual float_t getLogCondLike() const =0
the getter method that must be defined (for conditional log-likelihood)
pf::bases::ForwardMod::gSamp
virtual obs_sized_vec gSamp(const state_sized_vec &xt)=0
returns a sample for the observed series
pf::bases::cf_filter::getLogCondLike
virtual float_t getLogCondLike() const =0
returns the log of the most recent conditional likelihood
pf::bases::ForwardMod::sim_forward
aPair sim_forward(unsigned int T)
simulates once forward through time from p(x_{1:T}, y_{1:T} | theta)
Definition: pf_base.h:270
pf::bases::GenFutureSimulator::sim_future_obs
obsPaths sim_future_obs(unsigned int num_time_steps, const obs_sized_vec &yt)
simulates future observation paths from p(y_{t+1:T} | y_{1:t}, theta)
Definition: pf_base.h:644
pf::bases::rbpf_base::filter
virtual void filter(const obs_sized_vec &data, const func_vec &fs=func_vec())=0
the filtering function that must be defined
pf::bases::FutureSimulator
Definition: pf_base.h:381
pf::bases::FutureSimulator::gSamp
virtual obs_sized_vec gSamp(const state_sized_vec &xt)=0
returns a sample for the observed series
pf::bases::ForwardMod::muSamp
virtual state_sized_vec muSamp()=0
samples from the first time's state distribution
pf::bases::pf_withcov_base
Definition: pf_base.h:98
pf::bases::pf_base_crn::getLogCondLike
virtual float_t getLogCondLike() const =0
the getter method that must be defined (for conditional log-likelihood)
pf::bases::pf_withcov_base::filter
virtual void filter(const obs_sized_vec &data, const cov_sized_vec &cov, const func_vec &fs=func_vec())=0
the filtering function that must be defined
pf::bases::pf_base_crn::~pf_base_crn
virtual ~pf_base_crn()
virtual destructor
Definition: pf_base.h:776
pf::bases::GenForwardMod::gSamp
virtual obs_sized_vec gSamp(const state_sized_vec &xt)=0
returns a sample for the observed series
pf::bases::pf_base_crn::filter
virtual void filter(const obs_sized_vec &data, const std::array< usv, numparts > &Us, const usvr &Uresamp, const func_vec &fs=func_vec())=0
the filtering function that must be defined
pf::bases::pf_base::~pf_base
virtual ~pf_base()
virtual destructor
Definition: pf_base.h:81
pf::bases::GenFutureSimulator::fSamp
virtual state_sized_vec fSamp(const state_sized_vec &xtm1, const obs_sized_vec &ytm1)=0
returns a sample from the latent Markov transition
pf::bases::cf_filter
Abstract Base Class for all closed-form filters.
Definition: pf_base.h:681