Changeset 178
- Timestamp:
- 05/12/08 21:29:10 (8 months ago)
- Files:
-
- projects/AsynCluster/trunk/svpmc/model.c (modified) (2 diffs)
- projects/AsynCluster/trunk/svpmc/model.py (modified) (2 diffs)
- projects/AsynCluster/trunk/svpmc/pmc.py (modified) (2 diffs)
- projects/AsynCluster/trunk/svpmc/test/test_model.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
projects/AsynCluster/trunk/svpmc/model.c
r177 r178 97 97 double ncdf(double x) 98 98 { 99 double ax, t, sum;99 double ax, t, tp, sum; 100 100 // The cdf is computed from the absolute value of x and corrected at the end 101 101 // if necessary … … 104 104 t = 1.0 / (1.0 + 0.2316419*ax); 105 105 // Efficiently compute the series summation 106 sum = t * +0.31938; // t 107 sum += (t *= t) * -0.35656; // t^2 108 sum += (t *= t) * +1.78148; // t^3 109 sum += (t *= t) * -1.82125; // t^4 110 sum += (t *= t) * +1.33027; // t^5 106 tp = t; 107 sum = tp * 0.31938; // t 108 tp *= t; 109 sum -= tp * 0.35656; // t^2 110 tp *= t; 111 sum += tp * 1.78148; // t^3 112 tp *= t; 113 sum -= tp * 1.82125; // t^4 114 tp *= t; 115 sum += tp * 1.33027; // t^5 111 116 // Compute the cdf, assuming x to be positive 112 sum *= (1.0 - npdf(ax));117 sum *= npdf(ax); 113 118 // Correct if x < 0 114 if(x <0)119 if(x > 0) 115 120 sum = 1 - sum; 116 121 // All done projects/AsynCluster/trunk/svpmc/model.py
r177 r178 179 179 @ivar Mv: Number of volatility draws per likelihood evaluation. 180 180 181 @ivar Mz: Number of random-walk normal draws per volatility draw.182 183 181 """ 184 182 _logU_index = -1 185 183 186 keyAttrs = {'y':None, 'Mv': 40, 'Mz':30}184 keyAttrs = {'y':None, 'Mv':1} 187 185 188 186 #--- Properties ----------------------------------------------------------- … … 267 265 """ 268 266 z = z.copy() 269 L = self.inline('z', ' M', 'wiggle', M=self.Mz)267 L = self.inline('z', 'wiggle') 270 268 return z, L 271 269 projects/AsynCluster/trunk/svpmc/pmc.py
r176 r178 141 141 """ 142 142 chunkSize = 500 143 initialSigma = 0. 5143 initialSigma = 0.3 144 144 145 145 def __init__(self, projectManager, socket=None): … … 200 200 if s.isfinite(paramContainer.Lx): 201 201 L = paramContainer.Lx + paramContainer.Lp \ 202 - paramContainer.Lj #- paramContainer.Lh202 - paramContainer.Lj - paramContainer.Lh 203 203 info = " ".join([ 204 204 "%+12.2f" % (getattr(paramContainer, x),) projects/AsynCluster/trunk/svpmc/test/test_model.py
r177 r178 332 332 333 333 def test_zProposal_dist(self): 334 N = 1000 334 N = 10000 335 335 z = s.zeros((2,3)) 336 336 modelObj = self.modelFactory()
