Changeset 3666c07 in tol
- Timestamp:
- May 15, 2009, 7:46:34 AM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- ce02ff8
- Parents:
- 7ee3411
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tol/stdlib/math/stat/models/bayesian/bysMcmc/_masterSampler.tol
r7ee3411 r3666c07 37 37 }; 38 38 BinGroup("<<",EvalSet(_.blocks, grp)) 39 }; 40 41 //////////////////////////////////////////////////////////////////////////// 42 Text _.autodoc.member.define = 43 "Creates common information handler about each MCMC block" 44 "Arguments are:\n" 45 " Text name: Identifies the block.\n" 46 " Set colNames: Identifiers of block parameters that must be all unique.\n" 47 " McmcPartialHandler mcmcPartialHandler: partial simulation info.\n" 48 " Real numBlock: The position of this block in full MCMC.\n" 49 " Real firstCol: First column of this block in full MCMC\n" 50 " NameBlock config: User configuration parameters\n"; 51 Real define(Text name, 52 Set colNames, 53 BysMcmc::McmcPartialHandler mcmcPartialHandler, 54 Real numBlock, 55 Real firstCol, 56 BysMcmc::Config config) 57 //////////////////////////////////////////////////////////////////////////// 58 { 59 Text _.name := name; 60 Text _MID := "[MasterSampler "+name+"] "; 61 Real _.N := Card(colNames); 62 Real If(_.N, { 63 Real GT0 (Real idx) { idx>0 }; 64 Set _.colNames := SetTolNameAndIndex(colNames); 65 Real SetIndexByName(_.colNames); 66 1 67 }); 68 Real _.numBlock := numBlock; 69 Real _.firstCol := firstCol; 70 Real _.lastCol := firstCol+_.N-1; 71 Set _.colIdx := Range(_.firstCol, _.lastCol, 1); 72 BysMcmc::Config _.config := config; 73 VMatrix If(Or(!_.N, VRows(_.store)!=_.N), _.store := Rand(_.N,1,0,0), _.store); 74 WriteLn(_MID+" created with "<< 75 _.N+" parameters from "<<_.firstCol+" to "<<_.lastCol+""); 76 1 39 77 }; 40 78 … … 55 93 Real _.reloadParamNum := _.reloadParamNum + 56 94 Card(blk::_.partialSampler::_.reloadParam); 57 Real _.N := _.N + blk::_.N;58 95 blk::initialize(0) 59 96 }; … … 107 144 { 108 145 draw.blocks(numSim) 146 }; 147 148 //////////////////////////////////////////////////////////////////////////// 149 VMatrix get.draw(Real numSim, Real force) 150 //////////////////////////////////////////////////////////////////////////// 151 { 152 draw(numSim) 109 153 }; 110 154
Note: See TracChangeset
for help on using the changeset viewer.
