Changeset 91f3555 in tol


Ignore:
Timestamp:
Mar 11, 2009, 6:00:55 PM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
ddc5101
Parents:
943545c
Message:

Selecting variant columns of mcmc to avoid errors in Raftery

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

File:
1 edited

Legend:

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

    r943545c r91f3555  
    272272  Real n = Columns(mcmc);
    273273  Real m = Rows   (mcmc);
    274   Set coda.raftery.diag = get.coda.raftery.diag(name, colNames, repCfg, mcmc);
     274
     275  Set idx_ = Range(1,n,1);
     276  Set idx = Select(idx_,Real(Real col)
     277  {
     278    Matrix c = SubCol(mcmc,[[col]]);
     279    MatMax(c)>MatMin(c)
     280  });
     281  Matrix mcmcV = SubCol(mcmc_, idx);
     282//WriteLn("TRACE mcmcV("<<Rows(mcmcV)+"x"<<Columns(mcmcV));
     283  Set colNamesV = ExtractByIndex(colNames_,idx);
     284//WriteLn("TRACE colNamesV="<<colNamesV);
     285  Set coda.raftery.diag = get.coda.raftery.diag(name, colNamesV, repCfg, mcmcV);
    275286  Set sample = get.sample(name, colNames, repCfg, mcmc);
    276287  Set coda.summary = get.coda.summary(name, colNames, repCfg, mcmc);
    … …  
    499510/////////////////////////////////////////////////////////////////////////////
    500511  Set loadAndReport(Text path, Real burnin, Real length_, Real thinning,
    501                     Text name, Set colNames_, Set repCfg)
     512                    Text name, Set colNames, Set repCfg)
    502513/////////////////////////////////////////////////////////////////////////////
    503514{
    … …  
    505516  Real max = (mcmc.dim::Rows-burnin)/thinning;
    506517  Real length = Min(max,length_);
    507   Matrix mcmc_ = BysMcmc::Inference::loadMcmc(path, burnin, length, thinning);
     518  Matrix mcmc = BysMcmc::Inference::loadMcmc(path, burnin, length, thinning);
     519/*
    508520  Set idx_ = Range(1,Columns(mcmc_),1);
    509521  Set idx = Select(idx_,Real(Real col)
    … …  
    513525  Matrix mcmc = SubCol(mcmc_, idx);
    514526  Set colNames = ExtractByIndex(colNames_,idx);
     527*/
    515528  BysMcmc::Inference::report
    516529  (
Note: See TracChangeset for help on using the changeset viewer.