Learn R Programming

PortfolioEffectEstim (version 1.4)

variance_krv: Kernel Realized Variance

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

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)

Value

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

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

Run this code
## 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)

Run the code above in your browser using DataLab