- Timestamp:
- Apr 9, 2010, 8:20:35 AM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 4db909c
- Parents:
- 8a6d7f1
- File:
-
- 1 edited
-
tol_tests/tol/ARIMA/mcmc/mtrymh.tol (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol_tests/tol/ARIMA/mcmc/mtrymh.tol
r8a6d7f1 raa7db24 28 28 Set PeriodsTable = [[ 1,12 ]] 29 29 ]]; 30 Set Include(". /SimulArima/SimulArima.tol")30 Set Include("../SimulArima/SimulArima.tol") 31 31 }; 32 32 … … 634 634 Real numSim = 0; 635 635 636 Real append_draw(VMatrix draw) 637 { 638 If(!(numSim%10), WriteLn(" 639 ############################################################################## 640 Simulation "<<numSim+ " _.acceptRatio="<<mtm_arima::_.acceptRatio)); 641 Matrix mcmc := mcmc << VMat2Mat(Tra(draw)); 642 Real numSim := numSim+1 643 }; 644 636 645 /* */ 637 646 Real mtm_arima::_.sFactor := 1.01; 638 647 Real numSim := 0; 639 While(numSim<1000, 640 { 641 If(!(numSim%10), WriteLn(" 642 ############################################################################## 643 Simulation MH "<<numSim+ " _.acceptRatio="<<mtm_arima::_.acceptRatio)); 644 Matrix mcmc := mcmc << VMat2Mat(Tra(mtm_arima::draw_single_try(0))); 645 Real numSim := numSim+1 646 }); 648 Real mh.t0 = Copy(Time); 649 While(numSim<1000, append_draw(mtm_arima::draw_single_try(0))); 650 Real mh.time = (Copy(Time) - mh.t0)/numSim; 651 WriteLn("Time by MH simulation "<<mh.time); 652 647 653 /* */ 648 654 Real mtm_arima::_.sFactor := 1.0; 649 655 Real numSim := 0; 650 While(numSim<2500, 651 { 652 If(!(numSim%10), WriteLn(" 653 ############################################################################## 654 Simulation MTM "<<numSim+ " _.acceptRatio="<<mtm_arima::_.acceptRatio)); 655 Matrix mcmc := mcmc << VMat2Mat(Tra(mtm_arima::draw_multiple_try(0))); 656 Real numSim := numSim+1 657 }); 656 Real mtm.t0 = Copy(Time); 657 Real TolOprProfiler.Enabled := True; 658 While(numSim<2500, append_draw(mtm_arima::draw_multiple_try(0))); 659 Real TolOprProfiler.Dump("draw_multiple_try.csv"); 660 Real mtm.time = (Copy(Time) - mtm.t0)/numSim; 661 WriteLn("Time by MTM simulation "<<mtm.time); 662 /* */ 658 663 659 664 Matrix real_param = Group("ConcatColumns", For(1,Columns(PARAM),Matrix(Real j)
Note: See TracChangeset
for help on using the changeset viewer.
