Changeset 8161a0c in tol


Ignore:
Timestamp:
Oct 21, 2008, 10:55:35 AM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
14c595e
Parents:
c51d000
Message:

New method get.param.signif;

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

Location:
tol/stdlib/math/stat/models/bayesian/bysMcmc
Files:
2 edited

Legend:

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

    rc51d000 r8161a0c  
    2323  //public API
    2424  Code get.coda.raftery.diag;
     25  Code get.sample;
    2526  Code get.coda.summary;
    26   Code get.sample;
     27  Code get.param.signif;
    2728  Code get.acf;
    2829  Code get.histogram;
  • tol/stdlib/math/stat/models/bayesian/bysMcmc/_inference_functions.tol

    rc51d000 r8161a0c  
    121121};
    122122
    123 
    124 
    125 /////////////////////////////////////////////////////////////////////////////
    126 Set get.acf(Text                   name,
    127             Set                    colNames,
     123/////////////////////////////////////////////////////////////////////////////
     124Set get.param.signif(Text                 name,
     125                     Set                  colNames,
     126                     BysInf.Report.Config repCfg,
     127                     Set                  sample)
     128//Builds the signification test of parameters
     129/////////////////////////////////////////////////////////////////////////////
     130{
     131  If(repCfg->acf.lag_==0, Copy(Empty), {
     132  Real CMsg::Phase::show(2,"1.5 BysMcmc::Inference::get.param.signif of "+name_);
     133  Real n = Card(sample);
     134  Real m = Rows(sample[1]);
     135//If(n!=Card(colNames),error
     136  Set test = For(1,n, Set(Real j)
     137  {
     138    Set test = AlgLib.OneSampleSignTest(sample[j], 0);
     139    BysInf.Param.Signif
     140    {
     141      colNames[j],
     142      Real isZero_ = test::bothtails,
     143      Real isPos_  = test::lefttail,
     144      Real isNeg_  = test::righttail
     145    }
     146  });
     147  Eval(name+".Param.Signif=test")
     148})};
     149
     150/////////////////////////////////////////////////////////////////////////////
     151Set get.acf(Text                 name,
     152            Set                  colNames,
    128153            BysInf.Report.Config repCfg,
    129             Set                    sample)
     154            Set                  sample)
    130155//Builds the sample autocorrelation function (ACF) of each parameter
    131156/////////////////////////////////////////////////////////////////////////////
    … …  
    139164  {
    140165    Matrix mc  = sample[j];
     166    //Transforming to Serie in order to use AutoCor
    141167    Serie  s   = MatSerSet(Tra(mc),C,Today)[1];
    142168    Matrix acf = AutoCor(s,repCfg->acf.lag_);
    … …  
    228254  Real m = Rows   (mcmc);
    229255  Set coda.raftery.diag = get.coda.raftery.diag(name, colNames, repCfg, mcmc);
     256  Set sample = get.sample(name, colNames, repCfg, mcmc);
    230257  Set coda.summary = get.coda.summary(name, colNames, repCfg, mcmc);
    231   Set sample = get.sample(name, colNames, repCfg, mcmc);
     258  Set param.signif = get.param.signif(name, colNames, repCfg, sample);
    232259  Set acf = get.acf(name, colNames, repCfg, sample);
    233260  Set histogram = get.histogram(name, colNames, repCfg, sample);
    … …  
    239266    repCfg,
    240267    mcmc,
     268    coda.raftery.diag,
    241269    sample,
    242     coda.raftery.diag,
    243270    coda.summary,
     271    param.signif,
    244272    acf,
    245273    histogram,
    … …  
    263291  Do PutDescription("The CODA summary information about each individual "
    264292    "variable",
     293    aux::coda.summary);
     294  Do PutDescription("Test of parameter signification gives p-value of be zero, "
     295    "positive or negative for each parameter",
    265296    aux::coda.summary);
    266297  Do PutDescription("Observed AutoCorrelation Function for each individual "
Note: See TracChangeset for help on using the changeset viewer.