Changeset 3e558bb in tol for tol_tests


Ignore:
Timestamp:
Apr 12, 2010, 2:09:09 PM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
a30612b
Parents:
e06a79e
Message:

accept_reject debe llamar siempre a doAfterDraw, se acepte o no el candidato, y debe hacerlo después de actualizar los indicadores de aceptacón.

No es necesario recalcular el Set _.arima ni el NameBlock _.almagro si no se ha aceptado el nuevo candidato, pero sí se deben generar nuevos valores iniciales, puesto que en realidad se trata de un bloque de Gibss aparte

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol_tests/tol/ARIMA/mcmc/mtrymh.tol

    re06a79e r3e558bb  
    134134    {
    135135      VMatrix _.x := Copy(y);
    136       Real doAfterDraw(0);
    137136      Real _.num_accept := _.num_accept +1
    138137    });
    … …  
    147146      Real _.s := _.s*_.sFactor
    148147    });
     148  //Real If(_.accept, { Real doAfterDraw(0) });
     149    Real doAfterDraw(0);
    149150    _.accept
    150151  };
    … …  
    507508  ////////////////////////////////////////////////////////////////////////////
    508509  {
    509     Polyn  _.ar := ARIMAGetAR(_.arima);
    510     Polyn  _.ma := ARIMAGetMA(_.arima);
    511     NameBlock _.almagro := ARMAProcess::Eval.Almagro(_.ar,_.ma,_.z,_.sigma);
     510    Real If(_.accept,
     511    {
     512      Polyn  _.ar := ARIMAGetAR(_.arima);
     513      Polyn  _.ma := ARIMAGetMA(_.arima);
     514      NameBlock _.almagro := ARMAProcess::Eval.Almagro(_.ar,_.ma,_.z,_.sigma);
     515      True
     516    });
    512517    VMatrix _.u0 := _.almagro::Draw.U_cond_Z(0);
    513518    VMatrix _.z0 := _.almagro::Get.Z0(_.u0);
    … …  
    525530      SetOfPolyn(1-f->AR, 1-f->MA)
    526531    });
    527         VMatrix _.x := arima2col(_.arima);
     532    VMatrix _.x := arima2col(_.arima);
     533    Real _.accept := True;
    528534    Real ok = setArima(0);
    529535    Real _.n := VRows(_.x);
    … …  
    557563  ////////////////////////////////////////////////////////////////////////////
    558564  {
    559     Set _.arima := col2arima(_.x);
    560     Real setArima(void);
    561     Real doAfterDraw_cum(void)
     565    Set If(_.accept, _.arima := col2arima(_.x));
     566    Real setArima(void)
     567//  Real doAfterDraw_cum(void)
    562568  };
    563569
    … …  
    698704Real TolOprProfiler.Enabled := True;
    699705While(numSim<2500, append_draw(mtm_arima::draw_multiple_try(0)));
    700 Real TolOprProfiler.Dump("draw_multiple_try.03.csv");
     706Real TolOprProfiler.Dump("draw_multiple_try.csv");
    701707Real mtm.time = (Copy(Time) - mtm.t0)/numSim;
    702708WriteLn("Time by MTM simulation "<<mtm.time);
    703709/* */
    704710
    705 Matrix real_param = Group("ConcatColumns", For(1,Columns(PARAM),Matrix(Real j)
     711Matrix cmp = mcmc | Group("ConcatColumns", For(1,Rows(PARAM),Matrix(Real j)
    706712{
    707   Constant(Rows(PARAM),1,MatDat(PARAM,j,1))
     713  Constant(Rows(mcmc),1,MatDat(PARAM,j,1))
    708714}));
    709715
    710716/* */
    711717
     718
     719
Note: See TracChangeset for help on using the changeset viewer.