Knight-Satchell-Tran’s Moving Average Crossover Model, 1995

Knight-Satchell-Tran’s Moving Average Crossover Model, 1995

The paper describes a model for (daily) financial asset returns. The model assumes a two state Markov chain: UP (positive returns; up trend) and DOWN (negative returns; down trend). Imposed on each state is a separate ​Gamma distribution of returns.

The model parameters essentially measure

  1. the persistence of a trend
  2. the average size of returns

This advantages of this regime switching model are:

  1. asymmetric positive and negative returns
  2. heavy tails

Assuming this particular model, we can compute the expected P&L (and other statistics) of playing two moving average crossover (trend following) strategies:

  1. GMA(2, 1)
  2. GMA(∞, 1)

It turns out that for GMA(2, 1) to make money, say off UP trend, the up trend needs to be persistent enough or the average size needs to be big enough. There are exact formulas to quantify these two conditions.

Surprisingly, GMA(∞, 1) is expected to lose money always.

One qualitative conclusion to make is: for a linear trading rule (in prices or returns), such as moving average crossover, we in general prefer to use a small amount of data points rather than all available information.

References

​http://www.tandfonline.com/doi/abs/10.1080/13504869500000009#preview

​http://www.amazon.com/Advanced-Trading-Second-Quantitative-Finance/dp/075065516X

​http://numericalmethod.com/papers/course1/lecture6.pdf

Code

http://redmine.numericalmethod.com/projects/public/repository/svn-algoquant/show/core/src/main/java/com/numericalmethod/algoquant/model/kst1995

http://redmine.numericalmethod.com/projects/public/repository/svn-algoquant/show/core/src/main/java/com/numericalmethod/algoquant/model/signal

Trading Models

Trading Models

NM FinTech Inc. has coded up a number of quantitative trading models.

Profitability Factors

Net Income Margin

The net income margin measures the portion of net income or profit is generated as a percentage of revenue.

net income margin (net_mgn) = (net income – extraordinary items and discontinued operations) / revenue*100
net income margin TTM (net_mgn_ttm) = (net income – extraordinary items and discontinued operations) 12 month average / revenue 12 month average *100
Revenue MUST be POSITIVE.

Gross Income Margin

Gross income margin is a profitability ratio that measures how much revenues is left over after paying cost of goods sold (COGS). Gross profit margin is calculated by subtracting cost of goods sold (COGS) from total revenue and dividing that number by total revenue.

Gross income margin (gross_mgn) = (revenue – cost of goods sold) / revenue*100
Gross income margin TTM (gross_mgn_ttm) = (revenue ttm – cost of goods sold ttm) / revenue 12 month average *100
Revenue MUST be POSITIVE.

Pretax Margin

Pretax Margin measure the operating efficiency of a company by telling the percentage of sales that has turned into profits.

Pretax Margin (ptx_mgn) = pretax income / revenue *100
Pretax Margin TTM (ptx_mgn_ttm) = pretax income 12 month average / revenue 12 month average *100
Revenue MUST be POSITIVE.

Gross Profits to Assets Ratio

Gross Profits to Assets Ratio is a profitability ratio to measure the productivity of the company’s assets.

Gross Profits to Assets Ratio (gross_assets) = (revenue – cost of goods sold) / assets*100
Gross Profits to Assets Ratio TTM (gross_assets_ttm) = (revenue ttm – cost of goods sold ttm) / assets *100
Assets MUST be POSITIVE.

Gross Profits to Lagged Assets Ratio

Gross Profits to Lagged Assets Ratio is similar to Gross Profits to Assets Ratio. It used pervious quarter assets as denominator since the profits was created under the assets in previous period.

Gross Profits to Lagged Assets Ratio (gross_lag_assets) = (revenue – cost of goods sold) / assets in quarter t-1 *100
Gross Profits to Lagged Assets Ratio TTM (gross_lag_assets_ttm) = (revenue ttm – cost of goods sold ttm) / assets in quarter t-1 *100

EBITDA (Operating Profit Before Depreciation) Margin

EBITDA (Operating Profit Before Depreciation) margin is a profitability ratio that measures how much earnings the company is generating before interest, taxes, depreciation, and amortization, as a percentage of revenue.

EBITDA margin (opdb_mgn) = Operating Profit Before Depreciation / revenue *100
EBITDA margin TTM (opdb_mgn_ttm) = Operating Profit Before Depreciation 12 month average / revenue 12 month average *100
Revenue MUST be POSITIVE.

EBIT (Operating Profit After Depreciation) Margin

EBIT (Operating Profit After Depreciation) margin is a financial ratio that measures the profitability of a company calculated without taking into account the effect of interest and taxes.

EBIT margin (opad_mgn) = Operating Profit After Depreciation 12 month average / revenue 12 month average *100
EBIT margin TTM (opad_mgn_ttm) = Operating Profit After Depreciation 12 month average / revenue 12 month average *100
Revenue MUST be POSITIVE.

Cash Flow Margin

Cash Flow Margin profitability ratio that measures how well a company can convert sales into cash.

Cash Flow Margin (cf_mgn) = (net income – extraordinary items and discontinued operations + depreciation and amortization) / revenue *100
Cash Flow Margin TTM (cf_mgn_ttm) = (net income – extraordinary items and discontinued operations + depreciation and amortization) 12 month average / revenue 12 month average *100
Revenue MUST be POSITIVE.

Cash Flow to Assets Ratio

Cash Flow to Assets Ratio is an efficiency ratio that rates actually cash flows to the company assets without being affected by income recognition or income measurements.

Cash Flow to Assets Ratio (cf_assets) = (net income – extraordinary items and discontinued operations + depreciation and amortization) /assets*100
Cash Flow to Assets Ratio TTM (cf_assets_ttm) = (net income – extraordinary items and discontinued operations + depreciation and amortization) 12 month average /assets *100
Assets MUST be POSITIVE.

Cash Flow to Lagged Assets Ratio

Cash Flow to Lagged Assets Ratio is similar to Cash Flow to Assets Ratio. Instead of using same period assets as denominator, this ratio use cash flow scaled by previous assets.

Cash Flow to Lagged Assets Ratio (cf_lag_assets) = (net income – extraordinary items and discontinued operations + depreciation and amortization) /assets in quarter t-1 *100
Cash Flow to Lagged Assets Ratio TTM (cf_lag_assets_ttm) = (net income – extraordinary items and discontinued operations + depreciation and amortization) 12 month average / assets in quarter t-1 *100
Assets MUST be POSITIVE.

Return on Assets

Return on assets is a financial ratio that shows how efficient a company’s management is at using its assets to generate earnings. We will use the average of current and previous quarter’s assets as denominator.

Return on assets (roa) = (net income – extraordinary items and discontinued operations) / ((assets + assets in quarter t-1)/2)*100
Return on assets TTM (roa_ttm) = (net income – extraordinary items and discontinued operations) 12 month average / ((assets + assets in quarter t-1)/2)*100
Assets MUST be POSITIVE.

Return on Equity

Return on equity is a measure of financial performance calculated by dividing net income by shareholders’ equity. The ratio is considered a measure of how effectively management is using a company’s assets to create profits. We will use the average of current and previous quarter’s equity as denominator.

Return on equity (roe) = (net income – extraordinary items and discontinued operations) / ((equity + equity in quarter t-1 )/2)*100
Return on equity TTM (roe_ttm) = (net income – extraordinary items and discontinued operations) 12 month average/ ((equity + equity in quarter t-1 )/2)*100
Equity MUST be POSITIVE.

Return on Net Operating Assets

Return on Net Operating Assets is a financial ratio used by analysts to evaluate company performance. The ratio shows how well a company and its management are deploying assets in economically valuable ways. We will use the average of current and previous net operating assets as denominator.

Net operating assets (noa) = (assets – cash and short-term investments) – (liabilities – debt)
Return on Net Operating Assets (rnoa) = (net income – extraordinary items and discontinued operations) / ((noa + noa in quarter t-1)/2) *100
Noa MUST be POSITIVE.

Operating Profits to Equity Ratio

Operating Profits to Equity Ratio measure operating profitability as total revenue minus cost of goods sold minus selling, general, and administrative expenses and minus interest expense scaled by book equity.

Operating profit for equity (op) = revenue – cost of goods sold – selling, general and administrative expenses – interest expense
Operating Profits to Equity Ratio (op_equity) = operating profit / equity *100
Operating Profits to Equity Ratio TTM (op_equity_ttm) = operating profit 12 month average / equity *100
Equity MUST be POSITIVE.

Operating Profits to Lagged Equity Ratio

Operating Profits to Lagged Equity Ratio is similar to Operating Profits to Equity Ratio. We will use previous quarter equity as denominator.

Operating profit for equity (op) = revenue – cost of goods sold – selling, general and administrative expenses – interest expense
Operating Profits to Lagged Equity Ratio (op_lag_equity) = operating profit / equity in quarter t-1 *100
Operating Profits to Lagged Equity Ratio TTM (op_lag_equity_ttm) = operating profit 12 month average / equity in quarter t-1 *100
Equity MUST be POSITIVE.

Operating Profits to Assets Ratio

Operating Profits to Assets Ratio calculated as total revenue minus cost of goods sold minus selling, general, and administrative expenses and plus research and development expenditures scaled by book assets.

Operating profitability for assets (op) = revenue – cost of goods sold – selling, general and administrative expenses + research & development expense
Operating Profits to Assets Ratio (op_assets) = operating profit / assets *100
Operating Profits to Assets Ratio TTM (op_assets_ttm) = operating profit 12 month average / assets *100
Assets MUST be POSITIVE.

Operating Profits to Lagged Assets Ratio

Operating Profits to Lagged Assets Ratio is similar to Operating Profits to Assets Ratio. We will use previous quarter assets as denominator.

Operating profit for equity (op) = revenue – cost of goods sold – selling, general and administrative expenses + research & development expense
Operating Profits to Lagged Assets Ratio (op_lag_equity) = operating profit / assets in quarter t-1 *100
Operating Profits to Lagged Assets Ratio TTM (op_lag_equity_ttm) = operating profit 12 month average / assets in quarter t-1 *100
Assets MUST be POSITIVE.

Cash-Based Operating Profits for Assets to Assets Ratio

Operating profitability better explains the cross section of expected returns compares to gross profitability and net income. However, some firms are more profitable only because of an increase in the non-cash portion of earnings. Thus, cash-based operating profitability, which purging accruals from operating profitability, will be an effective indicator of company’s profitability that subsumes the accrual anomaly.

Cash-based operating profitability for assets (cbopa) = revenue – cost of goods sold – other selling, general & administrative expense – change in revenue – change in inventory + change in deferred revenue + change in accounts payable
Cash-Based Operating Profits for Assets to Assets Ratio (cbopa_assets) = cbopa / assets *100
Cash-Based Operating Profits for Assets to Assets Ratio TTM (cbopa_assets_ttm) = cbopa 12 month average / assets *100
Assets MUST be POSITIVE.

Operating Leverage (Operating Costs to Assets Ratio)

In operating leverage hypothesis, firm’s value consists of currently deployed asset(Va) and growth options(Vg). The value of deployed assets consists of the capitalized value of the revenues(Vr) they generate minus the capitalized cost(Vc) of operating the assets. While growth options are almost always riskier than revenues from deployed capital in real options models, the presence of operating costs allows for deployed assets that are riskier than growth options. Operating costs-to-assets can be used as proxy for operating leverage(Vc/Vr). The hypothesis predicts that high operating leverage firms earn higher returns, because their assets-in-place are more levered,and thus riskier.

Operating Costs to Assets Ratio (oc_assets) = (cost of goods sold + selling, general and administrative expenses) / assets *100
Assets MUST be POSITIVE.

 

SOCP Algorithm

SOCP Algorithm

One shortcoming of the Markowitz model is that it considers separate uncertainty sets for the expected return vector \(\boldsymbol\mu\) and for the covariance matrix \(\boldsymbol \Sigma\). As a result, the probability measure with the minimized mean is different from the probability measure with the maximized second moment. In general, this is not the case. Under such circumstances,  SOCP algorithm is provided.

Scholars propose a robust portfolio optimization and selection model using a conic programming approach which can be applied to the mean-variance framework. Second-order cone programming (SOCP) minimizes or maximizes a linear function problem at the intersection of an affine space and a Cartesian product of a finite number of second-order cones. 

Math Forms

A standard second-order cone programming problem can be expressed as the following forms:

\(min \quad c_1^T x_1 + c_2^T x_2 +\cdots + c_r^T x_r\) 

\(s.t. \quad A_1 x_1+A_2 x_2 + \cdots + A_r x_r  \qquad x_i \in \mathcal\kappa^{n_i} \quad i=1,2,\cdots,r\)

Note that \(A_i \in \mathcal{R}^{m \times n_i}, c_i \in \mathcal{R}^{n_i} , b \in \mathcal{R}^m\) are known data, and \(n_1 + n_2 + \cdots +n_r=n,  x_i \in \mathcal\kappa^{n_i}\) are decision variables. \(\mathcal\kappa^{n_i}\)latex is n-dimensional second-order core(SOC) with definitions below:

\(\mathcal\kappa^{n_i}=\{(x_{i1};x_{i2}|x_{x1} \in \mathcal{R}, x_{i2}\in \mathcal{R}^{n_1-1}) |x_{i1} \geq \parallel x_{i2} \parallel \} \)

The expected return lies in the confidence region represented by the ellipsoid \((\hat{x_\varepsilon} – \hat{x_t})^T {\Sigma_\varepsilon}^{-1} (\hat{x_\varepsilon} – \hat{x_t}) \leq k^2 \), generated by estimated expected returns \(\hat{x_\varepsilon\) and covariance matrix \(\Sigma_\varepsilon\) of the estimates of expected returns with probability \(\eta\). And \(k^2 ={\chi_n}^2 (1- \eta) ,{\chi_n}^2\) is the inverse cumulative distribution function of the chi-squared distribution with n degrees of freedom. For a fixed portfolio, the target is:

\(\underset{\hat{x_\varepsilon} – \hat{x_t}}{max} {(\hat{x_\varepsilon} – \hat{x_t})^T \hat{\omega}} \)

\((\hat{x_\varepsilon} – \hat{x_t})^T {\Sigma_\varepsilon}^{-1} (\hat{x_\varepsilon} – \hat{x_t}) \leq k^2 \)

By constructing the Lagrangian of the above formula, it is straightforward to obtain \(\hat{x_t}^T \hat{\omega}=\hat{x_\varepsilon}^T \hat{\omega}-k\parallel {\Sigma_\varepsilon}^{1/2}\hat{\omega} \parallel\). The problem now becomes the robust portfolio selection problem given below:

\(\underset{\omega \in \mathcal{R}^n }{max} {\hat{x_\varepsilon}^T} \omega-k\parallel {\Sigma_\varepsilon}^{1/2}\omega \parallel \)

\(s.t. \omega^T \Sigma \omega \leq \gamma^2\)

\(\omega \in \overline{W} =\{\omega \in \mathcal{R}^n|\sum_{i=1}^n\omega_i=1,\omega\geq 0\}\)

Furthermore, this problem can be straightforwardly written as a second-order cone programming (SOCP) problem:

\(\underset{\omega \in \mathcal{R}^n}{max} \quad\hat{x_\varepsilon}^T\omega-kt\)

\begin{equation}
s.t. \left\{
\begin{array}{**rcl**}
\omega &\in &W \\
\gamma &\geq& \parallel \Sigma^{1/2} \omega \parallel \\
t &\geq& \parallel {\Sigma_\varepsilon}^{1/2} \omega \parallel 
\end{array}
\right.
\end{equation}


Configuration of parameters

For estimation of returns:

  • Sample Mean

  • Equal Mean

  • Linear Shrinkage

For estimation of covariance:

  • Sample Covariance

  • Equal Correlation

  • Linear Shrinkage

  • Nonlinear Shrinkage

Optional Constraints

  • Position Limits

  • Market Impact

  • Block List

  • Max Loan

References

[1] 戴志锋;文凤华;李董辉,鲁棒均值一半绝对偏差投资组合优化模型, 系统工程,2012, Vol.30(10), pp.28-35

[2] Lobo M S,Boyd S.The worst—case risk of a portfolio,Technical Report[z]. 2000

[3] Tutuncu R H,Koenig M.Robust asset allocation [J].Annals of Operations Research,2004,132:157~187

[4] Goldfarb D,Iyengar G.Robust portfolio selection problems[J].Mathematics of Operations Research,2003,28:1~ 38.

[5] 房亮. 二阶锥规划和二阶锥互补问题的算法研究[D].上海交通大学,2010.

Sample Mean

Sample Mean

One way to get the sample mean is to use the arithmetic mean return of historical stock data and estimate stock’s future return. This method assumes the the stock’s future return will stay the same as its past return.


Although sample mean of return is simple to be calculated and understood, it can be extremely affected by outliner data. In our system, we fix this issue by using the mean of the sample data (returns) within the estimation window. The distribution of stock’s return often changes with time.

Math Form

\(r_i = \frac{\sum_{i=1}^mr_{ij}}{m} \)

Sample Covariance

Sample Covariance

Just as Sample Mean for the estimation of returns, the method of using sample data’s covariance within the estimation window for estimation is called sample covariance.

Math Form

\(\Sigma = (\Sigma_{ij})\)

\(\Sigma_{ij} = \frac{1}{m-1} \sum_{k=1}^m(r_{ik}-r_i)(r_{jk}-r_j) \)

 

Optional Constraints

Optional Constraints

Position Limits

Position limits means the allowed minimum and maximum weight for any given assets. 

e.g. If you set minimum weight as 0, then short selling will not be allowed.

# default value

Market Impact

Market impact describes the impact of investments to the market, which means, your investment weight vector \(\mathbf{\omega}\) can influence expected return vector \(\mathbf{r}\). We use non-linear model to depict this relationship, which is \(r_i^* = r_i – \theta_i \sqrt{ \omega_i}\) where \(\theta_i\) s are square root impact coefficients and larger it is, larger impact the corresponding asset has on the market.

Block List

Weights of black-listed assets will not be changed during transactions.

Max Loan

In practice, some asset can gain loans. In this way ,we use max load to decide the minimal allowed weight of asset during transactions.

e.g. If you set max loan as 0.3, then the weight of asset can be at least -0.3.

Nonlinear Shrinkage

Nonlinear Shrinkage

Many statistical applications require an estimate of a covariance matrix and/or of its inverse when the matrix dimension, p, is large compared to the sample size, n.

A cursory glance at the Marˇcenko and Pastur (1967) equation shows that linear shrinkage is the first-order approximation to a fundamentally nonlinear problem. How good is this approximation? Ledoit and Wolf (2004) are very clear about this. Depending on the situation at hand, the improvement over the sample covariance matrix can either be gigantic or minuscule. When \(\frac{p}{n} \) is large, and the population eigenvalues are close to one another, linear shrinkage captures most of the potential improvement over the sample covariance matrix. In the opposite case, that is, when \(\frac{p}{n} \)is small and the population eigenvalues are dispersed, linear shrinkage hardly improves at all over the sample covariance matrix.

What can nonlinear shrinkage do?

The goal of solving covariance matrix is to find estimators that outperform the sample covariance matrix, both in finite samples and asymptotically. For the purposes of asymptotic analyses, to reflect the fact that p is large compared to n, one has to employ large-dimensional asymptotics where p is allowed to go to infinity together with n. And this is how nonlinear shrinkage works.

Further Discussion

The estimation of covariance matrix can be divided into case \(pn\)

More details can be see at Spectrum estimation: A Unified Framework for Covariance Matrix Estimation and PCA in Large Dimensions.

References

O. Ledoit, M. Wolf, Nonlinear shrinkage estimation of large-dimensional covariance matrices, Ann. Statist. 40 (2) (2012) 1024–1060.

Markowitz Algorithm

Markowitz Algorithm

Modern portfolio theory (also called Markowitz model or mean-variance model) was introduced in a 1952 essay by Harry Markowitz, the Nobel Prize winner in Economics in 1990. It assumes that an investor wants to maximize a portfolio’s expected return contingent on any given amount of risk. For portfolios that meet this criterion, known as efficient portfolios, achieving a higher expected return requires taking on more risk, so investors are faced with a trade-off between risk and expected return. The investment decision is not merely which security to own, but how weight to own.

Math Forms

Let \(\mu \)= Expected returns on portfolio, \(r_i \)= Returns on asset i, \(\omega_i \) =Weight of component asset i, and \(\sigma_i \)=Standard deviation of asset i.

To simplify the above expression, introducing \(\Sigma\)to represent the covariance matrix. In this way, the optimization problem can be concluded to the following format with matrix form:

\(min \frac{1}{2} \mathbf{\omega}^\mathrm{T} \Sigma \mathbf{\omega} , s.t. \mathbf{\omega}^\mathrm{T} \mathbf{r}= \mu, \mathbf{\omega}^\mathrm{T} \mathbf{e} = 1 \)

In order to solve the above quadratic linear programming problem, the Lagrange Multiplier Method can be used. And finally, we gain the relationship between the investment ratio of various securities and the expected rate of return as follows:

\begin{array}{**rcl**}
      w &=&g + h \mu\\
      g &=& \frac{1}{D} (B \Sigma^\mathrm{-1} e – A \Sigma^\mathrm{-1} r)\\
      h &=& \frac{1}{D} (C \Sigma^\mathrm{-1} r – A  \Sigma^\mathrm{-1} e)
\end{array}

A, B, C, D are all constants, and the values are all affected by the returns and variances of each asset in the portfolio:

\(A=\mathbf{e}^\mathrm{T} \Sigma^\mathrm{-1} \mathbf{r} = \mathbf{r}^\mathrm{T} \Sigma^\mathrm{-1} \mathbf{e} , B = \mathbf{r}^\mathrm{T} \Sigma^\mathrm{-1} \mathbf{r}, C = \mathbf{e}^\mathrm{T} \Sigma^\mathrm{-1} \mathbf{e}, D = BC-A^2\)

Under the given conditions for the type of securities, investors can get unlimited kinds of products through different combinations of risks and returns. The portfolio effective frontier curve reflects the investment at a given level of expected returns, the smallest variance a portfolio can reach. For rational investors, the frontier portfolio can reach its investment to maximize the utility, and the equation of the effective frontier curve of the portfolio is as follows:

\(\sigma^2 = \frac{C}{D} (\mu – \frac{A}{C})^2 +\frac{1}{C} \)

Configuration of parameters

For estimation of returns:

  • Sample Mean
  • Equal Mean
  • Linear Shrinkage

For estimation of covariance:

  • Sample Covariance
  • Equal Correlation
  • Linear Shrinkage
  • Nonlinear Shrinkage

Optional Constraints

  • Position Limits

References

[1] Markowitz, H.M. (March 1952). “Portfolio Selection”The Journal of Finance7(1): 77–91.

[2] Markowitz, H.M. (1959). Portfolio Selection: Efficient Diversification of Investments. New York: John Wiley & Sons. (reprinted by Yale University Press, 1970

[3] Abhijit. Ravipati Rutgers The State University of New Jersey – New Brunswick. Graduate School – New Brunswick. 2012, Masters Abstracts International 50-05.

[4] 张贺清. 均值和方差变动的马科维茨投资组合模型研究[D].哈尔滨工业大学,2015.

[5] Mandelbrot B.Paretian  Distributions and Income Maximization.  Quarterly Journal of Economics, 1962, (76): 57-85.

[6] Cont R. Empirical Properties of Asset Returns: Stylized Facts and Statistical Issues. Quantitative Finance, 2001, 1(2): 223-236.

Linear Shrinkage

Linear Shrinkage

Linear Shrinkage can be used in both estimations of returns and covariance.

After knowing the potential problems that exist in the method- sample mean/ covariance, we must minimize the differences between our estimation and the ground truth, which gives a chance to introduce the Shrinkage Method. The target of this method is to shrink simple mean/ covariance to the structured estimation.

What is shrinkage?

In statistics, shrinkage is the reduction in the effects of sampling variation. In regression analysis, a fitted relationship appears to perform less well on a new data set than on the data set used for fitting.

Linear Shrinkage in the estimation of returns

Linear Shrinkage based on Sample Mean but shrink to Equal Mean. And its math forms can be viewed as follows:

\(r_i^* = (1-\delta) r_i + \delta \bar{r}\)

, where \(r_i\) is the estimation of Sample Mean and \(\bar{r}\) is the estimation of Equal Mean. \(\delta \) is the shrinkage rate with number between 0 and1.

Linear Shrinkage in the estimation of the covariance matrix

Similarly, the linear shrinkage method can be used in the estimation of the covariance matrix with forms below:

\(\Sigma^* =(1-\delta) \Sigma +\delta F\)

, where \(\Sigma\) represents the sample covariance and \(F\) represents Equal correlation.

Further Discussion

When talking about the selection of the optimal value for the shrinkage coefficient, Jorion points out shrinkage estimator can be thought as follows:

\(\delta =\frac{\lambda}{T+\lambda}\)

\(\lambda = \frac{(N+2)(T-1)}{(\bar{r}-r_M)\Sigma^\mathrm{-1} (\bar{r}-r_i)(T-N-2)}\)

, where \(T\) is the number of time periods of data, \(N\) is the number of asset returns time series, \(\Sigma\) is the covariance matrix of return time series, $r_i$ is the return of asset i and \(r_M\) is the sort of return reference.

References

[1] https://en.wikipedia.org/wiki/Shrinkage_(statistics)

[2] Ledoit, Olivier ; Wolf, Michael Honey, I shrunk the sample covariance matrix[J] Universitat Pompeu Fabra. Departament D’Economia I Empresa 2003.

[3] Tuan, Eric Journal of Real Estate Portfolio Management, Jan-Apr 2013, Vol.19(1), pp.89-101