Changeset c81dea8 in tol


Ignore:
Timestamp:
Nov 23, 2008, 3:04:24 PM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
7ddb849
Parents:
9871d4f2
Message:

Specialized method Get.Equation.Size for non time series observational nodes
Fixed bug in missing values information for non time series observational nodes

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/dynhlm/_build.node.obs.tol

    r9871d4f2 rc81dea8  
    3636  Text _.id_node = id_node;
    3737  Text _.name = name;
     38  Real _.isTimeSerie = True;
    3839  Serie _.serie = serie;
    3940  Real _.avg =
    … …  
    6364  //Sorted list of analyzed dates
    6465  Set _.dates = Dates(Dating(_.serie), _.firstIniVal, _.lastDate);
     66  Real Get.Equation.Size(Real unused)
     67  {
     68    Card(_.dates)
     69  };
    6570  Serie _.unk.left = SubSer(CalInd(Dating(_.serie),Dating(_.serie)),
    6671                       _.firstIniVal, Succ(First(_.serie),Dating(_.serie),-1));
    … …  
    147152  Text _.id_node = id_node;
    148153  Text _.name = name;
     154  Real _.isTimeSerie = False;
    149155  Matrix _.serie = serie;
    150156  Real _.avg =
    … …  
    167173  {
    168174    Text txt = IntText(num);
    169     "MissingBlk::"+_.missing.label+"::"+_.name+"::"+txt
     175    "MissingBlk::"+_.missing.label+"::"+_.name+"::N"+txt
     176  };
     177  Real Get.Equation.Size(Real unused)
     178  {
     179    Rows(_.serie)
    170180  };
    171181  //Returns the expression of the t-th regression coefficient that could be a
    … …  
    174184  {
    175185  //WriteLn("TRACE get.coef t="<<t);
    176     Real x = MatDat(_.serie, t);
     186    Real x = MatDat(_.serie, t, 1);
    177187    If(IsUnknown(x),
    178188       "+"+missing.name(num),
    … …  
    182192  {
    183193  //WriteLn("TRACE get.knownCoefOrAvg t="<<t);
    184     Real x = MatDat(_.serie, t);
     194    Real x = MatDat(_.serie, t,1);
    185195    BysMcmc::Bsr::Import::RealTextS(If(IsUnknown(x),_.avg, x))
    186196  };
    187197  //Sorted list of variables related to missing values
    188   Set _.missing = EvalSet(Range(1,Rows(_.serie),1),Set(Real num)
    189   {
    190     Bsr.Missing.Info(Text Name = missing.name(num),
    191                      Real Average = _.avg,
    192                      Real Sigma = _.stds*_.missing.sigmaFactor,
    193                      Real LowerBound = _.missing.lowerBound,
    194                      Real UpperBound = _.missing.upperBound)
    195   })
     198  Set _.missing =
     199  {
     200    Set aux = EvalSet(Range(1,Rows(_.serie),1),Set(Real num)
     201    {
     202      Real x = MatDat(_.serie,num,1);
     203      If(!IsUnknown(x),Copy(Empty),
     204      Bsr.Missing.Info(Text Name = missing.name(num),
     205                       Real Average = _.avg,
     206                       Real Sigma = _.stds*_.missing.sigmaFactor,
     207                       Real LowerBound = _.missing.lowerBound,
     208                       Real UpperBound = _.missing.upperBound))
     209    });
     210    Select(aux,Card)
     211  }
    196212]]};
    197213
    … …  
    503519  Set Get.TimeInfo(Real unused)
    504520  {
     521    If(Not(_.output::_.serie.info::_.isTimeSerie),Copy(Empty),
    505522    BSR.NoiseTimeInfo
    506523    (
    … …  
    508525      _.output::_.serie.info::_.firstDate,
    509526      _.output::_.serie.info::_.lastDate
    510     )
     527    ))
    511528  };
    512529  Real Get.Equation.Size(Real unused)
    513530  {
    514     Card(_.output::_.serie.info::_.dates)
     531    _.output::_.serie.info::Get.Equation.Size(0)
    515532  };
    516533  //Returns Real known output or Text missing name
Note: See TracChangeset for help on using the changeset viewer.