variance_krv: Kernel Realized Variance

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/metrics.R

Description

Kernel Realized Variance (KRV) is an asymptotically consistent estimator of integrated volatility based on the concept of realized kernels for dealing with additive microstructure noise.

Usage

1
2
variance_krv(estimator,kernelName="ParzenKernel",bandwidth=1)
variance_krvRolling(estimator,kernelName="ParzenKernel",bandwidth=1,wLength=23400)

Arguments

estimator

Vector of (time, price) observations for market asset when external market data is used.

wLength

Length of a rolling window for rolling estimators. Default window length is 23400 (number of seconds in a trading day)

kernelName

Kernel name is one of the following (default:"ParzenKernel")

  • "BartlettKernel"

  • "EpanichnikovKernel"

  • "SecondOrderKernel"

  • "CubicKernel"

  • "ParzenKernel"

  • "TukeyHanningKernel"

  • "TukeyHanningModifiedKernel"

  • "FifthOrderKernel"

  • "SixthOrderKernel"

  • "SeventhOrderKernel"

  • "EighthOrderKernel"

bandwidth

"optimal" to compute optimal bandwidth from the data, or the value of bandwidth (default:1)

Details

Flat Top kernel types:

(Bartlett, Epanichnikov and Second order kernel)

- Convergence speed: m^{1/6} (m - number of observation)

- Accounts for additive noise: yes

- Accounts for finite price jumps: no

- Accounts for time dependence in noise: no

- Accounts for endogenous effects in noise: no

Non Flat Top kernel types:

(Cubic,Parzen,Tukey Hanning,Tukey Hanning modified and 5,6,7,8 order kernel)

- Convergence speed: m^{1/4} (m - number of observation)

- Accounts for additive noise: yes

- Accounts for finite price jumps: no

- Accounts for time dependence in noise: yes

- Accounts for endogenous effects in noise: yes

Value

a numeric vector of the same length as input data.

Author(s)

Kostin Andrey <andrey.kostin@portfolioeffect.com>

References

O.E.Barndorff-Nielsen, P.Reinhard Hansen, A.Lunde, and N.Shephard, "Designing realised kernels to measure the ex-post variation of equity prices in the presence of noise", Economics Series Working Papers 264, University of Oxford, Department of Economics, 2006.

See Also

variance_rv variance_tsrv variance_msrv variance_mrv variance_uzrv variance_jrmrv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 
## Not run: 
data(spy.data) 
estimator=estimator_create(priceData=spy.data)
estimator_settings(estimator,
				   inputSamplingInterval = '10s',
				   resultsSamplingInterval = '10s')
util_plot2d(variance_krv(estimator,kernelName="EpanichnikovKernel"),
title='KRV',legend='Simple')+
util_line2d(variance_krvRolling(estimator,kernelName="ParzenKernel",
wLength=3600),legend='Rolling Window')

## End(Not run)

PortfolioEffectEstim documentation built on May 2, 2019, 8:50 a.m.