Changeset dadf1e9 in tol


Ignore:
Timestamp:
Apr 14, 2009, 1:43:57 PM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
7f84566
Parents:
b57d0d0
Message:

Preparing hierarchy of classes based on StdLinearBlock

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

Location:
tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/gibbs
Files:
4 edited

Legend:

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

    rb57d0d0 rdadf1e9  
    1818{
    1919  If(!Card(inputMissingBlock),
    20   BysMcmc::NoBlockSampler(name, Empty, numBlock, firstCol, config),
    21   BysMcmc::Bsr::Gibbs::StdLinearBlock blk = [[
     20  BysMcmc::Bsr::Gibbs::NoStdLinearBlock(name, Empty, numBlock, firstCol, config),
     21  BysMcmc::Bsr::Gibbs::StdLinearFullBlock blk = [[
    2222  //Given initial values of block variables
    2323  VMatrix _.store_ = Mat2VMat(SetMat(Extract(inputMissingBlock, 6)));
  • tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/gibbs/_mainLinearBlock.tol

    rb57d0d0 rdadf1e9  
    2828{
    2929  If(!Card(varNames),
    30   BysMcmc::NoBlockSampler(name, varNames, numBlock, firstCol, config),
    31   BysMcmc::Bsr::Gibbs::StdLinearBlock blk = [[
     30  BysMcmc::Bsr::Gibbs::NoStdLinearBlock(name, Empty, numBlock, firstCol, config),
     31  BysMcmc::Bsr::Gibbs::StdLinearFullBlock blk = [[
    3232  //Defining the block in the Markov Chain
    3333  Real _define = define(name, varNames, numBlock, firstCol, config);
  • tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/gibbs/_outputMissingBlock.tol

    rb57d0d0 rdadf1e9  
    1717{
    1818  If(!Card(outputMissingBlock),
    19   BysMcmc::NoBlockSampler(name, Empty, numBlock, firstCol, config),
    20   BysMcmc::Bsr::Gibbs::StdLinearBlock blk = [[
     19  BysMcmc::Bsr::Gibbs::NoStdLinearBlock(name, Empty, numBlock, firstCol, config),
     20  BysMcmc::Bsr::Gibbs::StdLinearFullBlock blk = [[
    2121  //Given initial values of block variables
    2222  VMatrix _.store = Mat2VMat(SetMat(Extract(outputMissingBlock, 6)));
  • tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/gibbs/_stdLinearBlock.tol

    rb57d0d0 rdadf1e9  
    483483//////////////////////////////////////////////////////////////////////////////
    484484{
     485  Real initialize.subBlocks(Real unused);
     486  Real matchConstrains(VMatrix beta0, VMatrix A, VMatrix a);
     487
     488  ////////////////////////////////////////////////////////////////////////////
     489  Real initialize(Real unused)
     490  ////////////////////////////////////////////////////////////////////////////
     491  {
     492    initialize.subBlocks(unused)
     493  };
     494
     495  ////////////////////////////////////////////////////////////////////////////
     496  //Default behaviour assumes standarized linear regression
     497  VMatrix standarize(VMatrix _Z)
     498  ////////////////////////////////////////////////////////////////////////////
     499  {
     500    _Z
     501  };
     502
     503  ////////////////////////////////////////////////////////////////////////////
     504  NameBlock getWorkSpace(Real unused)
     505  ////////////////////////////////////////////////////////////////////////////
     506  {
     507    _.ws
     508  }
     509
     510};
     511
     512//////////////////////////////////////////////////////////////////////////////
     513StdLinearBlock NoStdLinearBlock(Text name, Set colNames,
     514                                Real numBlock, Real firstCol,
     515                                Config config)
     516//////////////////////////////////////////////////////////////////////////////
     517{
     518  BysMcmc::Bsr::Gibbs::StdLinearBlock noBlock =
     519  [[
     520    Real _define = define(name, colNames, numBlock, firstCol, config);
     521    VMatrix draw(Real numSim) { ? };
     522    Code _.buildWorkSpace = draw;
     523    Real initialize.subBlocks(Real unused) { ? };
     524    Real matchConstrains(VMatrix beta0, VMatrix A, VMatrix a) { ? }
     525  ]];
     526  noBlock
     527};
     528
     529//////////////////////////////////////////////////////////////////////////////
     530Text _.autodoc.member.StdLinearFullBlock =
     531"Builds a NameBlock that can draw a Gibbs sample of an standarized linear "
     532"block of a general regression model with variant input and ouput regression "
     533"matrices and optional but fixed constraining inequations.";
     534//////////////////////////////////////////////////////////////////////////////
     535Class StdLinearFullBlock: StdLinearBlock
     536//////////////////////////////////////////////////////////////////////////////
     537{
    485538  BysMcmc::Bsr::Gibbs::StdLinearSubBlock _.subBlock =
    486539    BysMcmc::Bsr::Gibbs::StdLinearSubBlock.Build(_MID+"[_.subBlock] ");
    … …  
    551604
    552605};
    553 
    554606/*
    555607//////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.