semivar: Semivariance hedge ratio

Description Usage Arguments Value Examples

View source: R/hedge.R

Description

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

Usage

1
semivar(v, w)

Arguments

v

length(WinLen x 1) price vector

w

length(WinLen x 1) column vector for weight

Value

semivariance of the input vector, returns a scalar

Examples

1
2
3
4
WinLen=15
w <- (matrix(1, WinLen, 1)) / WinLen
v <- matrix(runif(WinLen, min=0, max=10), WinLen, 1)
semivar(v,w) #return scalar

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