Changeset 1abcc87 in tol


Ignore:
Timestamp:
Oct 26, 2008, 10:45:11 AM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
0691acd
Parents:
8349bbb
Message:

Preparing for common input missing

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@84 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

    r8349bbb r1abcc87  
    2020  //The last date to be analyzed
    2121  Date last,
     22  //Missing label is used as prefix of missing parameters
     23  Text missing.label,
    2224  //If there are missing values it will be added prior information about it
    2325  //multiplying the standard deviation of the serie by this factor.
    … …  
    3840  {
    3941    Real aux = AvrS(_.serie);
    40     If(IsUnknown(aux), WriteLn("Serie "+_.name+" is fully unknown","W"));
     42    If(IsUnknown(aux), WriteLn("Serie "+_.id_node+"::"+_.name+
     43      " is fully unknown","W"));
    4144    aux
    4245  };
    4346  Real _.stds = StDsS(_.serie);
     47  Text _.missing.label       = missing.label;
     48  Text _.missing.name        = _.missing.label+"_"+_.name;
    4449  Real _.missing.sigmaFactor = missing.sigmaFactor;
    4550  Real _.missing.lowerBound  = missing.lowerBound;
    … …  
    8085  {
    8186    Text txt = FormatDate(dte,"%cy%Ym%md%dh%hi%is%s");
    82     "MissingBlk::"+_.id_node+"::"+_.name+"::"+txt
     87    "MissingBlk::"+_.missing.label+"::"+_.name+"::"+txt
    8388  };
    8489  //Returns the expression of the t-th regression coefficient that could be a
    … …  
    126131  //Time serie data
    127132  Matrix serie,
     133  //Missing label is used as prefix of missing parameters
     134  Text missing.label,
    128135  //If there are missing values it will be added prior information about it
    129136  //multiplying the standard deviation of the serie by this factor.
    … …  
    148155  };
    149156  Real _.stds = MatStDs(_.serie);
     157  Text _.missing.label = missing.label;
     158  Text _.missing.name  = _.missing.label+"_"+_.name;
    150159  Real _.missing.sigmaFactor = missing.sigmaFactor;
    151160  Real _.missing.lowerBound  = missing.lowerBound;
    … …  
    158167  {
    159168    Text txt = IntText(num);
    160     "MissingBlk::"+_.id_node+"::"+_.name+"::"+txt
     169    "MissingBlk::"+_.missing.label+"::"+_.name+"::"+txt
    161170  };
    162171  //Returns the expression of the t-th regression coefficient that could be a
    … …  
    203212  //The last date to be analyzed or UnknownDate if it's a vector
    204213  Date last,
     214  //Missing label is used as prefix of missing parameters
     215  Text missing.label,
    205216  //If there are missing values it will be added prior information about it
    206217  //multiplying the standard deviation of the serie by this factor.
    … …  
    221232  //WriteLn("TRACE [Obs.Data.Info] 1");
    222233    Obs.Serie.Info(
    223       id_node, name, serie, numIniVal, first, last,
     234      id_node, name, serie, numIniVal, first, last, missing.label,
    224235      missing.sigmaFactor, missing.lowerBound, missing.upperBound)
    225236  },
    … …  
    228239  //WriteLn("TRACE [Obs.Data.Info] 2");
    229240    Obs.Vector.Info(
    230       id_node, name, serie,
     241      id_node, name, serie, missing.label,
    231242      missing.sigmaFactor, missing.lowerBound, missing.upperBound)
    232243  },
    … …  
    335346    (
    336347      id_node+"::Noise",
    337       _.transferFunction,
     348      Copy(_.transferFunction),
    338349      EvalSet(_.omegaParam, Text(Bsr.Param.Info pi) { pi->Name}),
    339       _.omega,
    340       _.delta,
     350      Copy(_.omega),
     351      Copy(_.delta),
    341352      If(!_.p,Rand(0,1,0,0), Tra(SerSetMat([[ser]], fst0, lst0))),
    342353      Tra(SerSetMat([[ser]], fst,lst))
    … …  
    370381  //A set where each item is the result of calling Obs.TransFun
    371382  Set transFun,
     383  //Acumulate input.missing.labels to avoid repetitions
     384  Set input.missing.labels,
    372385  //The result of calling BysMcmc::Bsr::Import::Constraints
    373386  NameBlock constraints,
    … …  
    416429    BinGroup("<<", EvalSet(_.input, Set(NameBlock inp)
    417430    {
    418       inp::_.serie.info::_.missing
     431      Set label = [[inp::_.serie.info::_.missing.name]];
     432      Text PutName(label[1],label[1]);
     433      Real idx = FindIndexByName(input.missing.labels,label[1]);
     434    //WriteLn("TRACE Obs Missing Label Name : "+label[1]+" -> "<<idx);
     435      If(idx, Copy(Empty),
     436      {
     437        Set Append(input.missing.labels, label);
     438        Real SetIndexByName(input.missing.labels);
     439        inp::_.serie.info::_.missing
     440      })
    419441    }));
    420442
Note: See TracChangeset for help on using the changeset viewer.