libspatialSEIR  0.1
Bayesian Spatial SEIR Modeling
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
LSS_Samplers.hpp
Go to the documentation of this file.
1 #ifndef SPATIALSEIR_INCLUDEFILES
2 #define SPATIALSEIR_INCLUDEFILES
3 
4 #include<cstring>
5 #include<vector>
6 #endif
7 
8 #ifndef LSS_SAMPLERS_INC
9 #define LSS_SAMPLERS_INC
10 
11 #define COMPARTMENT_METROPOLIS_SAMPLER 1
12 #define COMPARTMENT_IDX_METROPOLIS_SAMPLER 2
13 #define COMPARTMENT_IDX_SLICE_SAMPLER 3
14 #define COMPARTMENT_BINOM_PROPOSAL_METROPOLIS_SAMPLER 14
15 #define COMPARTMENT_BINOM_PROPOSAL_SLICE_SAMPLER 15
16 #define COMPARTMENT_BINOM_IDX_METROPOLIS_SAMPLER 16
17 #define INITCOMPARTMENT_METROPOLIS_SAMPLER 4
18 #define INITCOMPARTMENT_IDX_METROPOLIS_SAMPLER 5
19 #define INITCOMPARTMENT_IDX_SLICE_SAMPLER 6
20 #define PARAMETER_SINGLE_METROPOLIS_SAMPLER 7
21 #define PARAMETER_JOINT_METROPOLIS_SAMPLER 8
22 #define PARAMETER_JOINT_SLICE_SAMPLER 9
23 #define PARAMETER_DECORR_SAMPLER 10
24 
25 #define COMPARTMENT_METROPOLIS_SAMPLER_OCL 11
26 #define INITCOMPARTMENT_METROPOLIS_SAMPLER_OCL 12
27 #define PARAMETER_JOINT_METROPOLIS_SAMPLER_OCL 13
28 #define PARAMETER_NULL_SAMPLER 17
29 #define HYBRID_SAMPLER_BETA_P_EI 18
30 
31 
32 namespace SpatialSEIR
33 {
34  class FullConditional;
35  class CompartmentFullConditional;
36  class InitCompartmentFullConditional;
37  class ParameterFullConditional;
38  class ModelContext;
39  class CompartmentalModelMatrix;
40  class CovariateMatrix;
41  class RandomNumberProvider;
42  class OCLProvider;
43 
46  class Sampler
47  {
48  public:
49  virtual ~Sampler(){};
50  virtual void drawSample() = 0;
51  virtual int getSamplerType() = 0;
52  };
53 
54 
60  {
62  void drawSample();
63  int getSamplerType();
65  };
66 
71  {
72  public:
74  std::vector<ParameterFullConditional*> parameterFullConditionals,
75  std::vector<double*> parameters,
76  int samplerType);
77  void drawSample();
78  int getSamplerType();
82  double* parameterCache;
83 
84  std::vector<ParameterFullConditional*>* parameterFullConditionals;
85  std::vector<double*>* parameters;
87  };
88 
92  {
93  public:
96  int* compartmentData);
97  void drawSample();
98  int getSamplerType();
100 
104  };
105 
110  {
111  public:
114  int* compartmentData);
115  void drawSample();
116  int getSamplerType();
118 
122  };
123 
129  {
130  public:
133  int* compartmentData);
134  void drawSample();
135  int getSamplerType();
137 
140  int** indexLength;
142  int** indexList;
143  };
149  {
150  public:
153  int* compartmentData);
154  void drawSample();
155  int getSamplerType();
157 
160  int** indexLength;
162  int** indexList;
163  };
164 
165 
169  {
170  public:
173  int* compartmentData,
174  int* compartmentFrom,
175  int* compartmentTo,
176  double* probabilityVector,
178  void drawSample();
179  int getSamplerType();
180  void genProposal();
182 
190  };
191 
196  {
197  public:
200  int* compartmentData,
201  int* compartmentFrom,
202  int* compartmentTo,
203  double* probabilityVector,
205  void drawSample();
206  int getSamplerType();
207  void genProposal();
209 
212  int** indexLength;
213  int** indexList;
219  };
220 
221 
222 
223 
227  {
228  public:
231  int* compartmentData,
232  int* compartmentFrom,
233  int* compartmentTo,
234  double* probabilityVector,
236  void drawSample();
237  int getSamplerType();
238  void genProposal();
240 
248  };
249 
250 
251 
252 
253 
257  {
258  public:
261  int* initCompartmentData);
262  void drawSample();
263  int getSamplerType();
265 
269  };
270 
274  {
275  public:
278  int* initCompartmentData);
279  void drawSample();
280  int getSamplerType();
282 
286  };
287 
290  {
291  public:
294  int* initCompartmentData);
295  void drawSample();
296  int getSamplerType();
298 
301  int** indexLength;
302  int** indexList;
304 
305  };
306 
309  {
310  public:
313  int* initCompartmentData);
314  void drawSample();
315  int getSamplerType();
317 
320  int** indexLength;
321  int** indexList;
323  };
324 
329  {
330  public:
333  double* param);
334  void drawSample();
335  int getSamplerType();
337 
338  double** param;
341  };
342 
347  {
348  public:
351  double* param);
352  void drawSample();
353  int getSamplerType();
355 
356  double** param;
359  };
360 
366  {
367  public:
370  double* param);
371  void drawSample();
372  int getSamplerType();
374 
375  double** param;
378  };
379 
384  {
385  public:
388  double* param);
389  void drawSample();
390  int getSamplerType();
392 
393  double** param;
396  };
397 
402  {
403  public:
406  double* param,
408  void drawSample();
409  int getSamplerType();
411 
412  double** param;
413  double* proposalCache;
414  double* proposalCache2;
418  };
419 
420 }
421 #endif
Definition: LSS_FullConditional.hpp:115
int ** initCompartmentData
Definition: LSS_Samplers.hpp:322
int ** indexList
Definition: LSS_Samplers.hpp:321
ModelContext ** context
Definition: LSS_Samplers.hpp:241
CompartmentBinomialSliceSampler(ModelContext *context, CompartmentFullConditional *compartmentFC, int *compartmentData, int *compartmentFrom, int *compartmentTo, double *probabilityVector, int probabilityVectorLen)
ModelContext ** context
Definition: LSS_Samplers.hpp:415
IndexedInitCompartmentMetropolisSampler(ModelContext *context, InitCompartmentFullConditional *initCompartmentFC, int *initCompartmentData)
int ** compartmentData
Definition: LSS_Samplers.hpp:214
int ** compartmentData
Definition: LSS_Samplers.hpp:185
int ** indexLength
Definition: LSS_Samplers.hpp:301
int ** compartmentData
Definition: LSS_Samplers.hpp:103
CompartmentFullConditional ** compartmentFC
Definition: LSS_Samplers.hpp:120
CompartmentMetropolisSampler_OCL(ModelContext *context, CompartmentFullConditional *compartmentFC, int *compartmentData)
ParameterHybridSampler(ModelContext *context, std::vector< ParameterFullConditional * > parameterFullConditionals, std::vector< double * > parameters, int samplerType)
int ** indexList
Definition: LSS_Samplers.hpp:142
int ** indexList
Definition: LSS_Samplers.hpp:213
ParameterFullConditional ** paramFC
Definition: LSS_Samplers.hpp:340
int ** compartmentFrom
Definition: LSS_Samplers.hpp:244
ModelContext ** context
Definition: LSS_Samplers.hpp:119
Definition: LSS_Samplers.hpp:365
Definition: LSS_FullConditional.hpp:177
CompartmentFullConditional ** compartmentFC
Definition: LSS_Samplers.hpp:184
Definition: LSS_Samplers.hpp:59
double * proposalCache
Definition: LSS_Samplers.hpp:413
CompartmentMetropolisSampler(ModelContext *context, CompartmentFullConditional *compartmentFC, int *compartmentData)
Definition: LSS_FullConditional.hpp:147
ParameterFullConditional ** paramFC
Definition: LSS_Samplers.hpp:416
double ** param
Definition: LSS_Samplers.hpp:356
Definition: CovariateMatrix.hpp:29
ParameterJointMetropolisSampler_OCL(ModelContext *context, ParameterFullConditional *paramFC, double *param)
int ** indexLength
Definition: LSS_Samplers.hpp:212
ModelContext ** context
Definition: LSS_Samplers.hpp:318
virtual ~Sampler()
Definition: LSS_Samplers.hpp:49
std::vector< ParameterFullConditional * > * parameterFullConditionals
Definition: LSS_Samplers.hpp:84
IndexedCompartmentMetropolisSampler(ModelContext *context, CompartmentFullConditional *compartmentFC, int *compartmentData)
int ** compartmentData
Definition: LSS_Samplers.hpp:141
int ** initCompartmentData
Definition: LSS_Samplers.hpp:285
CompartmentFullConditional ** compartmentFC
Definition: LSS_Samplers.hpp:159
int ** initCompartmentData
Definition: LSS_Samplers.hpp:303
ModelContext ** context
Definition: LSS_Samplers.hpp:299
virtual int getSamplerType()=0
double ** param
Definition: LSS_Samplers.hpp:338
int ** indexLength
Definition: LSS_Samplers.hpp:160
ModelContext ** context
Definition: LSS_Samplers.hpp:79
Definition: LSS_Samplers.hpp:91
ParameterFullConditional ** paramFC
Definition: LSS_Samplers.hpp:358
double ** param
Definition: LSS_Samplers.hpp:375
int ** indexLength
Definition: LSS_Samplers.hpp:140
int ** initCompartmentData
Definition: LSS_Samplers.hpp:268
ModelContext ** context
Definition: LSS_Samplers.hpp:394
int * probabilityVectorLen
Definition: LSS_Samplers.hpp:189
ModelContext ** context
Definition: LSS_Samplers.hpp:101
IndexedCompartmentBinomialMetropolisSampler(ModelContext *context, CompartmentFullConditional *compartmentFC, int *compartmentData, int *compartmentFrom, int *compartmentTo, double *probabilityVector, int probabilityVectorLen)
Definition: LSS_Samplers.hpp:346
ModelContext ** context
Definition: LSS_Samplers.hpp:158
int * samplerType
Definition: LSS_Samplers.hpp:80
int ** compartmentTo
Definition: LSS_Samplers.hpp:216
Definition: LSS_Samplers.hpp:128
ModelContext ** context
Definition: LSS_Samplers.hpp:376
Definition: LSS_Samplers.hpp:328
CompartmentFullConditional ** compartmentFC
Definition: LSS_Samplers.hpp:242
ParameterDecorrelationSampler(ModelContext *context, ParameterFullConditional *paramFC, double *param, CovariateMatrix *proposalMatrix)
ModelContext ** context
Definition: LSS_Samplers.hpp:283
double * proposalCache2
Definition: LSS_Samplers.hpp:414
int ** compartmentData
Definition: LSS_Samplers.hpp:243
Definition: LSS_Samplers.hpp:109
InitCompartmentMetropolisSampler(ModelContext *context, InitCompartmentFullConditional *initCompartmentFC, int *initCompartmentData)
CompartmentFullConditional ** compartmentFC
Definition: LSS_Samplers.hpp:139
double ** probabilityVector
Definition: LSS_Samplers.hpp:217
Definition: LSS_Samplers.hpp:383
Definition: LSS_Samplers.hpp:308
double ** param
Definition: LSS_Samplers.hpp:412
CovariateMatrix ** proposalMatrix
Definition: LSS_Samplers.hpp:417
ParameterFullConditional ** paramFC
Definition: LSS_Samplers.hpp:395
ModelContext ** context
Definition: LSS_Samplers.hpp:138
InitCompartmentFullConditional ** initCompartmentFC
Definition: LSS_Samplers.hpp:300
Definition: LSS_Samplers.hpp:148
ModelContext ** context
Definition: LSS_Samplers.hpp:183
IndexedCompartmentSliceSampler(ModelContext *context, CompartmentFullConditional *compartmentFC, int *compartmentData)
int ** compartmentData
Definition: LSS_Samplers.hpp:121
InitCompartmentFullConditional ** initCompartmentFC
Definition: LSS_Samplers.hpp:284
ModelContext ** context
Definition: LSS_Samplers.hpp:266
CompartmentFullConditional ** compartmentFC
Definition: LSS_Samplers.hpp:102
CompartmentBinomialMetropolisSampler(ModelContext *context, CompartmentFullConditional *compartmentFC, int *compartmentData, int *compartmentFrom, int *compartmentTo, double *probabilityVector, int probabilityVectorLen)
ParameterJointSliceSampler(ModelContext *context, ParameterFullConditional *paramFC, double *param)
InitCompartmentFullConditional ** initCompartmentFC
Definition: LSS_Samplers.hpp:319
Definition: LSS_Samplers.hpp:46
Definition: LSS_Samplers.hpp:226
ParameterSingleMetropolisSampler(ModelContext *context, ParameterFullConditional *paramFC, double *param)
double ** probabilityVector
Definition: LSS_Samplers.hpp:246
int ** indexList
Definition: LSS_Samplers.hpp:162
virtual void drawSample()=0
int ** compartmentTo
Definition: LSS_Samplers.hpp:245
int ** compartmentTo
Definition: LSS_Samplers.hpp:187
int * totalParamSize
Definition: LSS_Samplers.hpp:81
double ** param
Definition: LSS_Samplers.hpp:393
int ** compartmentData
Definition: LSS_Samplers.hpp:161
int * probabilityVectorLen
Definition: LSS_Samplers.hpp:247
int ** compartmentFrom
Definition: LSS_Samplers.hpp:186
IndexedInitCompartmentSliceSampler(ModelContext *context, InitCompartmentFullConditional *initCompartmentFC, int *initCompartmentData)
InitCompartmentMetropolisSampler_OCL(ModelContext *context, InitCompartmentFullConditional *initCompartmentFC, int *initCompartmentData)
Definition: LSS_Samplers.hpp:256
std::vector< double * > * parameters
Definition: LSS_Samplers.hpp:85
ModelContext ** context
Definition: LSS_Samplers.hpp:357
ParameterFullConditional ** paramFC
Definition: LSS_Samplers.hpp:377
double * parameterCache
Definition: LSS_Samplers.hpp:82
double ** probabilityVector
Definition: LSS_Samplers.hpp:188
int * probabilityVectorLen
Definition: LSS_Samplers.hpp:218
ParameterJointMetropolisSampler(ModelContext *context, ParameterFullConditional *paramFC, double *param)
int ** indexList
Definition: LSS_Samplers.hpp:302
Definition: LSS_Samplers.hpp:70
ModelContext ** context
Definition: LSS_Samplers.hpp:339
Definition: ModelContext.hpp:82
ModelContext ** context
Definition: LSS_Samplers.hpp:210
int ** indexLength
Definition: LSS_Samplers.hpp:320
InitCompartmentFullConditional ** initCompartmentFC
Definition: LSS_Samplers.hpp:267
CompartmentFullConditional ** compartmentFC
Definition: LSS_Samplers.hpp:211
Definition: LSS_Samplers.hpp:401
int ** compartmentFrom
Definition: LSS_Samplers.hpp:215