We’re rewarding the question askers & reputations are being recalculated! Read more.
15

You have the correct approach. (1) The simulation generates sampled portfolio values, $P_1,P_2, \dots, P_n$ at time $t=T$. VaR is specified as a left-tail percentile. Order the sample as $$P_{(1)} \leq P_{(2)} \leq \dots \leq P_{(n)}.$$ If you are considering $VaR_\alpha$ at the $100(1-\alpha) \% $ confidence level , then choose the smallest integer $k$ ...


9

The problem of the selecting the best portfolio (according to some risk measure) with a limited number of assets can be formulated as a mixed integer linear or quadratic program and is reviewed in the recent paper "Portfolio selection problems in practice: a comparison between linear and quadratic optimization models". It can be solved for reasonable sizes ...


8

Portfolio optimalisation depends heavily on the estimation of the moments (and therefore has HUGE estimation uncertainty). Even though it's useful for comparing and analysing different existing strategies, I think practitioners are moving more towards the usage of factor portfolios for the strategies themselves (e.g. Fama-French). Also because the ...


7

We actually managed to come up with the answer to this question ourselves but wanted to share the answer since it might be relevant to others as well. The calculation depends on what method is used to calculate the cost. There is the FIFO, LIFO and the average cost method, see: http://www.accounting-basics-for-students.com/fifo-method.html If FIFO or LIFO ...


6

Specifically, we have a generic conditional claim, $C$, that is a function of the diffusion process for the underlying, $S(t)$, and time $t$ so $C = C(S(t), t)$. As you pointed out, $C$ is an Ito process becuase it is a function of a stochastic process so we use Ito's Lemma to determine how the contingent claim varies as a function of the diffusion process $...


6

You can use empirical distribution and use Mean-CVaR as a target function. CVar ("Expected shortfall") is considered a better risk metrics than VaR if we depart from the light-tailed normal distribution. The code below is in R and is taken from the book "Portfolio Optimization with R/Rmetrics" By Diethelm Wuertz, Yohan Chalabi, William Chen, Andrew Ellis. ...


6

Mean-variance (MV) is a framework rather than a prescription. This framework allows one to make, discuss, and defend his investment decision. In practice, there are many ways to make adjustments to this framework, if you believe they will improve performance. E.g. you can adjust the framework by stating "I will MV-optimize weights subject to "0" if the ...


6

In recent years there has been much attention given to defining indexes other than market-cap based indices. While market-cap based indices approximate the theoretical Market Portfolio enshrined in textbooks, some people believe we could do better than that. One popular idea is that "market indexes overweight the most overvalued stocks", though this is ...


6

The first step is to divide a very large number of stocks into deciles (groups having 10% of the stocks) based on some ranked measure (for example book to market or liquidity etc.), then you construct a spread of the highest decile vs the lowest decile returns by subtracting average D1 returns from average D10 returns. The idea is simply to understand how ...


6

Different portfolio risk decompositions answer different questions. Before discussing what method to use, first ask why you want a decomposition and what definition of risk are you using. Is the point to examine how portfolio return volatility is affected by a tiny change in portfolio weights? On the other hand, if the point is to make a statement like, "30%...


6

CAPM states that the expected return of any given asset should equal $ER_i=R_f+β_i (R_m-R_f)$, with α being the error term of the previous equation. Now, as α has an expected value of zero, then only way to achieve higher expected returns is taking on more β (given that $E[(R_m-R_f )]>0$). Every individual stock has some idiosyncratic risk in addition to ...


5

It doesn't make sense to use option price series data for computing option risk anyway. Since they are derivatives (i.e. their value is derived from other securities) it is more basic and reasonable to handle the underlying risks. As hinted by John, the risks to an option portfolio are generally considered in the context of inputs to a pricing model (which ...


5

7 years ago I had to solve the problem of a efficiency frontier under linear constraints on the asset weights and also stumbled upon Markowitz Critial Line Algorithm. I still have a directory with some resources in it. Since Bryce already gave a practical implementation with R code by Eric Zivot, I will concentrate on some papers which might help. I ...


5

If $\Sigma$ is the covariance matrix of all assets and $w$ is the column vector of weightings of the asset in a certain portfolio. Then $$ w^T \Sigma w = VAR $$ is the variance of the portfolio. The contribution to volatility of asset $i$ is given by $$ w_i (\Sigma w)_i/\sqrt{VAR}, $$ where $(\Sigma w)_i$ is the $i_{th}$ entry in the vector $\Sigma w$. Note ...


5

Of course estimating expected returns is the very core of portfolio management. Finding a useful covariance matrix too. To find both fills a book. So I first thought about closing the question. But it is a chance to discuss today's approaches. A nice approach that is very up-to-date where mementum investing seems very fashionable is the following: Momentum ...


