mvhr: minimum variance hedge ratio function

Description Usage Arguments Value Examples

View source: R/hedge.R

Description

This function will calculate the single commodity hedge ratio by minimizing the variance of the returns.

Usage

1
mvhr(x, WinLen)

Arguments

x

(n x 2) matrix of input that consists of spot price in the first column and futures prices in the second column.

WinLen

Length of window

Value

(list(HR = HR, HE = HE))

HR

Length(nWin x 1) optimal hedge ratio matrix

HE

Length(nWin x 1) hedging effectiveness matrix

Examples

1
2
3
4
5
6
data(fx)
spot_price = fx$...1
futures_price = fx$...2
x = cbind(spot_price, futures_price)
Winlen <- 15
mvhr(x, Winlen)

sieunyi/Hedge documentation built on Dec. 23, 2021, 2:20 a.m.