[Blotter-commits] r504 - pkg/RTAQ/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 21 12:36:24 CET 2010


Author: jonathan
Date: 2010-12-21 12:36:23 +0100 (Tue, 21 Dec 2010)
New Revision: 504

Modified:
   pkg/RTAQ/R/periodicityTAQ.R
Log:
Spotvol function: correction for rbpcov

Modified: pkg/RTAQ/R/periodicityTAQ.R
===================================================================
--- pkg/RTAQ/R/periodicityTAQ.R	2010-12-20 22:07:47 UTC (rev 503)
+++ pkg/RTAQ/R/periodicityTAQ.R	2010-12-21 11:36:23 UTC (rev 504)
@@ -20,11 +20,11 @@
     M = ncol(mR);
     if( cDays == 1){
        mR = as.numeric(rdata)
-       estimdailyvol = switch( dailyvol , "bipower" = RBPVar(mR) , 
+       estimdailyvol = switch( dailyvol , "bipower" = RBPCov(mR) , 
                                           "medrv"   = MedRV(mR) ,
                                           "rv"      = RV(mR) ) 
     }else{
-       estimdailyvol = switch( dailyvol , "bipower" = apply(mR,1,'RBVar') , 
+       estimdailyvol = switch( dailyvol , "bipower" = apply(mR,1,'RBPCov') , 
                                           "medrv"   = apply(mR,1,'MedRV') ,
                                           "rv"      = apply(mR,1,'RV') ) 
     }
@@ -35,7 +35,7 @@
        mstdR = mR/estimdailyvol; 
        estimperiodicvol = diurnal( stddata = mstdR , method = periodicvol , dummies = dummies , P1 = P1 , P2 = P2 )[[1]]
        mfilteredR = mR/matrix( rep(estimperiodicvol,cDays) , byrow = T , nrow = cDays )
-       estimdailyvol = switch( dailyvol , "bipower" = apply(mfilteredR,1,'RBVar') , 
+       estimdailyvol = switch( dailyvol , "bipower" = apply(mfilteredR,1,'RBPCov') , 
                                           "medrv"   = apply(mfilteredR,1,'MedRV') ,
                                           "rv"      = apply(mfilteredR,1,'RV') )        
     }



More information about the Blotter-commits mailing list