Path: blob/master/sandbox/optimization-vignette.Rnw
1433 views
%1\documentclass[12pt,letterpaper,english]{article}2\usepackage[OT1]{fontenc}3\usepackage{Sweave}4\begin{document}56\title{Portfolio Optimization with \pkg{optimizer}}7\author{Peter Carl \& Brian G. Peterson}89\makeatletter10\makeatother11\maketitle1213\begin{abstract}14This vignette describes the steps used to optimize a portfolio of financial assets.15\end{abstract}1617\tableofcontents1819\section{Introduction}2021<<LoadLibrary,echo=F,results=hide>>=22library('optimizer') # also loads PerformanceAnalytics, etc.23@2425\section{Getting Started}26\subsection{Load and review data}27Describe the data. Zero fill the data where necessary. discuss the tradeoffs with zero filling and speed.28%29\begin{figure}30\caption{First Lines of the managers Object }31\label{fig:First-Lines-of}32<<LoadData,echo=T>>=33data(edhec)34#managers=read.csv("/home/peter/dev/R/managers.csv",row.names=1)35head(managers)36@37\end{figure}3839\subsection{Select an optimizer}404142\section{Unconstrained mean-variance optimization}4344\section{Adding constraints}4546\subsection{Adding portfolio constraints}4748\subsection{Adding per-asset weight constraints}4950\section{Value-at-Risk and Expected Shortfall}5152\section{Optimization with higher moments}535455\end{document}565758