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

Download this file

46 lines (40 with data), 1.2 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
#ifndef LINEAR_H_
#define LINEAR_H_
#include "GLMMethod.h"
namespace jags {
namespace glm {
/**
* Conjugate sampler for normal linear models.
*/
class Linear : public GLMMethod {
bool _gibbs;
public:
/**
* Constructor. See GLMMethod#GLMMethod for an explanation of the
* parameters
*
* @param gibbs Boolean flag. If true then the parameters of the
* linear model will be updated element-wise by Gibbs sampling.
* If false then they will be updated by block-sampling from the
* joint posterior
*/
Linear(GraphView const *view,
std::vector<SingletonGraphView const *> const &sub_views,
std::vector<Outcome *> const &outcomes,
unsigned int chain, bool gibbs);
/**
* Returns the precision of the outcome variable with index i
*/
double getPrecision(unsigned int i) const;
/**
* Returns the value of the outcome variable with index i
*/
double getValue(unsigned int i) const;
/**
* Calls GLMMethod#updateLM or GLMMethod#updateLMGibbs depending
* on the value of the parameter "gibbs" in the constructor.
*/
void update(RNG *rng);
};
}}
#endif /* LINEAR_H_ */

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks