8

You seem to have two distinct problems: How to generate random portfolios How optimal portfolios are structured Ad 1) A straightforward way to simulate the weights of random portfolios is to use the Dirichlet distribution $Dir(\alpha_1,\ldots,\alpha_n)$. This is a distribution on the Simplex (i.e. on $S=\{x\in\mathbb{R}^n | \sum x_i =1, x_i\geq 0\}$, ...


6

Let $R$ be a random vector of risky returns and let $r_f$ denote the risk free rate. Let vector of expected returns $\boldsymbol{\mu} = \operatorname{E}[R]$ and covariance matrix $\Sigma = \operatorname{Cov}(R)$. The maximum Sharpe ratio portfolio among risky assets is called the tangency portfolio. Quick method to tangency portfolio Let's find the ...


6

To complement @skoestimeier's answer on the shortselling-allowed case, I provide a vectorised version. Using the original notation in my post (you may change $r$ to something like $r-r_f$, but this doesn't affect the algebraic structure). Our goal is to find the maximiser for the problem $$\max_{w}f(w):=\frac{w^T r}{(w^T\Sigma w)^{1/2}}.$$ Let $$\phi: w\...


5

The Kelly Criterion aims to maximise the expected value of the logarithm of terminal wealth. The derivation starts off by assuming that there is a risky asset that is following a Geometric Brownian Motion: $$ \frac{\,dS}{S} = \mu \,dt + \sigma \,dZ_t $$ This is combined with a riskless asset that is continuously compounding: $$ \frac{dB}{B} = r \,dt $$ ...


4

There are two cases, where short sales are allowed: With riskless lending and borrowing and without. As mentioned in the comments, you just have to solve a linear system. With riskless lending and borrowing The existence of a riskless lending and borrowing rate $r_f$ implies that there is a single portfolio of risky assets, that is preferred to all other ...


4

The Minimum Variance Portfolio (without constraints, other than the weights sum to one) is usually found as $$w=\frac{\Sigma^{-1} \iota}{\iota^T\Sigma^{-1} \iota}$$ where $\Sigma$ is the Covariance matrix and $\iota$ is a vector of all ones. However, there is another (equivalent) way to find it. Memmel and Kempf (2006) SSRN 940367 showed that you can find ...


4

Expected returns are very difficult to estimate reliably without incurring estimation error as found out by Merton (1980) "On estimating the expected return on the market". This is why estimating volatility/the covariance matrix has become the default approach in the mean-variance model because volatility is easier to predict than returns. Even the global ...


4

In the traditional academic model, the sum of absolute weights adds up to 1. The investor is assumed to have X (usually 100) to invest, some of which goes into cash versus "the market portfolio", of which some goes into bonds versus stock, of which some goes to this stock and some goes that stock etc. For any fund manager whose performance is measured and ...


3

If you are willing to switch to CVXPY, it comes with a pretty example of exactly this exercise: http://nbviewer.jupyter.org/github/cvxgrp/cvx_short_course/blob/master/applications/portfolio_optimization.ipynb


3

