﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
1055	La transformación BoxCox es diferente en Tol y MMS	lmperez@…	Víctor de Buen Remiro	"Las funciones BoxCoxTransform y BoxCoxInverseTransform ""C:\Program Files\Bayes\tolbase-v2.0.1\bin\stdlib\general\grammars\_.serie.tol"" son distintas a las análogas en mms ""\PRE-1.0\MMS\definition\02_model\def_transformation.tol"" y ""\PRE-1.0\MMS\definition\02_model\def_transformation_boxcox.tol"". He subido el ticket en ambos sitios
 no se cual debería tomar la responsabilidad de cambiar y de avisar a todos los projectos de Bayes que puedan estar usándolas.

Tol:
{{{
//////////////////////////////////////////////////////////////////////////////
  Serie  BoxCoxTransform(Serie s, Real bct)
//////////////////////////////////////////////////////////////////////////////
{
  If(bct==1, s+0, If(bct==0, Log(s), s^bct))
};


//////////////////////////////////////////////////////////////////////////////
  Serie  BoxCoxInverseTransform(Serie s, Real bct)
//////////////////////////////////////////////////////////////////////////////
{
  Real invExp = 1/bct;
  If(bct==1, s+0, If(bct==0, Exp(s), s^invExp))
};
}}}

MMS
{{{
//////////////////////////////////////////////////////////////////////////////
@MMS.Transformation BoxCox(Real first, Real second) 
//////////////////////////////////////////////////////////////////////////////
{
  @MMS.Transformation::Block(NameBlock { NameBlock args = [[
    Text _.name              = ""BoxCox_""<<first<<""_""<<second;
    Text _.grammar           = ""Serie"";
    Text _.contextExpression = ""
      Real _.first = ""<<first<<"";
      Real _.second = ""<<second<<"";
    "";
    Text _.directExpression  = If(first==0, 
      ""Serie (Serie s) { Log(s + _.second) }"",
      ""Serie (Serie s) { ((s + _.second)**_.first - 1)/_.first }""
    );
    Text _.inverseExpression = If(first==0, 
      ""Serie (Serie t) { Exp(t) - _.second }"",
      ""Serie (Serie t) { (_.first * t + 1)**(1/_.first) - _.second }""
    )
  ]] })
};

}}}"	defect	closed	highest		ASCII data files		blocker	fixed		
