Learn R Programming

highfrequency (version 0.5.3)

rMarginal: Maginal Contribution to Realized Estimate

Description

Plots the marginal contribution to the realized estimate.

Usage

rMarginal(x, y = NULL, period,align.by="seconds", align.period = 1, 
  plotit = FALSE, cts = TRUE,makeReturns = FALSE)

Arguments

x

RealizedObject or TimeSeries for S+

y

RealizedObject or TimeSeries for S+

period

Sampling period

align.by

Align the tick data to seconds|minutes|hours

align.period

Align the returns to this period first

plotit

T for plot

cts

Create calendar time sampling if a non realizedObject is passed

makeReturns

Prices are passed make them into log returns

Value

Marginal contribution vector if plotit = F

Details

Plots the marginal contribution to the realized estimate. This is a good tool to determine what obersations are adding (possibly subtracting for covariance) to the estimate.

References

S. W. Payseur. A One Day Comparison of Realized Variance and Covariance Estimators. Working Paper: University of Washington, 2007

See Also

rAccumulation

Examples

Run this code
# NOT RUN {
data(sbux.xts)
par(mfrow=c(2,1))
plot(rCumSum(sbux.xts, period=10, align.by="seconds", align.period=60), 
   xlab="", ylab="Cumulative Ruturns", main="Starbucks (SBUX)",
    sub='20110701', type="p")
barplot(rMarginal(sbux.xts, period=10, align.by="seconds", align.period=60)$y,
    main="Marginal Contribution Plot") 
# }

Run the code above in your browser using DataLab