You cannot eliminate the dependence of a solution on the risk aversion parameter (which this author confusingly calls $\lambda$). Perhaps a source of confusion? Typically $\lambda$ is used to denote a Lagrange multiplier in Lagrangian optimization, but the author is using $\lambda$ as a risk tolerance parameter. (In your other linked question, $\lambda$ ...


3

This is a bit more complex than adding additional constraints. This is a well known problem in markowitz optimization - if you don't treat your covariance matrix and expected return vector with great care, markowitz will often spray your weights against the edges and result in a very non-diversified portfolio. I suggest robustly landscaping the literature - ...


3

**intended as a comment but not enough points to comment yet Order execution optimization: how to execute changes to your portfolio without suffering (too much) from implementation shortfall. Work of Almgren and Chris set a modern foundation of this space, and on top of that work of Jim Gatheral for closed form solution. In addition, consider if you're ...


3

Yes, it is easy to find the MDP of N risky assets if you have the covariance matrix V (assumed non-singular) if there are no constraints: Step 1. Compute the inverse of the covariance matrix: $CINV = V^{-1}$ Step 2. Find the standard deviations $\sigma$ by taking the square roots of the diagonal elemnts of $V$ Step 3. Find $X = CINV \times\sigma$ i.e. ...


3

Ok, I found a solution ! So, we are starting from $(x_i\sigma_i - x_j\sigma_j)((x_i\sigma_i + x_j\sigma_j)(1 - \rho) + \rho\sum_k x_k \sigma_k) = 0 $ and we will show that the elements in the second parenthesis is greater than $0$. We have: $(x_i\sigma_i + x_j\sigma_j)(1 - \rho) + \rho\sum_k x_k \sigma_k = (x_i\sigma_i + x_j\sigma_j) + \rho(\sum_k x_k \...


3

It would have been helpful had you provided links to those papers. But in general, you need to distinguish between the optimisation model, and the numerical technique used to solve the model. Suppose you wanted to estimate a linear regression, with the mean squared residual as the criterion of fit, and without further constraints. This is a model. Now you ...


2

Consider the equation of two variables (basically your obj func): $$f(x,y) = x^2 + y^2$$ The unconstrained minimisation is $x=y=0$. If you now constrain this sum to be equal to one, post optimisation, well it doesn't quite work since you multiply by infinity. But, even if the obj func was slightly different and it was finite it wouldn't return the minimum ...


2

The Fama/French (1993) paper is based on the widely used CRSP database, maintained by the University of Chicago's Booth School of Business. It provides data for NYSE-, AMEX-, and NASDAQ-listed securities from December 31, 1925 through the present. The CRSP database However, in the beginning only NYSE stocks are included in the database. In July 1962, 834 ...


2

Yes, two different set of returns can lead to the same weights (so you won't be able to prove the opposite). Also, the term "unique solution" means something different than how you used it. Taking $p$ and $Q$ as given, the mapping from $\boldsymbol{\mu}$ to solutions $\mathbf{x}^*$ is not injective I'll give a simple counterexample that shows the mapping ...


2

It will be inherently tied to your business goals. For example, if shorting a "bad ESG" stock is a goal of the portfolio, then the taking a weighted average, i.e. sum(position_size * IVA), where position sizes are allowed to be negative, will work as intended. This will allow the opt. engine to attempt to short as many "bad esg" stocks and long "good esg" ...


2

Assuming the $\epsilon_i$ are zero mean, you should find that $$ \mu - r_f = \beta \left(E[r_m] - r_f\right). $$ Further assuming the $\epsilon_i$ are independent of each other, though possibly with different variances, let $\Gamma$ be the diagonal matrix with the variances of $\epsilon_i$ on the diagonal. Then you are to find (under the more usual MVO ...


2

There are two transformations of the input data to be made to go from the first problem to the second: the $\hat{\mu}$ are found by subtracting the scalar $r_f$ from all the $\mu$ vector components: $$\hat{\mu}=\mu-r_f=(\mu_1-r_f,\mu_2-r_f,\cdots,\mu_N-r_f)^T$$ in other words the $\mu$ are returns and the $\hat\mu$ are "excess returns". the $\hat{A}$ ...


2

The scope of your question is quite unclear to me. You seem to mention trading. If you have multiple trading strategies (that you think are good, and reasonably uncorrelated) and you want to trade them as a portfolio, a commonly used criterion is to allocate capital to each strategy in proportion to the inverse of the strategy's standard deviation. So if ...


2

What does it mean that you will optime portfolio "without programming"? Does that mean that you will do calculations by hand??? Articles will not help you since every article you will be able find is based on optimization models in which market data will somehow be involved. That you cannot do "without programming". Maybe you should think about finding ...


2

Currency indices will require some base currency from which the other currencies weights will be determined. Also, the weights are determined as of some point in time and frequency, and are based on some economic statistic, such as the share of international trade, that reflects their relative importance in the global economy. Other possibilities could be ...


2

The tangent portfolio is the optimal portfolio of risk assets. So under the Modern portfolio theory world, all investors will buy and hold this portfolio if they want to make an investment in risky assets. The point where indifference curve and the CAL meets tells how much of your wealth would be invested in (1) the risk-free asset and (2) the optimal ...


2

Regularisation means that you impose structure on your problem; structure that could not be recognised from the data sample alone. In the context of mean-variance optimisation, regularisation is mostly discussed when people estimate quantities from historical data (e.g. variances) and plug them into their objective function. (However, the term "...


2

In your other post's Python code, you already have the sample covariance matrix as: cov_matrix = returns.cov() To also get the covariance used by ridge regression, put on the next line: cov_ridge = cov_matrix + lamda*np.eye(N) The second term increases the values along the diagonal of cov_matrix, using a $\lambda$ (lamda) regularization factor for ...


2

Without knowing the exact data behind your code, it is hard to say exactly where the error may be. However, DCP errors seem to be thrown when the underlying equation is not convex - and therefore unable to minimize. Here is a great resource for troubleshooting. It walks through an example of discovering whether a specific problem is convex and/or where it ...


2

Note that the solution to the problem is the same with or without the $\frac{1}{2}$, since multiplying it only changes the value of the objective function, but not where its extrema are located. The "$-$" comes from the fact that you switched it from a minimization problem to a maximization problem. The reason behind the choice of $\frac{1}{2}$ simply makes ...


2

Have you seen Financial Risk Modelling and Portfolio Optimization with R by Bernhard Pfaff?


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