Prior.cc 1.99 KB
Newer Older
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
/*
 * Copyright (C) 2009-2010 Dynare Team
 *
 * This file is part of Dynare.
 *
 * Dynare is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Dynare is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 */

///////////////////////////////////////////////////////////
//  Prior.cpp
//  Implementation of the Class Prior
//  Created on:      02-Feb-2010 13:06:20
///////////////////////////////////////////////////////////

#include "Prior.hh"

28
29
Prior::Prior(double mean_arg, double standard_arg, double lower_bound_arg,      double upper_bound_arg, double fhp_arg, double shp_arg) :
  mean(mean_arg), standard(standard_arg), lower_bound(lower_bound_arg),       upper_bound(upper_bound_arg),   fhp(fhp_arg), shp(shp_arg)
30
31
32
33
34
35
36
37
38
{

}

Prior::~Prior()
{

}

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Prior *
Prior::constructPrior(pShape shape, double mean, double standard, double lower_bound, double upper_bound, double fhp, double shp)
{
  switch (shape)
    {
    case Beta:
      return new BetaPrior(mean, standard, lower_bound, upper_bound, fhp, shp);
    case Gamma:
      return new GammaPrior(mean, standard, lower_bound, upper_bound, fhp, shp);
    case Gaussian:
      return new GaussianPrior(mean, standard, lower_bound, upper_bound, fhp, shp);
    case Inv_gamma_1:
      return new InvGamma1_Prior(mean, standard, lower_bound, upper_bound, fhp, shp);
    case Uniform:
      return new UniformPrior(mean, standard, lower_bound, upper_bound, fhp, shp);
    case Inv_gamma_2:
      return new InvGamma2_Prior(mean, standard, lower_bound, upper_bound, fhp, shp);
    }
}