Changeset 1684764 in tol


Ignore:
Timestamp:
Aug 31, 2012, 9:36:29 AM (14 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
d1e301f
Parents:
abe80db
Message:

Refs #1136
Modified Box Pierce statistic

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/real_type/datgsrst.cpp

    rabe80db r1684764  
    583583  contens_ = BoxPierceLjungACF(ACF.Data(), m, s);
    584584}
     585
     586//--------------------------------------------------------------------
     587DeclareContensClass(BDat, BDatTemporary, BDatBoxPierceACF);
     588DefExtOpr(1, BDatBoxPierceACF, "BoxPierceACF", 3, 3,
     589    "Matrix Real Real",
     590    "(Matrix acf, Real m, Real s)",
     591    I2("Returns the Box-Pierce statistic for first ŽmŽ  "
     592       "autocorrelations in vector ŽacfŽ from a time series of length ŽsŽ",
     593       "Devuelve el estadístico de Box-Pierce para las ŽsŽ primeras "
     594       "autocorrelaciones del vector ŽacfŽ de una serie temporal de "
     595       "longitud ŽsŽ."),
     596    BOperClassify::Sthocastic_);
     597void BDatBoxPierceACF::CalcContens()
     598//--------------------------------------------------------------------
     599{
     600  BMatrix<BDat>& ACF = Mat(Arg(1));
     601  BInt m = (BInt)Real(Arg(2));
     602  BInt s = (BInt)Real(Arg(3));
     603  contens_ = BoxPierceACF(ACF.Data(), m, s);
     604}
     605
     606//--------------------------------------------------------------------
     607DeclareContensClass(BDat, BDatTemporary, BDatBoxPierceModACF);
     608DefExtOpr(1, BDatBoxPierceModACF, "BoxPierceModACF", 3, 3,
     609    "Matrix Real Real",
     610    "(Matrix acf, Real m, Real s)",
     611    I2("Returns the modified Box-Pierce statistic for first ŽmŽ  "
     612       "autocorrelations in vector ŽacfŽ from a time series of length ŽsŽ."
     613       "The modification ensures that first and second moments are the same "
     614       "than theorical chi-square moments, and it's defined in formulae (67) "
     615       "of article",
     616       "Devuelve el estadístico de Box-Pierce modificado para las ŽsŽ primeras "
     617       "autocorrelaciones del vector ŽacfŽ de una serie temporal de "
     618       "longitud ŽsŽ. La modificación asegura que los dos primeros momentos "
     619       "coinciden con la distribución chi cuadrado teórica, y puede verse la "
     620       "definición en la fórmula (67) del artículo")+
     621       "\nOn the distribution of the sample autocorrelation coefficients (Kan-Wang)"
     622       "\nhttp://www.rotman.utoronto.ca/xiaolu.wang04/index_files/sacf4.pdf",
     623    BOperClassify::Sthocastic_);
     624void BDatBoxPierceModACF::CalcContens()
     625//--------------------------------------------------------------------
     626{
     627  BMatrix<BDat>& ACF = Mat(Arg(1));
     628  BInt m = (BInt)Real(Arg(2));
     629  BInt s = (BInt)Real(Arg(3));
     630  contens_ = BoxPierceModACF(ACF.Data(), m, s);
     631}
Note: See TracChangeset for help on using the changeset viewer.