Skip to content

Instantly share code, notes, and snippets.

View bestdan's full-sized avatar

Daniel P. Egan bestdan

View GitHub Profile
@bestdan
bestdan / effFrontier_v1.R
Last active December 11, 2015 21:58
efficientFrontier_v1.R
effFrontier = function (data, nports = 20, shorts=T,wmin=0, wmax=1)
{
rcov<-cov(data)
averet<-colMeans(data)
mxret = max((colMeans(data)))
mnret = 0#-mxret Long only...
n.assets = ncol(data)
reshigh = rep(wmax,n.assets)
if( shorts )
{