- Timestamp:
- Oct 7, 2009, 4:15:53 PM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 35ff1cf
- Parents:
- 1046dc5
- Location:
- tol_tests/tol/BSR/test_17
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tol_tests/tol/BSR/test_17/_test.tol
r1046dc5 r0c3fdd8 20 20 Set Include("load.tol"); 21 21 22 23 22 BysMcmc::@Config bsr.config = [[ 24 23 Real mcmc.sampleLength = 2000; 25 24 Real mcmc.cacheLength = 100; 26 25 Real mcmc.burnin = 100; 27 28 Real bsr.linBlk.MH.useAfterIter = 10;29 Real bsr.linBlk.MH.maxRejected = 3;30 Real bsr.linBlk.MH.maxConsecutive = 100;31 32 Text bsr.arimaFilter = BysMcmc::Options::Arima.Filter::DifEq;33 //Code bsr.scalarSampler.armaBlock = BysMcmc::Options::Scalar.Sampler::Arms;34 //Code bsr.scalarSampler.nonLinBlock = BysMcmc::Options::Scalar.Sampler::Arms;35 36 37 Real do.resume = 0;38 26 Real do.mcmc.profiler = True 39 27 ]]; … … 44 32 bsr.config, 45 33 BysMcmc::@Notifier::Null(0)); 34 46 35 47 36 //Real cycler::initialize(0); -
tol_tests/tol/BSR/test_17/def.tol
r1046dc5 r0c3fdd8 16 16 17 17 //Number of variables of each observational node 18 Real n = IntRand(10, 100);18 Real n = IntRand(10,30); 19 19 Real S = 7; 20 20 //Data length of each observational node 21 Real m = IntRand( 4*n,Min(20*n,7000));21 Real m = IntRand(Max(30,4*(n+1)),Min(20*(n+1),7000)); 22 22 //Number of observational nodes 23 23 Real K1 = IntRand(1,1); … … 33 33 Real qS = enableARMA*0*IntRand(0,Max(0,1-pS)); 34 34 //Number of missing values in input matrix 35 Real MissInp = Max(4,IntRand(0.01*n*K1,0.05*n*K1));35 Real MissInp = If(!n, 0, Max(4,IntRand(0.01*n*K1,0.05*n*K1))); 36 36 //Number of missing values in input matrix 37 37 Real MissOut = Max(2,IntRand(0.002*m*K1,0.005*m*K1)); … … 105 105 Real sse = MatStDs(e); 106 106 //Output data 107 Matrix Y = X*b + z;107 Matrix Y = If(n, X*b + z, z); 108 108 //Original sum of squares 109 109 Real yy = MatDat(MtMSqr(Y),1,1); … … 278 278 { 279 279 Text bsr.Y = model.data.path+model.name+"_"+session.name+"_Y.bbm"; 280 Text bsr.X = model.data.path+model.name+"_"+session.name+"_X.bbm";281 280 Matrix MatWriteFile(bsr.Y, VMat2Mat(Y)); 282 Matrix MatWriteFile(bsr.X, VMat2Mat(X)); 281 Text bsr.X = If(!n, "", { 282 Text aux = model.data.path+model.name+"_"+session.name+"_X.bbm"; 283 Matrix MatWriteFile(aux, VMat2Mat(X)); 284 aux 285 }); 283 286 Text bsr = model.data.path+model.name+"_"+session.name+"_parse.bsr"; 284 287 WriteLn(" bys.sparse.reg.path="+bsr); … … 298 301 "Session.Name = \""+session.name+"\";\n" 299 302 "Session.Description = \n\""+Replace(session.description,"\n","\\n\"\n\"")+"\";\n" 300 "Session.Authors = \""+session.authors+"\";\n" 301 "\n" 302 "////////////////////////////////////////////////////////////////////////////////\n" 303 "// Regression Variables Declarations with initial values\n" 304 "////////////////////////////////////////////////////////////////////////////////\n" 305 "\n" 306 ); 307 WriteLn("Writing Linear Block "+Time); 308 Real j = 0; 309 Real declareVariable(Text name) 310 { 311 j := j+1; 312 FPutText(f,""+name+" <- "+ 313 FormatReal(MatDat(beta0,j,1),"%+.018lg")+";\n") 314 }; 315 Set For(1,K1,Real(Real k) 316 { 317 Set EvalSet((obsNodes[k])::varNames, declareVariable); 318 1 303 "Session.Authors = \""+session.authors+"\";\n"); 304 305 If(n, { 306 WriteLn("Writing Linear Block "+Time); 307 Real FPutText(f, 308 "\n"+If(!n, "", 309 "////////////////////////////////////////////////////////////////////////////////\n" 310 "// Regression Variables Declarations with initial values\n" 311 "////////////////////////////////////////////////////////////////////////////////\n" 312 "\n") 313 ); 314 Real j = 0; 315 Real declareVariable(Text name) 316 { 317 j := j+1; 318 FPutText(f,""+name+" <- "+ 319 FormatReal(MatDat(beta0,j,1),"%+.018lg")+";\n") 320 }; 321 Set For(1,K1,Real(Real k) 322 { 323 Set EvalSet((obsNodes[k])::varNames, declareVariable); 324 1 325 }) 319 326 }); 320 327 WriteLn("Writing Residuals Distributions "+Time); … … 348 355 WriteLn(" Writing Regression equations for observational node"+Time); 349 356 Real FPutText(f, 350 "Output = {$ Matrix MatReadFile(\""+bsr.Y+"\") $};\n" 351 "Input = {$ Matrix MatReadFile(\""+bsr.X+"\") $};\n"); 357 "Output = {$ Matrix MatReadFile(\""+bsr.Y+"\") $};\n"); 358 359 Real If(n, FPutText(f, 360 "Input = {$ Matrix MatReadFile(\""+bsr.X+"\") $};\n")); 352 361 353 362 Real If(MissInp, {
Note: See TracChangeset
for help on using the changeset viewer.
