- Timestamp:
- Oct 23, 2009, 7:47:53 AM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 2049a4a3
- Parents:
- c9971f2
- Location:
- tol_tests/tol/BSR
- Files:
-
- 8 edited
-
test_02/def.tol (modified) (12 diffs)
-
test_02/test.tol (modified) (3 diffs)
-
test_03/def.tol (modified) (12 diffs)
-
test_03/test.tol (modified) (1 diff)
-
test_10/test.tol (modified) (1 diff)
-
test_13/test.tol (modified) (1 diff)
-
test_15/test.tol (modified) (2 diffs)
-
test_16/test.tol (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol_tests/tol/BSR/test_02/def.tol
rc9971f2 re9c0ec3 27 27 28 28 //Number of variables of each observational node 29 Real n = IntRand( 10,10);29 Real n = IntRand(20,20); 30 30 //Data length of each observational node 31 Real m = IntRand( 300,300);31 Real m = IntRand(200,200); 32 32 //Number of observational nodes 33 33 Real K1 = IntRand(4,4); … … 125 125 }); 126 126 //Input matrix 127 Matrix aux = Rand(m,n,-1,1); 128 Matrix X = IfMat(LT(Abs(aux),Rand(m,n,0.5,0.5)),Rand(m,n,0,0),aux); 127 Matrix aux = Group("ConcatColumns",For(1,n,Matrix(Real j) 128 { 129 Real avr = Rand(-10, 10); 130 Real sig = Rand(0.1, 0.8); 131 Gaussian(m,1,avr,sig) 132 })); 133 Matrix X = IfMat(LT(Abs(Rand(m,n,-2,2)),Rand(m,n,0.5,0.5)), 134 Rand(m,n,0,0),aux); 129 135 //Real beta block 130 136 Matrix b = SetCol(For(1,n,Real(Real h) … … 301 307 //omitidos sin prior 302 308 Real rnd = IntRand(3,4); 309 Real nu = value*Rand(0.8,1.2); 303 310 Text prior = Case 304 311 ( … … 311 318 Real min = If(value>=0, 0, 10*value); 312 319 Real max = If(value<=0, 0, 10*value); 313 "? <- "<< (value*Rand(0.5,2))+"\n"+320 "? <- "<<nu+"\n"+ 314 321 " ~ Uniform("<<min+","<<max+")" 315 322 }, … … 317 324 { 318 325 Real sigma2 = ((value)/2)^2; 319 "? ~ Normal("<< (value*Rand(0.8,1.2))+","<<sigma2+")"326 "? ~ Normal("<<nu+","<<sigma2+")" 320 327 }, 321 328 rnd==4, … … 324 331 Real min = If(value>=0, 0, 10*value); 325 332 Real max = If(value<=0, 0, 10*value); 326 "? ~ TruncatedNormal("<< (value*Rand(0.8,1.2))+","<<sigma2+","<<min+","<<max+")"333 "? ~ TruncatedNormal("<<nu+","<<sigma2+","<<min+","<<max+")" 327 334 } 328 335 ); 329 Eval(id+"=[[ id, varIdx, equIdx, prior ]]")336 Eval(id+"=[[ id, varIdx, equIdx, prior, value, nu]]") 330 337 }); 331 338 Real If(MissInp, SetIndexByName(inputMissing)); … … 356 363 }); 357 364 Real rnd = IntRand(1,4); 365 Real nu = value*Rand(0.8,1.2); 358 366 Text prior = Case 359 367 ( 360 368 rnd==1, 361 369 { 362 "? <- "<<(value*Rand(0. 5,2))370 "? <- "<<(value*Rand(0.8,1.2)) 363 371 }, 364 372 rnd==2, … … 366 374 Real min = If(value>=0, 0, 10*value); 367 375 Real max = If(value<=0, 0, 10*value); 368 "? <- "<< (value*Rand(0.5,2))+"\n"+376 "? <- "<<nu+"\n"+ 369 377 " ~ Uniform("<<min+","<<max+")" 370 378 }, … … 372 380 { 373 381 Real sigma2 = ((value)/2)^2; 374 "? ~ Normal("<< (value*Rand(0.8,1.2))+","<<sigma2+")"382 "? ~ Normal("<<nu+","<<sigma2+")" 375 383 }, 376 384 rnd==4, … … 379 387 Real min = If(value>=0, 0, 10*value); 380 388 Real max = If(value<=0, 0, 10*value); 381 "? ~ TruncatedNormal("<< (value*Rand(0.8,1.2))+","<<sigma2+","<<min+","<<max+")"389 "? ~ TruncatedNormal("<<nu+","<<sigma2+","<<min+","<<max+")" 382 390 } 383 391 ); 384 392 Real varIdx=1; 385 Eval(id+"=[[ id, varIdx, equIdx, prior ]]")393 Eval(id+"=[[ id, varIdx, equIdx, prior, value, nu]]") 386 394 }); 387 395 Real If(MissOut, SetIndexByName(outputMissing)); … … 463 471 "\n" 464 472 "////////////////////////////////////////////////////////////////////////////////\n" 465 "// Regression N Oise Declarations Normal(0,sigma^2)\n"473 "// Regression Noise Declarations Normal(0,sigma^2)\n" 466 474 "////////////////////////////////////////////////////////////////////////////////\n" 467 475 "\n" … … 638 646 Matrix _inpMis= If(!MissInp,Rand(0,1,0,0), 639 647 { 640 Matrix SetMat(Set Extract( bsr.parsed->InputMissingBlock,6))648 Matrix SetMat(Set Extract(inputMissing,5)) 641 649 }); 642 650 Matrix _outMis= If(!MissOut,Rand(0,1,0,0), 643 SetMat(Set Extract( bsr.parsed->OutputMissingBlock,6)));651 SetMat(Set Extract(outputMissing,5))); 644 652 645 653 Real ok.Y = (VMatMax(Abs(bsr.parsed::Y-Y))+10)==10; -
tol_tests/tol/BSR/test_02/test.tol
rc9971f2 re9c0ec3 55 55 BysMcmc::@Notifier::Null(0)); 56 56 57 58 57 //Real cycler::initialize(0); 59 58 60 59 BysMcmc::@Estimation estim = BysMcmc::@Estimation::New(cycler); 61 62 60 Real estim::Run(0); 63 64 /* */65 61 Struct @CompareStruct 66 62 { … … 82 78 mod::_beta << 83 79 mod::_variance << 84 mod::_ inpMis <<85 mod::_ outMis;80 mod::_outMis << 81 mod::_inpMis ; 86 82 For(1,Card(estim::report::colNames), Set(Real k) 87 83 { … … 122 118 Matrix Residuals.Estim = est::noise; 123 119 Matrix Residuals.Cmp = Residuals | Residuals.Estim; 120 Matrix Filter = ((mod::obsNodes)[nu_node])::X* 121 ((mod::obsNodes)[nu_node])::b; 122 Matrix Filter.Estim = est::filter.full; 123 Matrix Filter.Cmp = Filter | Filter.Estim; 124 124 Matrix Output = ((mod::obsNodes)[nu_node])::Y; 125 125 Matrix Output.Estim = est::output.full; -
tol_tests/tol/BSR/test_03/def.tol
rc9971f2 re9c0ec3 29 29 30 30 //Number of variables of each observational node 31 Real n = IntRand(2 ,3);31 Real n = IntRand(20,30); 32 32 Real S = 7; 33 33 //Data length of each observational node 34 Real m = IntRand( 20,50);34 Real m = IntRand(300,600); 35 35 //Number of observational nodes 36 Real K1 = IntRand(2, 3);36 Real K1 = IntRand(2,4); 37 37 // 38 38 Real enableARMA = true; 39 39 //Regular AR Degree 40 Real p1 = enableARMA*IntRand(0, 2);40 Real p1 = enableARMA*IntRand(0,1); 41 41 //Seasonal AR Degree 42 42 Real pS = enableARMA*IntRand(1,1); 43 43 //Regular AR Degree 44 Real q1 = enableARMA*IntRand(0,Max(0, 2-p1));44 Real q1 = enableARMA*IntRand(0,Max(0,1-p1)); 45 45 //Seasonal AR Degree 46 46 Real qS = enableARMA*0*IntRand(0,Max(0,1-pS)); … … 128 128 }); 129 129 //Input matrix 130 Matrix aux = Rand(m,n,-1,1); 131 Matrix X = IfMat(LT(Abs(aux),Rand(m,n,0.5,0.5)),Rand(m,n,0,0),aux); 130 Matrix aux = Group("ConcatColumns",For(1,n,Matrix(Real j) 131 { 132 Real avr = Rand(-10, 10); 133 Real sig = Rand(0.1, 0.8); 134 Gaussian(m,1,avr,sig) 135 })); 136 Matrix X = IfMat(LT(Abs(Rand(m,n,-2,2)),Rand(m,n,0.5,0.5)), 137 Rand(m,n,0,0),aux); 132 138 //Real beta block 133 139 Matrix b = SetCol(For(1,n,Real(Real h) … … 137 143 //Standard deviation 138 144 Real s = Rand(0.50,0.90); 139 Polyn ar1 = RandStationary(p1);140 Polyn arS = RandStationary(pS,S);141 Polyn ma1 = RandStationary(q1);142 Polyn maS = RandStationary(qS,S);145 Polyn ar1 = If(p1,1-Rand(-0.95,0.95)*B,1); 146 Polyn arS = If(pS,1-Rand(-0.95,0.95)*B^S,1); 147 Polyn ma1 = If(q1,1-Rand(-0.95,0.95)*B,1); 148 Polyn maS = If(qS,1-Rand(-0.95,0.95)*B^S,1); 143 149 Polyn dif1 = (1-B)^If(Coef(ma1,1)<-0.9,1,0); 144 150 Polyn difS = (1-B^S)^If(Coef(maS,1)<-0.9,1,0); … … 345 351 //omitidos sin prior 346 352 Real rnd = IntRand(3,4); 353 Real nu = value*Rand(0.8,1.2); 347 354 Text prior = Case 348 355 ( … … 355 362 Real min = If(value>=0, 0, 10*value); 356 363 Real max = If(value<=0, 0, 10*value); 357 "? <- "<< (value*Rand(0.5,2))+"\n"+364 "? <- "<<nu+"\n"+ 358 365 " ~ Uniform("<<min+","<<max+")" 359 366 }, … … 361 368 { 362 369 Real sigma2 = ((value)/2)^2; 363 "? ~ Normal("<< (value*Rand(0.8,1.2))+","<<sigma2+")"370 "? ~ Normal("<<nu+","<<sigma2+")" 364 371 }, 365 372 rnd==4, … … 368 375 Real min = If(value>=0, 0, 10*value); 369 376 Real max = If(value<=0, 0, 10*value); 370 "? ~ TruncatedNormal("<< (value*Rand(0.8,1.2))+","<<sigma2+","<<min+","<<max+")"377 "? ~ TruncatedNormal("<<nu+","<<sigma2+","<<min+","<<max+")" 371 378 } 372 379 ); 373 Eval(id+"=[[ id, varIdx, equIdx, prior ]]")380 Eval(id+"=[[ id, varIdx, equIdx, prior, value, nu]]") 374 381 }); 375 382 Real If(MissInp, SetIndexByName(inputMissing)); … … 400 407 }); 401 408 Real rnd = IntRand(1,4); 409 Real nu = value*Rand(0.8,1.2); 402 410 Text prior = Case 403 411 ( 404 412 rnd==1, 405 413 { 406 "? <- "<<(value*Rand(0. 5,2))414 "? <- "<<(value*Rand(0.8,1.2)) 407 415 }, 408 416 rnd==2, … … 410 418 Real min = If(value>=0, 0, 10*value); 411 419 Real max = If(value<=0, 0, 10*value); 412 "? <- "<< (value*Rand(0.5,2))+"\n"+420 "? <- "<<nu+"\n"+ 413 421 " ~ Uniform("<<min+","<<max+")" 414 422 }, … … 416 424 { 417 425 Real sigma2 = ((value)/2)^2; 418 "? ~ Normal("<< (value*Rand(0.8,1.2))+","<<sigma2+")"426 "? ~ Normal("<<nu+","<<sigma2+")" 419 427 }, 420 428 rnd==4, … … 423 431 Real min = If(value>=0, 0, 10*value); 424 432 Real max = If(value<=0, 0, 10*value); 425 "? ~ TruncatedNormal("<< (value*Rand(0.8,1.2))+","<<sigma2+","<<min+","<<max+")"433 "? ~ TruncatedNormal("<<nu+","<<sigma2+","<<min+","<<max+")" 426 434 } 427 435 ); 428 436 Real varIdx=1; 429 Eval(id+"=[[ id, varIdx, equIdx, prior ]]")437 Eval(id+"=[[ id, varIdx, equIdx, prior, value, nu]]") 430 438 }); 431 439 Real If(MissOut, SetIndexByName(outputMissing)); … … 686 694 Matrix _inpMis= If(!MissInp,Rand(0,1,0,0), 687 695 { 688 Matrix SetMat(Set Extract( bsr.parsed->InputMissingBlock,6))696 Matrix SetMat(Set Extract(inputMissing,5)) 689 697 }); 690 698 Matrix _outMis= If(!MissOut,Rand(0,1,0,0), 691 SetMat(Set Extract( bsr.parsed->OutputMissingBlock,6)));699 SetMat(Set Extract(outputMissing,5))); 692 700 693 701 Real ok.Y = (VMatMax(Abs(bsr.parsed::Y-Y))+10)==10; -
tol_tests/tol/BSR/test_03/test.tol
rc9971f2 re9c0ec3 81 81 mod::_beta << 82 82 mod::_variance << 83 mod::_arma <<84 mod::_ inpMis <<85 mod::_ outMis;83 mod::_arma << 84 mod::_outMis << 85 mod::_inpMis; 86 86 For(1,Card(estim::report::colNames), Set(Real k) 87 87 { -
tol_tests/tol/BSR/test_10/test.tol
rc9971f2 re9c0ec3 20 20 21 21 //Random seed setting 22 Real PutRandomSeed( 1610450658);22 Real PutRandomSeed(0); 23 23 Real rndSeed = GetRandomSeed(0); 24 24 WriteLn("Current Random Seed = "<<rndSeed); -
tol_tests/tol/BSR/test_13/test.tol
rc9971f2 re9c0ec3 144 144 m->Row+new.obs.length-old.obs.length, 145 145 m->Col, 146 m->Prior,146 "None", 147 147 m->Nu, 148 m->Sigma2,149 m->MinBound,150 m->MaxBound)148 +1/0, 149 -1/0, 150 +1/0) 151 151 }) 152 152 }; -
tol_tests/tol/BSR/test_15/test.tol
rc9971f2 re9c0ec3 11 11 12 12 Real numErr0 = Copy(NError); 13 14 //Random seed setting 15 Real PutRandomSeed(0); 16 Real rndSeed = GetRandomSeed(0); 17 WriteLn("Current Random Seed = "<<rndSeed); 13 18 14 19 BysMcmc::@Config bsr.config = … … 68 73 Set MissingBlk = Select(recover::_.colNames, Real(Text param) 69 74 { 70 If(!TextBeginWith(param,"MissingBlk::"),0,Rand(0,1)<.9 8)75 If(!TextBeginWith(param,"MissingBlk::"),0,Rand(0,1)<.90) 71 76 }); 72 77 -
tol_tests/tol/BSR/test_16/test.tol
rc9971f2 re9c0ec3 40 40 { 41 41 If(!TextBeginWith(param,"Node")| 42 TextEndAt(param,"_Sigma2"),0,Rand(0,1)<0.9 8)42 TextEndAt(param,"_Sigma2"),0,Rand(0,1)<0.95) 43 43 }); 44 44 45 45 Set MissingBlk = Select(recover::_.colNames, Real(Text param) 46 46 { 47 If(!TextBeginWith(param,"MissInp."),0,Rand(0,1)<0. 98)47 If(!TextBeginWith(param,"MissInp."),0,Rand(0,1)<0.50) 48 48 }); 49 49 50 50 Set SigmaBlk = Select(recover::_.colNames, Real(Text param) 51 51 { 52 If(!TextEndAt(param,"_Sigma2"),0,Rand(0,1)<0.9 8)52 If(!TextEndAt(param,"_Sigma2"),0,Rand(0,1)<0.95) 53 53 }); 54 54 55 55 Set ArimaBlk = Select(recover::_.colNames, Real(Text param) 56 56 { 57 If(!TextBeginWith(param,"ArmaBlk"),0,Rand(0,1)< .98)57 If(!TextBeginWith(param,"ArmaBlk"),0,Rand(0,1)<0.50) 58 58 }); 59 59
Note: See TracChangeset
for help on using the changeset viewer.
