Changeset 0c3fdd8 in tol for tol_tests


Ignore:
Timestamp:
Oct 7, 2009, 4:15:53 PM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
35ff1cf
Parents:
1046dc5
Message:

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@1498 be4846ae-f051-483a-831f-b64e7d08527f

Location:
tol_tests/tol/BSR/test_17
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tol_tests/tol/BSR/test_17/_test.tol

    r1046dc5 r0c3fdd8  
    2020Set Include("load.tol");
    2121
    22 
    2322BysMcmc::@Config bsr.config = [[
    2423  Real mcmc.sampleLength = 2000;
    2524  Real mcmc.cacheLength = 100;
    2625  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;
    3826  Real do.mcmc.profiler   = True
    3927]];
    … …  
    4432  bsr.config,
    4533  BysMcmc::@Notifier::Null(0));
     34
    4635
    4736//Real cycler::initialize(0);
  • tol_tests/tol/BSR/test_17/def.tol

    r1046dc5 r0c3fdd8  
    1616
    1717//Number of variables of each observational node
    18 Real n = IntRand(10,100);
     18Real n = IntRand(10,30);
    1919Real S = 7;
    2020//Data length of each observational node
    21 Real m  = IntRand(4*n,Min(20*n,7000));
     21Real m  = IntRand(Max(30,4*(n+1)),Min(20*(n+1),7000));
    2222//Number of observational nodes
    2323Real K1 = IntRand(1,1);
    … …  
    3333Real qS = enableARMA*0*IntRand(0,Max(0,1-pS));
    3434//Number of missing values in input matrix
    35 Real MissInp = Max(4,IntRand(0.01*n*K1,0.05*n*K1));
     35Real MissInp = If(!n, 0, Max(4,IntRand(0.01*n*K1,0.05*n*K1)));
    3636//Number of missing values in input matrix
    3737Real MissOut = Max(2,IntRand(0.002*m*K1,0.005*m*K1));
    … …  
    105105  Real   sse = MatStDs(e);
    106106  //Output data
    107   Matrix Y = X*b + z;
     107  Matrix Y = If(n, X*b + z, z);
    108108  //Original sum of squares
    109109  Real yy = MatDat(MtMSqr(Y),1,1);
    … …  
    278278{
    279279  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";
    281280  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  });
    283286  Text bsr = model.data.path+model.name+"_"+session.name+"_parse.bsr";
    284287  WriteLn("  bys.sparse.reg.path="+bsr);
    … …  
    298301  "Session.Name = \""+session.name+"\";\n"
    299302  "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    })
    319326  });
    320327  WriteLn("Writing Residuals Distributions "+Time);
    … …  
    348355  WriteLn("  Writing Regression equations for observational node"+Time);
    349356  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"));
    352361
    353362  Real If(MissInp, {
Note: See TracChangeset for help on using the changeset viewer.