[4634c7]: src / modules / glm / samplers / Linear.cc  Maximize  Restore  History

Download this file

48 lines (38 with data), 942 Bytes

 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
#include <config.h>
#include "Linear.h"
#include <graph/StochasticNode.h>
#include <sampler/SingletonGraphView.h>
using std::vector;
using std::string;
namespace jags {
namespace glm {
Linear::Linear(GraphView const *view,
vector<SingletonGraphView const *> const &sub_views,
vector<Outcome*> const &outcomes,
unsigned int chain, bool gibbs)
: GLMMethod(view, sub_views, outcomes, chain, false), _gibbs(gibbs)
{
}
double Linear::getPrecision(unsigned int i) const
{
return _view->stochasticChildren()[i]->parents()[1]->value(_chain)[0];
}
double Linear::getValue(unsigned int i) const
{
return _view->stochasticChildren()[i]->value(_chain)[0];
}
string Linear::name() const
{
if (_gibbs)
return "LinearGibbs";
else
return "Linear";
}
void Linear::update(RNG *rng)
{
if (_gibbs)
updateLMGibbs(rng);
else
updateLM(rng);
}
}}

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

Sign up for the SourceForge newsletter:





No, thanks