5

We have weights $w_A$, $w_B$ and $w_C = 1 - w_A - w_B$ that sum to $1$. With de-meaned returns $r_A$, $r_B$, and $r_C$, the portfolio variance is $$E\{[w_A r_A + w_B r_B + (1 - w_A - w_B)r_C]^2 \} = w_A^2\sigma_A^2 + w_B^2\sigma_B^2 + 2 w_A w_B\rho_{AB}\sigma_A \sigma_B,$$ assuming the cash volatility $\sigma_C$ is zero.


5

You can generalize the formula from a portfolio composed of 2 assets to a portfolio composed of $N$ assets as follows : $$ \sigma^2_{port} = \sum_{i=1}^N \sum_{j=1}^N \omega_i \text{cov} (i,j)\omega_j = \sum_{i=1}^N \sum_{j=1}^N \omega_i \sigma_{i,j}\omega_j $$ where $\sigma_{port}$ represents the standard deviation of your portfolio. Taking $N = 2$ ...


4

You should be able to do this with the fitdistr function in the MASS package. You will certainly be able to hold the mean and variance constant, but I'm less sure about skewness and kurtosis (they would need to be arguments to the density function). The actuar package may also be useful, as it contains additional density functions.


4

If you only need to pick 5 out of 10 and want equal weights then just enumerate all 252 possibilities (as pointed out above) and compute the portfolio volatility $(\textbf{1}'K^{(i)}\textbf{1})^{1/2} = \left( \sum_{ij}K^{(i)}_{ij} \right)^{1/2}$, where $K^{(i)}$ is the covariance matrix for the $i$th subset. Then use whatever subset gives the lowest ...


4

Convex Optimisation - CVXOpt and CVXPy. Textbook by Boyd & Vandenberghe Aside from CVXOPT (known for its cone programming, see http://cvxopt.org/) with extensive documentation by the authors, Boyd and Vandenberghe http://stanford.edu/~boyd/cvxbook/, there is CVXPY which provides an easier front end. CVXPY was designed and implemented by Steven Diamond,...


4

I reproduced Ledoit and Wolf's experiment outlined in their paper "Honey I Shrunk the Covariance Matrix" in Python which includes an implementation of their method to shrink the covariance matrix (can be found here see the get_shrunk_covariance_matrix() method on line 417). All the code for the entire thing is on Github here. I make use of the cvxopt module ...


4

The Portfolio Analytics package of R is an excellent package that can perform non-parametric portfolio optimization: https://r-forge.r-project.org/R/?group_id=579


4

Let's start by replacing $\sigma$ by its estimator formula $\sigma^2=\frac{1}{n}\sum^n_{i=1}(x_i-\mu)^2$. Now, by replacing $\mu$ by its estimator $\mu=\frac{1}{n}\sum^n_{i=1}x_i$ in the formula for the variance we obtain: $\sigma^2=\frac{1}{2n^2}\sum^n_{j=1}\sum^n_{i=1}(x_i-x_j)^2$. For the individual asset, the variance will write $\sigma^2_s=\frac{1}{2n^...


4

I did not look at the data, but recall that beta is a parameter in the following equation: $$ r_A = \alpha + \beta r_B + \epsilon $$ relating two returns (random variables, samples) $r_A$ and $r_B$. To calculate beta you peform $$ \beta = \frac{cov(r_A,r_B)}{var(r_B)}. $$ Thus if assets $A$ and $B$ exchange roles, then only the denominator changes. In your ...


4

Actually, neither of your two results are quite correct. As explained in the Details for the Return.calculate function, most of the PerformanceAnalytics functions use discrete returns, not log returns. To get the correct results, you will have to convert your data from log returns to simple returns. Compare the charts from the following: charts....


4

Non overlapping periods would make for a far smaller sample


4

Theoretically speaking (as it's done in financial textbooks at b-school level), variance and covariance are calculated on historical performance of asset classes, forward looking returns are CAPM calculated returns. ARIMA. Practically speaking, ARIMA is useless for predicting long term returns (or portfolio management if you wish). Why? A short answer is ...


4

It is well known that the MV-optimal portfolio has some very bad properties in practice: Backtesting: The MV portfolio performs very bad in backtesting applications Diversification: The MV portfolio tends to invest all funds into the best asset (highest sharpe ratio) of the past, leading to very low diversification. Non-Normality: Return distributions are ...


4

Does variable $x$ forecast returns? Let's say you have some variable $x$ that you think forecasts returns, and you want to conduct statistical tests of a null hypothesis that $x$ has nothing to do with expected returns. Why a long-short portfolio? (quick answer) 1. It gives you a reasonable shot at detecting an effect. Imagine you have a stereo system ...


Only top voted, non community-wiki answers of a minimum length are eligible