pt.hismv: Mean-variance model with historical average returns and...

Description Usage Arguments Examples

View source: R/pt.hismv.R

Description

This function will perform portfolio simulation with historical average returns and standard deviatoins. Mean-variance model, or modern portfolio theory, is a mathmatical framework for accessing a portfolio. It uses the variance of asset returns as a risk proxy. This function will return a number of simulated portfolio with different weights.

Usage

1
pt.hismv(r,n,mini)

Arguments

r

:a data frame of asset returns

n

:number of portfolio simulated

mini

:minimal weight; choose 0 if long only; choose 1 for possible short position

Examples

1
2
3
4
5
set.seed(20)
rtn <- data.frame(runif(120,-1,1),runif(120,-1,1),runif(120,-1,1),runif(120,-1,1))
names(rtn) <- c("asset1","asset2","asset3","asset4")
portfolio <- pt.hismv(rtn,1000,0)
plot(portfolio[,6], portfolio[,5], xlab = "standart deviation", ylab = "expected return")

YRmisc documentation built on March 25, 2020, 5:13 p.m.

Related to pt.hismv in YRmisc...