Changeset d7e2da2 in tol


Ignore:
Timestamp:
Apr 1, 2009, 3:46:50 PM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
90b59de
Parents:
48190fa
Message:

Removing max-likelihood step

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

File:
1 edited

Legend:

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

    r48190fa rd7e2da2  
    518518  "Method of generation of a ARMA block by using current scalar method,"
    519519  " given by _scalarSampler, for each parameter";
    520   VMatrix draw.scalar(Real numSim, VMatrix noise, VMatrix sigma.full,
    521                       Real calcMaxLikelihood)
     520  VMatrix draw.scalar(Real numSim, VMatrix noise, VMatrix sigma.full)
    522521  ////////////////////////////////////////////////////////////////////////////
    523522  {
    … …  
    579578    //WriteLn("TRACE"+_MID+" draw.scalar z0="<<z0);
    580579    //WriteLn("TRACE"+_MID+" draw.scalar a0="<<a0);
    581 /*
    582       Real maxLogLikelihood = -1/0;
    583       Real maxLogLikelihood.x = 0;
    584 */
    585580
    586581      Real LogDens.Almagro.Z_cond_U(Real x)
    … …  
    590585        Polyn  ma = ARIMAGetMA(arima);
    591586        Real llh = Copy(almagro::LogLH.Z_cond_U(ar,ma,z0,a0));
    592 /*
    593         Real If(calcMaxLikelihood,
    594           If(llh>maxLogLikelihood,
    595           {
    596             Real maxLogLikelihood   :=llh;
    597             Real maxLogLikelihood.x := x
    598           }));
    599 */
    600587        llh
    601588      };
    602589      Code LogDens = LogDens.Almagro.Z_cond_U;
    603590      Real If(Or(pd->coef<x0,pd->coef>x1), { pd->coef := Rand(x0,x1) }, 0);
    604       /*
    605       Real pd->coef := _scalarSampler(LogDens.Almagro.Z_cond_U,x0,x1);
    606       Real If(calcMaxLikelihood, pd->coef := maxLogLikelihood.x);
    607       */
    608       Real pd->coef:= If(!calcMaxLikelihood,
    609       {
    610         _scalarSampler(LogDens,x0,x1,pd->coef)
    611       },
    612       {
    613         Real MinusLogDens(Real x_) { -LogDens(x_) };
    614         Real y=0;
    615         FibonacciMin(MinusLogDens, y, x0, x1, 1.E-5*n)
    616       });
     591      Real pd->coef:= _scalarSampler(LogDens,x0,x1,pd->coef);
    617592
    618593    //WriteLn("TRACE"+_MID+" draw.scalar pd->coef="<<pd->coef);
    … …  
    639614       numSim%(_.blockDef::_.config::bsr.arimaSkipIter)==0),
    640615    {
    641       draw.scalar(numSim, noise, sigBlk, False)
     616      draw.scalar(numSim, noise, sigBlk)
    642617    },
    643618    {
    644619      Copy(_.blockDef::_.store)
    645620    })
    646   };
    647 
    648   ////////////////////////////////////////////////////////////////////////////
    649   Text _.autodoc.member.maxLikelihood =
    650   "Method of contitioned maximum likelihood";
    651   VMatrix maxLikelihood(Real numSim, VMatrix noise, VMatrix sigBlk)
    652   ////////////////////////////////////////////////////////////////////////////
    653   {
    654     draw.scalar(numSim, noise, sigBlk, True)
    655621  };
    656622
Note: See TracChangeset for help on using the changeset viewer.