[081fbe]: src / modules / glm / samplers / AMMethod.h Maximize Restore History

Download this file

AMMethod.h    55 lines (48 with data), 1.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef AM_METHOD_H_
#define AM_METHOD_H_
#include "GLMMethod.h"
namespace glm {
class AuxMix;
/**
* @short Auxiliary Mixture sampler for Poisson and Binomial GLMs
*
* Sampler for Poisson and logistic regression proposed by Sylvia
* Fruhwirth-Schnatter, Rudolf Fruhwirth, Leonhard Held, Havard
* Rue (2009) Improved auxiliary mixture sampling for hierarchical
* models of non-Gaussian data. Statistics and Computing 19: 479-492
*
* The auxiliary mixture method uses data augmentation to replace
* the discrete outcome with a latent continous auxiliary
* variable, and then uses a finite mixture approximation to treat
* the auxiliary variables as normal.
*/
class AMMethod : public GLMMethod {
std::vector<AuxMix*> _aux;
public:
AMMethod(GraphView const *view,
std::vector<GraphView const *> const &sub_views,
unsigned int chain);
~AMMethod();
/**
* Returns "AuxiliaryMixture"
*/
std::string name() const;
/**
* Returns the precision parameter of the auxiliary variable
* for the outcome variable with index i, according to the
* current normal mixture approximation.
*/
double getPrecision(unsigned int i) const;
/**
* Returns the value of the auxiliary variable for the outcome
* with index i, according to the current normal mixture
* approximation.
*/
double getValue(unsigned int i) const;
/**
* Updates the auxiliary variables and then calls updateLM
*/
void update(RNG *rng);
};
}
#endif /* AM_METHOD_H_ */