Changeset 90b59de in tol


Ignore:
Timestamp:
Apr 1, 2009, 3:47:01 PM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
24bdea7
Parents:
d7e2da2
Message:

Removing max-likelihood step

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

File:
1 edited

Legend:

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

    rd7e2da2 r90b59de  
    9494  Set _.filterColIdx = If(!_.isInputFilter, Copy(Empty),
    9595  {
    96     _.bsr::_.lin.blk::_.blockDef::getStoreColIndexes(_.linBlkNames)
     96    _.bsr::_.mln.blk::_.blockDef::getStoreColIndexes(_.linBlkNames)
    9797  });
    9898  //Total number of affected parameters in linear block
    … …  
    127127  "Method of generation of a non linear block by using current scalar method,"
    128128  " given by scalarSampler for each parameter";
    129   VMatrix draw.scalar(Real numSim,
    130                       Real calcMaxLikelihood)
    131   ////////////////////////////////////////////////////////////////////////////
    132   {
    133   //WriteLn("TRACE"+_MID+"draw.scalar 1 calcMaxLikelihood="<<calcMaxLikelihood);
     129  VMatrix draw.scalar(Real numSim)
     130  ////////////////////////////////////////////////////////////////////////////
     131  {
     132  //WriteLn("TRACE"+_MID+"draw.scalar 1 ");
    134133    VMatrix   fullNoise = _.bsr::_.noise;
    135134    NameBlock arimaBlk  = _.bsr::_.arm.blk;
    … …  
    138137  //WriteLn("TRACE"+_MID+"draw.scalar 1.1 _.isInputFilter = "<<_.isInputFilter);
    139138    Matrix omega= If(!_.isInputFilter, Col(1),
    140       SubRow(VMat2Mat(_.bsr::_.lin.blk::_.blockDef::_.store),
    141                          _.filterColIdx));
     139      SubRow(VMat2Mat(_.bsr::_.mln.blk::getStore(0)), _.filterColIdx));
    142140  //WriteLn("TRACE"+_MID+"draw.scalar 1.2 omega("<<Rows(omega)+"x"<<Columns(omega));
    143141  //WriteLn("TRACE"+_MID+"draw.scalar 1.3 _.Fi("<<Rows(_.Fi)+"x"<<Columns(_.Fi));
    … …  
    190188        Real ld = -0.5*MatDat(MtMSqr(ei),1,1);
    191189      //WriteLn("TRACE LogDens.WhiteNoise("+_.colNames[i]+","<<x+")="<<ld);
    192       //Real UpdateMaxLogLikelihood(x,ld);
    193190        ld+get.priorLogDens(i)
    194191      };
    … …  
    201198        Real ld = -0.5*MatDat(MtMSqr(ei),1,1);
    202199      //WriteLn("TRACE LogDens.ARMA("+_.colNames[i]+","<<x+")="<<ld);
    203       //Real UpdateMaxLogLikelihood(x,ld);
    204200        ld+get.priorLogDens(i)
    205201      };
    … …  
    217213        Real ld = -0.5*MatDat(MtMSqr(ei),1,1);
    218214      //WriteLn("TRACE LogDens.ARIMA("+_.colNames[i]+","<<x+")="<<ld);
    219       //Real UpdateMaxLogLikelihood(x,ld);
    220215        ld+get.priorLogDens(i)
    221216      };
    … …  
    232227      Real If(Or(x<x0,x>x1), x := Rand(x0,x1) );
    233228    //WriteLn("TRACE"+_MID+"draw.scalar.one 2.["+IntText(i)+"].5");
    234       Real x:= If(!calcMaxLikelihood,
    235       {
    236         _scalarSampler(LogDens,x0,x1,x)
    237       },
    238       {
    239         Real MinusLogDens(Real x_) { -LogDens(x_) };
    240         Real y=0;
    241         FibonacciMin(MinusLogDens, y, x0, x1, 1.E-5*n)
    242       });
     229      Real x:= _scalarSampler(LogDens,x0,x1,x);
    243230    //WriteLn("TRACE draw.scalar x= "<<x);
    244231    //WriteLn("TRACE"+_MID+"draw.scalar.one 2.["+IntText(i)+"].6");
    … …  
    274261      },
    275262      {
    276         draw.scalar(numSim, False)
     263        draw.scalar(numSim)
    277264      })
    278265    },
    … …  
    281268      Copy(_.blockDef::_.store)
    282269    })
    283   };
    284 
    285   ////////////////////////////////////////////////////////////////////////////
    286   Text _.autodoc.member.maxLikelihood =
    287   "Method of contitioned maximum likelihood";
    288   VMatrix maxLikelihood(Real numSim)
    289   ////////////////////////////////////////////////////////////////////////////
    290   {
    291   //WriteLn("TRACE"+_MID+"maxLikelihood 1");
    292     draw.scalar(numSim, True)
    293270  };
    294271
Note: See TracChangeset for help on using the changeset viewer.