Changeset 6b0bd23 in tol


Ignore:
Timestamp:
Feb 20, 2009, 10:07:37 AM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
0020bfc1
Parents:
e875979
Message:

New method BuildModelDef to allow debugging and advanced modifications of model

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/_oneNode.tol

    re875979 r6b0bd23  
    3737  };
    3838
    39   Text _.autodoc.member.Estim =
    40   "Estimates a model with just one node, usually observational and dense."
     39  Text _.autodoc.member.BuildModelDef =
     40  "Creates a BSR model definition with structure of BSR.ModelDef\n"
     41  "Model must have just one node, usually observational and dense."
    4142  "Model is defined as a BSR basic and an optional set of non linear filters."
    4243  "BSR will be built from simplified data argument matching this API"
    … …  
    5455  "  Set _.arima;           //Set of ARIMAStruct\n"
    5556  "  Real _.sigmaPriorWeight;  //Weight for Bsr.Sigma.Prior.InverseGamma\n"
    56   "  Set _.timeInfo;        //Set of BSR.NoiseTimeInfo\n"
     57  "  Set _.timeInfo;        //BSR.NoiseTimeInfo\n"
    5758  "]];\n";
    58   Set Estim(NameBlock data_, Set nonLinFil, NameBlock config_)
     59  Set BuildModelDef(NameBlock data, NameBlock config_)
    5960  ///////////////////////////////////////////////////////////////////////////
    6061  {
    6162    Text _MID = "[EstimOneNode]";
    62     //Data source for model defining
    63     NameBlock data = data_;
    6463  //WriteLn(_MID+" TRACE 1");
    6564    //Output matrix
    … …  
    7473    //Observational data length
    7574    Real m = VRows(Y);
    76     //Number of variables at linear block
     75    //Number of variables at linear block 
    7776    Real n = VColumns(X);
    7877
    … …  
    237236  //WriteLn(_MID+" TRACE 9");
    238237    //Building generic model definition
    239     Set modelDef = BSR.ModelDef (
     238    BSR.ModelDef (
    240239      docInfo = data::_.docInfo,
    241240      linearBlock,
    … …  
    249248      VMatrix a = domain.a << order.a,
    250249      VMatrix A = domain.A << order.A
    251     );
     250    )
     251  };
     252
     253  Text _.autodoc.member.Estim =
     254  "Estimates a model with just one node, usually observational and dense."
     255  "Model is defined as a BSR basic and an optional set of non linear filters."
     256  "BSR will be built from simplified data argument matching this API"
     257  "NameBlock data = \n"
     258  "[[\n"
     259  "//Mandatory members \n"
     260  "  Set  _.docInfo         //BSR.DocInfo \n"
     261  "  Text _.segmentName;    //Node name\n"
     262  "  Set _.linearParamInfo; //Set of Bsr.OneNode.LinearParamInfo\n"
     263  "  Anything _.Y;          //Output data (Matrix or VMatrix)\n"
     264  "  Anything _.X;          //Input data  (Matrix or VMatrix)\n"
     265  "  Real _.sigma;          //Sigma prior value, or ? to freely simulate it\n"
     266  "//Optional members \n"
     267  "  Set _.orderRelation;   //Set of Bsr.OrderRelation.Info\n"
     268  "  Set _.arima;           //Set of ARIMAStruct\n"
     269  "  Real _.sigmaPriorWeight;  //Weight for Bsr.Sigma.Prior.InverseGamma\n"
     270  "  Set _.timeInfo;        //BSR.NoiseTimeInfo\n"
     271  "]];\n";
     272  Set Estim(NameBlock data, Set nonLinFil, NameBlock config_)
     273  ///////////////////////////////////////////////////////////////////////////
     274  {
     275    Text _MID = "[EstimOneNode]";
     276    //Data source for model defining
     277    Set modelDef = BuildModelDef(data, config_);
    252278    Set result = If(Not(config_::mcmc.sampleLength), [[data, modelDef]],
    253279    {
Note: See TracChangeset for help on using the changeset viewer.