Changeset 90b59de in tol
- Timestamp:
- Apr 1, 2009, 3:47:01 PM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 24bdea7
- Parents:
- d7e2da2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/gibbs/_nonLinBlock.tol
rd7e2da2 r90b59de 94 94 Set _.filterColIdx = If(!_.isInputFilter, Copy(Empty), 95 95 { 96 _.bsr::_. lin.blk::_.blockDef::getStoreColIndexes(_.linBlkNames)96 _.bsr::_.mln.blk::_.blockDef::getStoreColIndexes(_.linBlkNames) 97 97 }); 98 98 //Total number of affected parameters in linear block … … 127 127 "Method of generation of a non linear block by using current scalar method," 128 128 " given by scalarSampler for each parameter"; 129 VMatrix draw.scalar(Real numSim, 130 Real calcMaxLikelihood) 131 //////////////////////////////////////////////////////////////////////////// 132 { 133 //WriteLn("TRACE"+_MID+"draw.scalar 1 calcMaxLikelihood="<<calcMaxLikelihood); 129 VMatrix draw.scalar(Real numSim) 130 //////////////////////////////////////////////////////////////////////////// 131 { 132 //WriteLn("TRACE"+_MID+"draw.scalar 1 "); 134 133 VMatrix fullNoise = _.bsr::_.noise; 135 134 NameBlock arimaBlk = _.bsr::_.arm.blk; … … 138 137 //WriteLn("TRACE"+_MID+"draw.scalar 1.1 _.isInputFilter = "<<_.isInputFilter); 139 138 Matrix omega= If(!_.isInputFilter, Col(1), 140 SubRow(VMat2Mat(_.bsr::_.lin.blk::_.blockDef::_.store), 141 _.filterColIdx)); 139 SubRow(VMat2Mat(_.bsr::_.mln.blk::getStore(0)), _.filterColIdx)); 142 140 //WriteLn("TRACE"+_MID+"draw.scalar 1.2 omega("<<Rows(omega)+"x"<<Columns(omega)); 143 141 //WriteLn("TRACE"+_MID+"draw.scalar 1.3 _.Fi("<<Rows(_.Fi)+"x"<<Columns(_.Fi)); … … 190 188 Real ld = -0.5*MatDat(MtMSqr(ei),1,1); 191 189 //WriteLn("TRACE LogDens.WhiteNoise("+_.colNames[i]+","<<x+")="<<ld); 192 //Real UpdateMaxLogLikelihood(x,ld);193 190 ld+get.priorLogDens(i) 194 191 }; … … 201 198 Real ld = -0.5*MatDat(MtMSqr(ei),1,1); 202 199 //WriteLn("TRACE LogDens.ARMA("+_.colNames[i]+","<<x+")="<<ld); 203 //Real UpdateMaxLogLikelihood(x,ld);204 200 ld+get.priorLogDens(i) 205 201 }; … … 217 213 Real ld = -0.5*MatDat(MtMSqr(ei),1,1); 218 214 //WriteLn("TRACE LogDens.ARIMA("+_.colNames[i]+","<<x+")="<<ld); 219 //Real UpdateMaxLogLikelihood(x,ld);220 215 ld+get.priorLogDens(i) 221 216 }; … … 232 227 Real If(Or(x<x0,x>x1), x := Rand(x0,x1) ); 233 228 //WriteLn("TRACE"+_MID+"draw.scalar.one 2.["+IntText(i)+"].5"); 234 Real x:= If(!calcMaxLikelihood, 235 { 236 _scalarSampler(LogDens,x0,x1,x) 237 }, 238 { 239 Real MinusLogDens(Real x_) { -LogDens(x_) }; 240 Real y=0; 241 FibonacciMin(MinusLogDens, y, x0, x1, 1.E-5*n) 242 }); 229 Real x:= _scalarSampler(LogDens,x0,x1,x); 243 230 //WriteLn("TRACE draw.scalar x= "<<x); 244 231 //WriteLn("TRACE"+_MID+"draw.scalar.one 2.["+IntText(i)+"].6"); … … 274 261 }, 275 262 { 276 draw.scalar(numSim , False)263 draw.scalar(numSim) 277 264 }) 278 265 }, … … 281 268 Copy(_.blockDef::_.store) 282 269 }) 283 };284 285 ////////////////////////////////////////////////////////////////////////////286 Text _.autodoc.member.maxLikelihood =287 "Method of contitioned maximum likelihood";288 VMatrix maxLikelihood(Real numSim)289 ////////////////////////////////////////////////////////////////////////////290 {291 //WriteLn("TRACE"+_MID+"maxLikelihood 1");292 draw.scalar(numSim, True)293 270 }; 294 271
Note: See TracChangeset
for help on using the changeset viewer.
