Changeset e06a79e in tol
- Timestamp:
- Apr 9, 2010, 10:21:08 AM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 3e558bb
- Parents:
- b9fb9df
- File:
-
- 1 edited
-
tol_tests/tol/ARIMA/mcmc/mtrymh.tol (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol_tests/tol/ARIMA/mcmc/mtrymh.tol
rb9fb9df re06a79e 126 126 127 127 //////////////////////////////////////////////////////////////////////////// 128 VMatrix accept_reject(VMatrix y, Real pi_logDens_y)128 Real accept_reject(VMatrix y) 129 129 //////////////////////////////////////////////////////////////////////////// 130 130 { … … 133 133 Real If(_.accept, 134 134 { 135 Real _.num_accept := _.num_accept +1;136 135 VMatrix _.x := Copy(y); 137 Real _.pi_logDens_x := pi_logDens_y 136 Real doAfterDraw(0); 137 Real _.num_accept := _.num_accept +1 138 138 }); 139 139 Real _.acceptRatio := _.num_accept / _.num_draw; … … 147 147 Real _.s := _.s*_.sFactor 148 148 }); 149 150 Real doAfterDraw(0); 151 _.x 149 _.accept 152 150 }; 153 151 … … 160 158 VMatrix y = Q_draw(_.x); 161 159 Real pi_logDens_y = pi_logDens(y); 162 Real cumulate(y,pi_logDens_y,False);163 164 160 Real _.r := Min(1, If(_.simetricQ, 165 161 { … … 170 166 (_.pi_logDens_x + Q_logDens(_.x, y)) ) 171 167 })); 172 accept_reject(y,pi_logDens_y) 168 Real If(accept_reject(y), _.pi_logDens_x := pi_logDens_y); 169 _.x 173 170 }; 174 171 … … 251 248 Real _.r := Min(1,Exp(lwYjx_max-lwXjy_max)*(gYjx_sum/gXjy_sum)); 252 249 //WriteLn("TRACE draw _.r=\n"<<_.r); 253 Real pi_logDens_y = pi_logDens(y);254 accept_reject(y,pi_logDens_y)250 Real accept_reject(y); 251 y 255 252 })} 256 253 }; … … 701 698 Real TolOprProfiler.Enabled := True; 702 699 While(numSim<2500, append_draw(mtm_arima::draw_multiple_try(0))); 703 Real TolOprProfiler.Dump("draw_multiple_try.0 2.csv");700 Real TolOprProfiler.Dump("draw_multiple_try.03.csv"); 704 701 Real mtm.time = (Copy(Time) - mtm.t0)/numSim; 705 702 WriteLn("Time by MTM simulation "<<mtm.time);
Note: See TracChangeset
for help on using the changeset viewer.
