Changeset 584d9b3 in tol
- Timestamp:
- Apr 2, 2009, 9:53:05 AM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 5937c50
- Parents:
- 6f124ed
- Location:
- tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/gibbs
- Files:
-
- 3 edited
-
_basicMaster.tol (modified) (3 diffs)
-
_mainLinearBlock.tol (modified) (2 diffs)
-
_outputMissingBlock.tol (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/gibbs/_basicMaster.tol
r6f124ed r584d9b3 232 232 //WriteLn("TRACE"+_MID+" draw.sig.lin 1.1"); 233 233 Real DoExternalFilter(0); 234 //WriteLn("TRACE"+_MID+" draw.sig.lin 1.2"); 234 235 VMatrix om = If(Not(_.outMis.blk::_.blockDef::_.numCol),Rand(0,1,0,0), 235 236 { … … 244 245 _.beta, _.YplusV-_.modelDef->X*_.beta) 245 246 }); 247 //WriteLn("TRACE"+_MID+" draw.sig.lin 1.4"); 246 248 VMatrix _.XplusU := _.inpMis.blk::filter(_.modelDef->X); 247 249 VMatrix _.filter := _.XplusU*_.beta; … … 259 261 VMatrix si = _.sig.blk::_.sigmaInv; 260 262 //WriteLn("TRACE"+_MID+" draw.sig.lin 7"); 261 /* 262 VMatrix Y01 = _.arm.blk::filter(si*_.YplusV); 263 //WriteLn("TRACE"+_MID+" draw.sig.lin 6"); 264 VMatrix X01 = _.arm.blk::filter(si*_.XplusU); 265 //WriteLn("TRACE"+_MID+" draw.sig.lin 8"); 266 VMatrix _.beta := If(Not(_.mln.blk::_.N),Rand(0,1,0,0), 267 _.mln.blk::draw(numSim, Y01, X01)); 268 */ 263 //WriteLn("TRACE"+_MID+" draw.sig.lin 9"); 269 264 VMatrix _.beta := If(Not(_.mln.blk::_.N),Rand(0,1,0,0), 270 265 _.mln.blk::draw(numSim, si*_.YplusV, si*_.XplusU, _.arm.blk)); 271 //WriteLn("TRACE"+_MID+" draw.sig.lin 9");266 //WriteLn("TRACE"+_MID+" draw.sig.lin 10"); 272 267 _.beta << sig << arm << im << om 273 268 }; -
tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/gibbs/_mainLinearBlock.tol
r6f124ed r584d9b3 78 78 //WriteLn("TRACE "+_MID+" draw.gibbs 1"); 79 79 Real _.MH.consecutive := 0; 80 //WriteLn("TRACE "+_MID+" draw.gibbs 2"); 80 81 VMatrix Y01 = arm.blk::filter(Y); 82 //WriteLn("TRACE "+_MID+" draw.gibbs 3"); 81 83 VMatrix X01 = arm.blk::filter(X); 84 //WriteLn("TRACE "+_MID+" draw.gibbs 4"); 82 85 Real _.lin.blk::solve(numSim, Y01, X01); 86 //WriteLn("TRACE "+_MID+" draw.gibbs 5"); 83 87 VMatrix b =_.lin.blk::draw(numSim); 88 //WriteLn("TRACE "+_MID+" draw.gibbs 6"); 84 89 VMatrix ep = Y01-X01*b; 90 //WriteLn("TRACE "+_MID+" draw.gibbs 7"); 85 91 Real _.betaLogDens := -0.5*VMatDat(MtMSqr(ep),1,1); 86 92 b … … 162 168 //////////////////////////////////////////////////////////////////////////// 163 169 { 170 //WriteLn("TRACE "+_MID+" draw 1"); 164 171 If(Not(_.blockDef::enabled), _.blockDef::_.store, 165 172 { 173 //WriteLn("TRACE "+_MID+" draw 2"); 166 174 Real _.calculatedSimulation := _.calculatedSimulation+1; 175 //WriteLn("TRACE "+_MID+" draw 3"); 167 176 If(And(_.calculatedSimulation >_.MH.useAfterIter, 168 177 _.MH.consecutive <= _.MH.maxConsecutive), -
tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/gibbs/_outputMissingBlock.tol
r6f124ed r584d9b3 204 204 { 205 205 Real _.MH.consecutive := 0; 206 //WriteLn("TRACE "+_MID+" draw.gibbs 1"); 206 207 Real _.lin.blk::solve(numSim, ls::Y01, ls::X01); 208 //WriteLn("TRACE "+_MID+" draw.gibbs 2"); 207 209 VMatrix _.blockDef::_.store := _.lin.blk::draw(numSim); 210 //WriteLn("TRACE "+_MID+" draw.gibbs 3"); 208 211 VMatrix e = ls::Y01-ls::X01*_.blockDef::_.store; 212 //WriteLn("TRACE "+_MID+" draw.gibbs 4"); 209 213 Real _.betaLogDens := MatSum(Log(f01(VMat2Mat(e)))); 214 //WriteLn("TRACE "+_MID+" draw.gibbs 5"); 210 215 _.blockDef::_.store 211 216 }; … … 290 295 //////////////////////////////////////////////////////////////////////////// 291 296 { 297 //WriteLn("TRACE "+_MID+" draw 1"); 292 298 If(Not(_.blockDef::enabled), _.blockDef::_.store, 293 299 { 300 //WriteLn("TRACE "+_MID+" draw 2"); 294 301 NameBlock ls = buildLinearSystem(arima,si,Z); 302 //WriteLn("TRACE "+_MID+" draw 3"); 295 303 Real _.calculatedSimulation := _.calculatedSimulation+1; 304 //WriteLn("TRACE "+_MID+" draw 4"); 296 305 If(And(_.calculatedSimulation >_.MH.useAfterIter, 297 306 _.MH.consecutive <= _.MH.maxConsecutive),
Note: See TracChangeset
for help on using the changeset viewer.
