[Blotter-commits] r328 - in pkg/RTAQ: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 12 23:04:26 CEST 2010


Author: jonathan
Date: 2010-04-12 23:04:26 +0200 (Mon, 12 Apr 2010)
New Revision: 328

Added:
   pkg/RTAQ/man/es.Rd
   pkg/RTAQ/man/gettradedir.Rd
   pkg/RTAQ/man/rs.Rd
   pkg/RTAQ/man/signed_trade_size.Rd
   pkg/RTAQ/man/signed_value_trade.Rd
   pkg/RTAQ/man/value_trade.Rd
Modified:
   pkg/RTAQ/R/volatility.R
   pkg/RTAQ/man/MedRV.Rd
   pkg/RTAQ/man/ROWCov.Rd
   pkg/RTAQ/man/ROWVar.Rd
Log:
revision kris + first part liquidity help files

Modified: pkg/RTAQ/R/volatility.R
===================================================================
--- pkg/RTAQ/R/volatility.R	2010-04-12 13:35:51 UTC (rev 327)
+++ pkg/RTAQ/R/volatility.R	2010-04-12 21:04:26 UTC (rev 328)
@@ -19,7 +19,7 @@
 
 
 ROWVar =
-function(data, seasadjR = NULL, wfunction = "HR" , alphaMCD = 0.5, alpha = 0.001) 
+function(data, seasadjR = NULL, wfunction = "HR" , alphaMCD = 0.75, alpha = 0.001) 
 {
     require(robustbase)
     if (is.null(seasadjR)) {
@@ -114,7 +114,7 @@
 
 
 ROWCov =
-function (data, seasadjR = NULL, wfunction = "HR" , alphaMCD = 0.5, alpha = 0.001) 
+function (data, seasadjR = NULL, wfunction = "HR" , alphaMCD = 0.75, alpha = 0.001) 
 {
     require(robustbase)
     if( is.null(dim(data) )){ 

Modified: pkg/RTAQ/man/MedRV.Rd
===================================================================
--- pkg/RTAQ/man/MedRV.Rd	2010-04-12 13:35:51 UTC (rev 327)
+++ pkg/RTAQ/man/MedRV.Rd	2010-04-12 21:04:26 UTC (rev 328)
@@ -25,6 +25,15 @@
 }
 
 \section{Details}{
+
+The MedRV belongs to the class of realized volatility measures in RTAQ 
+that use the series of high-frequency returns \eqn{r_{t,i}} of a day \eqn{t} 
+to produce an ex post estimate of the realized volatility of that day \eqn{t}. 
+MedRV is designed to be robust to price jumps. 
+The difference between RV and MedRV is an estimate of the realized jump 
+variability. Disentangling the continuous and jump components in RV 
+can lead to more precise volatility forecasts, 
+as shown in Andersen et al. (2007) and Corsi et al. (2008).
 }
 
 \value{
@@ -34,8 +43,15 @@
 \references{
 Andersen, T. G., D. Dobrev, and E. Schaumburg (2009). Jump-robust volatility 
 estimation using nearest neighbor truncation. NBER Working Paper No.
-15533.}
+15533.
 
+Andersen, T., T. Bollerslev, and F. Diebold (2007). Roughing it up: including
+jump components in the measurement, modelling and forecasting of return
+volatility. The Review of Economics and Statistics 89 (4), 701–720.
+
+Corsi, F., D. Pirino, and R. Renó (2008). Threshold Bipower Variation and the Impact of Jumps on Volatility Forecasting. Mimeo.
+}
+
 \author{ Jonathan Cornelissen and Kris Boudt}
 
 %cd C:\package\TradeAnalytics\pkg\RTAQ\man

Modified: pkg/RTAQ/man/ROWCov.Rd
===================================================================
--- pkg/RTAQ/man/ROWCov.Rd	2010-04-12 13:35:51 UTC (rev 327)
+++ pkg/RTAQ/man/ROWCov.Rd	2010-04-12 21:04:26 UTC (rev 328)
@@ -31,14 +31,17 @@
 return series over period \eqn{t}, with \eqn{M} observations during \eqn{t}.}
   \item{seasadjR}{ a \eqn{(M x N)} matrix/zoo/xts object containing 
 the seasonaly adjusted returns. This is an optional argument.}
-   \item{wfunction}{ determines whether a Hard Rejection ("HR") or 
+   \item{wfunction}{ determines whether 
+a zero-one weight function (one if no jump is detected based on \eqn{d_{t,i}} and 0 otherwise)
+or 
 Soft Rejection ("SR") weight function is to be used.
-By default a Hard Rejection (wfunction = "HR") function is used.}
+By default a zero-one weight function (wfunction = "HR") is used.}
    \item{alphaMCD}{ a numeric parameter, controlling the size of 
 the subsets over which the determinant is minimized. 
 Allowed values are between 0.5 and 1 and 
-the default is 0.75. See Boudt et al. (2008) or "?covMcd" in the robustbase package.}
-   \item{alpha}{ is a parameter between 0 and 1, 
+the default is 0.75. See Boudt et al. (2008) or the \code{covMcd} function in the
+robustbase package.}
+   \item{alpha}{ is a parameter between 0 en 0.5, 
 that determines the rejection threshold value 
 (see Boudt et al. (2008) for details).}
 }

Modified: pkg/RTAQ/man/ROWVar.Rd
===================================================================
--- pkg/RTAQ/man/ROWVar.Rd	2010-04-12 13:35:51 UTC (rev 327)
+++ pkg/RTAQ/man/ROWVar.Rd	2010-04-12 21:04:26 UTC (rev 328)
@@ -25,16 +25,18 @@
   \item{data}{ a vector/zoo/xts object containing all returns in period t for one asset. }
   \item{seasadjR}{ seasadjR is a matrix/zoo/xts object containing the seasonaly adjusted
 returns in period t for one asset. This is an optional argument.}
-  \item{wfunction}{ determines whether a Hard Rejection ("HR") or Soft Rejec-
-tion ("SR") weight function is to be used. By default a Hard Rejection
-(wfunction = "HR") function is used.}
+  \item{wfunction}{ determines whether 
+a zero-one weight function (one if no jump is detected based on \eqn{d_{t,i}} and 0 otherwise)
+or 
+Soft Rejection ("SR") weight function is to be used. 
+By default a zero-one weight function (wfunction = "HR") is used.}
   \item{alphaMCD}{
 a numeric parameter, controlling the size of the subsets over
 which the determinant is minimized. Allowed values are between 0.5 and
-1 and the default is 0.5. See Boudt et al. (2008) or the \code{covMcd} function in the
+1 and the default is 0.75. See Boudt et al. (2008) or the \code{covMcd} function in the
 robustbase package.
 }
-  \item{alpha}{a parameter between 0 and 1, that determines the rejection
+  \item{alpha}{a parameter between 0 en 0.5, that determines the rejection
 threshold value (see Boudt et al. (2008) for details).}
 }
 

Added: pkg/RTAQ/man/es.Rd
===================================================================
--- pkg/RTAQ/man/es.Rd	                        (rev 0)
+++ pkg/RTAQ/man/es.Rd	2010-04-12 21:04:26 UTC (rev 328)
@@ -0,0 +1,48 @@
+\name{es}
+\Rdversion{1.1}
+\alias{es}
+\title{
+Effective spread
+}
+
+\description{
+Function returns an xts object with the effective spread, defined as
+
+\deqn{
+\mbox{Effective Spread}_t =  2*D_t*(\mbox{PRICE}_{t} - \frac{(\mbox{BID}_{t}+\mbox{OFFER}_{t})}{2}),
+}
+
+where \eqn{D_t} is 1 (-1) if \eqn{trade_t} was buy (sell) (see Bhoehmer (2005), Bessembinder (2003)). 
+Note that the input of this function consists of the matched trades and quotes,
+ so this is were the time indication refers to (and thus not to the registered quote timestamp).
+}
+
+\usage{
+es(data);
+}
+
+\arguments{
+  \item{data}{ 
+xts object, containing joined trades and quotes (e.g. using \code{\link{matchtq()}})
+}
+}
+
+\section{Details}{
+}
+
+\value{
+an xts object containing the effective spread.
+}
+
+\references{
+Bessembinder, H. (2003). Issues in assessing trade execution costs. Journal of
+Financial Markets, 223-257.
+
+Boehmer, E. (2005). Dimensions of execution quality: Recent evidence for us
+equity markets. Journal of Financial Economics 78 (3), 553-582.
+}
+
+\author{ Jonathan Cornelissen and Kris Boudt}
+
+%cd C:\package\TradeAnalytics\pkg\RTAQ\man
+%R CMD Rdconv --type=html --output=sample_5minprices.htm sample_5minprices.Rd
\ No newline at end of file

Added: pkg/RTAQ/man/gettradedir.Rd
===================================================================
--- pkg/RTAQ/man/gettradedir.Rd	                        (rev 0)
+++ pkg/RTAQ/man/gettradedir.Rd	2010-04-12 21:04:26 UTC (rev 328)
@@ -0,0 +1,42 @@
+\name{gettradedir}
+\Rdversion{1.1}
+\alias{gettradedir}
+\title{
+Get trade direction
+}
+
+\description{
+Function returns a vector with the inferred trade direction which is 
+determined using the Lee and Ready algorithym (Lee and Ready, 1991). 
+}
+
+\usage{
+gettradedir(data);
+}
+
+\arguments{
+  \item{data}{ 
+xts object, containing joined trades and quotes (e.g. using \code{\link{matchtq()}})
+}
+}
+
+\section{Details}{
+NOTE: The value of the first (and second) observation of the output should be ignored if price=midpoint
+for the first (second) observation.
+}
+
+\value{
+A vector which has values 1 or (-1) if the inferred trade direction
+is buy or sell respectively.
+}
+
+\references{
+Lee, C. M. C. and M. J. Ready (1991). 
+Inferring trade direction from intraday
+data. Journal of Finance 46, 733-746.
+}
+
+\author{ Jonathan Cornelissen and Kris Boudt}
+
+%cd C:\package\TradeAnalytics\pkg\RTAQ\man
+%R CMD Rdconv --type=html --output=sample_5minprices.htm sample_5minprices.Rd
\ No newline at end of file

Added: pkg/RTAQ/man/rs.Rd
===================================================================
--- pkg/RTAQ/man/rs.Rd	                        (rev 0)
+++ pkg/RTAQ/man/rs.Rd	2010-04-12 21:04:26 UTC (rev 328)
@@ -0,0 +1,50 @@
+\name{rs}
+\Rdversion{1.1}
+\alias{rs}
+\title{
+Realized spread
+}
+
+\description{
+Function returns an xts object with the realized spread, defined as
+
+\deqn{
+\mbox{Realized Spread}_t =  2*D_t*(\mbox{PRICE}_{t} - \frac{(\mbox{BID}_{t+300}+\mbox{OFFER}_{t+300})}{2}),
+}
+
+where \eqn{D_t} is 1 (-1) if \eqn{trade_t} was buy (sell) (see Bhoehmer (2005), Bessembinder (2003)). 
+Note that the time indication of \eqn{\mbox{BID}} and \eqn{\mbox{OFFER}} refers 
+to the registered time of the quote in seconds.
+}
+
+\usage{
+rs(data,tdata,qdata);
+}
+
+\arguments{
+  \item{data}{ 
+xts object, containing joined trades and quotes (e.g. using \code{\link{matchtq()}})
+}
+  \item{tdata}{xts object, containing the trade data. See pdf documentation for more details.}
+  \item{qdata}{xts object, containing the quote data. See pdf documentation for more details.}
+}
+
+\section{Details}{
+}
+
+\value{
+an xts object containing the realized spread.
+}
+
+\references{
+Bessembinder, H. (2003). Issues in assessing trade execution costs. Journal of
+Financial Markets, 223-257.
+
+Boehmer, E. (2005). Dimensions of execution quality: Recent evidence for us
+equity markets. Journal of Financial Economics 78 (3), 553-582.
+}
+
+\author{ Jonathan Cornelissen and Kris Boudt}
+
+%cd C:\package\TradeAnalytics\pkg\RTAQ\man
+%R CMD Rdconv --type=html --output=sample_5minprices.htm sample_5minprices.Rd
\ No newline at end of file

Added: pkg/RTAQ/man/signed_trade_size.Rd
===================================================================
--- pkg/RTAQ/man/signed_trade_size.Rd	                        (rev 0)
+++ pkg/RTAQ/man/signed_trade_size.Rd	2010-04-12 21:04:26 UTC (rev 328)
@@ -0,0 +1,40 @@
+\name{signed_trade_size}
+\Rdversion{1.1}
+\alias{signed_trade_size}
+\title{
+Signed trade size
+}
+
+\description{
+Function returns an xts object with the signed trade size, defined as
+
+\deqn{
+\mbox{signed trade size}_t =  D_t * \mbox{SIZE}_{t},}
+
+where \eqn{D_t} is 1 (-1) if \eqn{trade_t} was buy (sell).
+}
+
+\usage{
+signed_trade_size(data)
+}
+
+\arguments{
+  \item{data}{ 
+xts object, containing joined trades and quotes (e.g. using \code{\link{matchtq()}})
+}
+}
+
+\section{Details}{
+}
+
+\value{
+an xts object containing the signed trade size.
+}
+
+\references{
+}
+
+\author{ Jonathan Cornelissen and Kris Boudt}
+
+%cd C:\package\TradeAnalytics\pkg\RTAQ\man
+%R CMD Rdconv --type=html --output=sample_5minprices.htm sample_5minprices.Rd
\ No newline at end of file

Added: pkg/RTAQ/man/signed_value_trade.Rd
===================================================================
--- pkg/RTAQ/man/signed_value_trade.Rd	                        (rev 0)
+++ pkg/RTAQ/man/signed_value_trade.Rd	2010-04-12 21:04:26 UTC (rev 328)
@@ -0,0 +1,46 @@
+\name{signed_value_trade}
+\Rdversion{1.1}
+\alias{signed_value_trade}
+\title{
+Signed trade value
+}
+
+\description{
+Function returns an xts object with the signed trade value, defined as
+
+\deqn{
+\mbox{signed trade value}_t =  D_t * (\mbox{SIZE}_{t}*\mbox{PRICE}_{t}),}
+
+where \eqn{D_t} is 1 (-1) if \eqn{trade_t} was buy (sell) 
+(see Bhoehmer (2005), Bessembinder (2003)).
+
+}
+\usage{
+signed_value_trade(data)
+}
+
+\arguments{
+  \item{data}{ 
+xts object, containing joined trades and quotes (e.g. using \code{\link{matchtq()}})
+}
+}
+
+\section{Details}{
+}
+
+\value{
+an xts object containing the signed trade value.
+}
+
+\references{
+Bessembinder, H. (2003). Issues in assessing trade execution costs. Journal of
+Financial Markets, 223-257.
+
+Boehmer, E. (2005). Dimensions of execution quality: Recent evidence for us
+equity markets. Journal of Financial Economics 78 (3), 553-582.
+}
+
+\author{ Jonathan Cornelissen and Kris Boudt}
+
+%cd C:\package\TradeAnalytics\pkg\RTAQ\man
+%R CMD Rdconv --type=html --output=sample_5minprices.htm sample_5minprices.Rd
\ No newline at end of file

Added: pkg/RTAQ/man/value_trade.Rd
===================================================================
--- pkg/RTAQ/man/value_trade.Rd	                        (rev 0)
+++ pkg/RTAQ/man/value_trade.Rd	2010-04-12 21:04:26 UTC (rev 328)
@@ -0,0 +1,40 @@
+\name{value_trade}
+\Rdversion{1.1}
+\alias{value_trade}
+\title{
+Trade value
+}
+
+\description{
+Function returns an xts object with the trade value, defined as
+
+\deqn{
+\mbox{trade value}_t =  \mbox{SIZE}_{t}*\mbox{PRICE}_{t}.
+}
+}
+
+\usage{
+value_trade(data);
+}
+
+\arguments{
+  \item{data}{ 
+xts object, containing the trade data, with at least a column "SIZE", indicating
+the transaction volume and a column "PRICE", indicating the transaction price.
+}
+}
+
+\section{Details}{
+}
+
+\value{
+an xts object containing the trade value.
+}
+
+\references{
+}
+
+\author{ Jonathan Cornelissen and Kris Boudt}
+
+%cd C:\package\TradeAnalytics\pkg\RTAQ\man
+%R CMD Rdconv --type=html --output=sample_5minprices.htm sample_5minprices.Rd
\ No newline at end of file



More information about the Blotter-commits mailing list