Changeset f16fdcd in tol
- Timestamp:
- Sep 3, 2009, 10:41:59 PM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 40b58f9
- Parents:
- a171731
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tol/stdlib/math/stat/models/bayesian/bysMcmc/_cycler.tol
ra171731 rf16fdcd 83 83 Real kerDens.points = _.config::report.kerDens.points 84 84 )}; 85 186 };87 88 ////////////////////////////////////////////////////////////////////////////89 Text _.autodoc.member.initialize =90 "Initializes the Markov Chain";91 Real initialize(Real unused)92 ////////////////////////////////////////////////////////////////////////////93 {94 Real _.notifier::initializing(_.n, _.path);95 Real _.sampler::initialize(0);96 85 1 97 86 }; … … 156 145 }); 157 146 Matrix lastRow = Sub(resumed,m_,1,1,_.n); 158 //WriteLn("TRACE "+_MID+"lastRow="<<lastRow);147 WriteLn(_MID+"Setting last resumed row as initial point"); 159 148 Real _.sampler::setStore(lastRow); 160 149 m_ … … 187 176 { 188 177 Text _MID = "[Cycler::generate] "; 189 Real WriteLn(_MID+_.name+190 "\n Storing MCMC in file ....... : "<<_.path+191 "\n Number of fixed variables .. : "<<_.sampler::_.fixedParamNum+192 "\n Number of reloaded variables : "<<_.sampler::_.reloadParamNum+193 "\n Number of sampled variables : "<<_.sampler::_.freeParamNum+194 "\n Number of total variables .. : "<<_.n+195 "\n Number of simulations ...... : "<<sampleLength+196 "\n Cache length ............... : "<<cacheLength_+197 "\n Resume ..................... : "<<resume_+198 If(_mcmc.maxTime<1/0,199 "\n MaxTime : "<<_mcmc.maxTime+" seconds",""));200 178 //Ensures path is all right 201 179 Real OSDirMake(GetFilePath(_.path)); … … 219 197 Real end = GE(numSim,sampleLength); 220 198 //WriteLn("TRACE "+_MID+"end="<<end); 199 Real runSim = 0; 200 Real _.notifier::initializing(_.n, _.path); 201 Real If(!savedSimulations, 202 { 203 _.sampler::initialize(0) 204 }, 205 { 206 _.sampler::resume(0) 207 }); 208 Real WriteLn(_MID+_.name+ 209 "\n Storing MCMC in file ....... : "<<_.path+ 210 "\n Number of fixed variables .. : "<<_.sampler::_.fixedParamNum+ 211 "\n Number of reloaded variables : "<<_.sampler::_.reloadParamNum+ 212 "\n Number of sampled variables : "<<_.sampler::_.freeParamNum+ 213 "\n Number of total variables .. : "<<_.n+ 214 "\n Number of simulations ...... : "<<sampleLength+ 215 "\n Cache length ............... : "<<cacheLength_+ 216 "\n Resume ..................... : "<<resume_+ 217 If(_mcmc.maxTime<1/0, 218 "\n MaxTime ................... : "<<_mcmc.maxTime+" seconds","")); 219 If(numErr0<NError, 220 { 221 CMsg::Coded::show(BysMcmc::_.cmsg::_.cannotContinueSimulation, 222 [[_MID, Real (NError-numErr0) ]]) 223 }); 224 Real If(_.config::do.mcmc.profiler, 225 TolOprProfiler.Enabled := True); 221 226 While(!end, 222 227 { 228 Real runSim := runSim+1; 223 229 Real numSim := numSim+1; 224 230 //WriteLn("TRACE "+_MID+"2 numSim="<<numSim); … … 281 287 //WriteLn("TRACE "+_MID+"10"); 282 288 Real CMsg::Coded::show(BysMcmc::_.cmsg::_.cannotContinueSimulation, 283 [[ 284 _MID, 285 Real (NError-numErr0) 286 ]]); 289 [[_MID,Real (NError-numErr0)]]); 287 290 Real end := True 288 291 }); … … 290 293 //WriteLn("TRACE "+_MID+"8"); 291 294 }); 295 Real If(config::do.mcmc.profiler, 296 TolOprProfiler.Dump(cycler::_.path+cycler::_.name)); 292 297 //WriteLn("TRACE "+_MID+"11"); 293 298 Matrix Do MatAppendFile(_.path, cache); 294 299 //WriteLn("TRACE "+_MID+"12"); 295 300 Real savedSimulations := numSim; 296 Real _.time := (Time - t0)/ numSim;301 Real _.time := (Time - t0)/runSim; 297 302 WriteLn(" [time by simulation:"<<_.time+"]"); 298 303 Real _.notifier::simulating(numSim, _.time);
Note: See TracChangeset
for help on using the changeset viewer.
