Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[e23e50]: src / modules / glm / samplers / AlbertChib.h Maximize Restore History

Download this file

AlbertChib.h    58 lines (52 with data), 1.9 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
55
56
57
#ifndef ALBERT_CHIB_H_
#define ALBERT_CHIB_H_
#include "GLMMethod.h"
namespace jags {
namespace glm {
/**
* @Short Albert and Chib sampler for binary GLMs
*
* Sampler for probit models with binary outcomes using the
* auxiliary variable algorithm described by Albert, J. and Chib,
* S. (1993). Bayesian analysis of binary and polychotomous
* response data. Journal of the American Statistical Association,
* 88:669-679.
*
* The algorithm is extended to logistic regression models by
* considering a latent auxiliary variable with a logistic
* distribution as a scale mixture of normals. This extension was
* proposed by Holmes C and Held L (2006). Bayesian Auxiliary
* Variables Models for Binary and Multinomial Regression,
* Bayesian Analysis, 1:148-168.
*
* A second algorithm for binary logistic models is implemented
* in the class HolmesHeld.
*/
class AlbertChib : public GLMMethod {
bool _gibbs; //Do we update parameters individually?
bool _aux_init; //Do we need to initialize auxiliary variables?
public:
/**
* Constructor.
*
* @param gibbs Should the update method use Gibbs sampling?
* See GLMMethod#updateLMGibbs
*
* @see GLMMethod#GLMMethod
*/
AlbertChib(GraphView const *view,
std::vector<SingletonGraphView const *> const &sub_views,
std::vector<Outcome *> const &outcomes,
unsigned int chain, bool gibbs);
/**
* The update takes place in two steps. First the auxiliary
* variables provided by the Outcome class are updated. Then
* the parameters of the model are updated by calling either
* GLMMethod#updateLM or GLMMethod#updateLMGibbs. The latter
* is used if the parameter "gibbs" was set to true in the
* constructor.
*/
void update(RNG *rng);
};
}}
#endif /* ALBERT_CHIB_H_ */