Revision 1108 trunk/src/nh99/prmonte.cpp

prmonte.cpp (revision 1108)
2 2
 * $Id$
3 3
 *
4 4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California 
5
 * Copyright (c) 2008-2012 Regents of the University of California
6 6
 */
7 7
#include <admodel.h>
8 8

  
......
28 28
  double rwght=0;
29 29
  double nwght=0;
30 30
  w.initialize();
31
  double ah; 
32
  double bl; 
31
  double ah;
32
  double bl;
33 33
  double upper;
34
  double lower; 
34
  double lower;
35 35
  double upper1;
36
  double lower1; 
36
  double lower1;
37 37
  double diff;
38 38
  double diff1;
39 39
  int expflag;
......
54 54
  {
55 55
    for (int i=1;i<=nvar;i++)
56 56
    {
57
      ah=a(i)/ch(i,i); 
58
      bl=b(i)/ch(i,i); 
57
      ah=a(i)/ch(i,i);
58
      bl=b(i)/ch(i,i);
59 59
      double u = rng.better_rand();
60 60
      upper=cumd_norm(bl);
61
      lower=cumd_norm(ah); 
61
      lower=cumd_norm(ah);
62 62
      diff=upper-lower;
63 63
      if (diff>1.e-5)
64 64
      {
......
71 71
      upper1=cumd_cauchy(bl);
72 72
      lower1=cumd_cauchy(ah);
73 73
      diff1=upper1-lower1;
74
  
74

  
75 75
      u=u*.9998+.0001;
76 76
      if (!expflag)
77 77
      {
......
105 105
    b=b1;
106 106
    for (int i=1;i<=nvar;i++)
107 107
    {
108
      ah=a(i)/ch(i,i); 
109
      bl=b(i)/ch(i,i); 
108
      ah=a(i)/ch(i,i);
109
      bl=b(i)/ch(i,i);
110 110
      double u = rng.better_rand();
111 111
      double pp = rng.better_rand();
112 112
      upper=cumd_norm(bl);
113
      lower=cumd_norm(ah); 
113
      lower=cumd_norm(ah);
114 114
      diff=upper-lower;
115 115
      if (diff>1.e-5)
116 116
      {
......
123 123
      upper1=cumd_cauchy(bl);
124 124
      lower1=cumd_cauchy(ah);
125 125
      diff1=upper1-lower1;
126
  
126

  
127 127
      u=u*.9998+.0001;
128 128
      if (!expflag)
129 129
      {
......
160 160
    }
161 161
    wght = log(dd)+rwght;
162 162
  }
163
  return w; 
163
  return w;
164 164
}
165 165

  
166

  
167 166
void new_probing_bounded_multivariate_normal_mcmc(int nvar, const dvector& a1, const dvector& b1,
168 167
  dmatrix& ch, const double& _wght, const dvector& _y,double pprobe, random_number_generator& rng)
169 168
{
......
179 178
  double rwght=0;
180 179
  double nwght=0;
181 180
  w.initialize();
182
  double ah; 
183
  double bl; 
181
  double ah;
182
  double bl;
184 183
  double upper;
185
  double lower; 
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff