TangencyQP: Calculate Tangency Portfolio Weight based on Quadratic...

Description Usage Arguments Value Author(s) Examples

Description

Compute the tangency portfolio weight which maximizes sharpe ratio based on Quadratic Programming Algorithm. Short sale constraint could be used. Lower and upper bound for each asset could not be implemented by this function. Please refer to 'TangencySQ' to implement lower and upper boundary for weight.

Usage

1
TangencyQP(ret, covmat, short = TRUE, rf = 0, freq)

Arguments

ret

a vector stores mean return of assets (N x 1). A vector should store daily, monthly or quarterly return.

covmat

a matrix stores covariance matrix of asset returns. A matrix should be scaled by daily, monthly or quarterly return alligned with 'ret' vector.

short

a boolean stores TRUE for short sale constraint or FALSE for no constraint

rf

a scalar store annualized risk free rate

freq

a string stores frequency used by ret and covmat. It should be "daily", "monthly" or "quarterly"

Value

Return a list with the following slots

TangencyWeight

A vector of asset weights

portfolioret

A scalar of tangency portfolio return (annualized)

portfoliosd

A scalar of tangency portfolio standard deviation (annualized)

sharpeRatio

A scalar of sharpe ratio of tangency portfolio (annualized)

Author(s)

Thanh Nguyen Minh

Examples

1
2
3
4
data(dataset1)
mean_return <- apply(dataset1[,-1], MARGIN=2, mean)
cov_matrix <- cov(dataset1[,-1])
result <- TangencyQP(mean_return, cov_matrix, short=TRUE, rf=0.07, freq="monthly")

thanhuwe8/quantport documentation built on June 10, 2019, 5:53 a.m.