Estimator standard errors using fmincon (portfolio optimization context)

63 ビュー (過去 30 日間)
Martin Pott
Martin Pott 2014 年 9 月 4 日
編集済み: Joshua Scott 2022 年 11 月 9 日
I'm trying to get standard errors of the estimators in my optimization. I use the fmincon function with the active-set algorithm and dfp updating scheme. I am working on a portfolio optimization problem and what I would like to do is determine the statistical significance of the estimators in determining model performance (so which variables actually matter in determining model outperformance relative to the benchmark).
I have already ran a CAPM regression using Newey-West robust standard errors, however this just gives you a value for market beta and an alpha. I did this by taking my model returns as the dependent variable and taking the a vector of ones and the market returns as the independent variables.
Would it be correct to run a regression incorporating the other variables I believe to be useful (again with model returns as dependent variable), or do I need to do something else? I am wondering about this, since when I search for standard errors of the estimators on Google/the Matlab website, I just find a lot about calculating the Hessian.
Thanks in advance.
Martin Pott

採用された回答

Roger Wohlwend
Roger Wohlwend 2014 年 9 月 5 日
The key to the standard errors is the Hessian matrix. The variance-covariance-matrix of the coefficients is the inverse of the Hessian matrix. So the standard errors are the square root of the values on the diagonal of the inverse Hessian matrix.
err = sqrt(diag(inv(Hessian)))
The Hessian matrix is the 7th output variable of the fmincon function.
  2 件のコメント
Matt J
Matt J 2014 年 9 月 5 日
編集済み: Matt J 2014 年 9 月 5 日
The Hessian output of fmincon is inaccurate, see
It is also unclear whether an accurate Hessian leads to meaningful statistical error estimates in constrained problems. According to Alan Weiss' remarks here, however, fminunc does generate accurate Hessians.
Joshua Scott
Joshua Scott 2022 年 11 月 9 日
編集済み: Joshua Scott 2022 年 11 月 9 日
Hi Roger,
I realize your comment was a long time ago, but I am hoping you can help.
I am similarly trying to use the variance and/or standard error that resides in the hessian matrix. I want to put the results of "err" into a vector/matrix I can call on later. However, when I try versions of this, "err" isn't recognized.
Do you happen to know why?

サインインしてコメントする。

その他の回答 (3 件)

Martin Pott
Martin Pott 2014 年 9 月 6 日
Dear Roger and Matt,
Thank you very much for your response. If I understand correctly, I need to run the estimation again, but using the fminunc function (just for the calculation of the right standard errors). Then, if my estimation is not at one of the bounds of the constraint, I can use the dfs/bfgs Hessian that is calculated in the unconstrained optimization, to derive the standard errors in the way Roger wrote above.
Do you have any idea how to do this in the case that a value is at the bounds of the constraints? I have set an upper and lower bound vector with values of -10 and 10, for which some coefficients are at the bounds when estimated.
Thanks again.
Martin

Matt J
Matt J 2014 年 9 月 6 日
編集済み: Matt J 2014 年 9 月 6 日
I have set an upper and lower bound vector with values of -10 and 10, for which some coefficients are at the bounds when estimated.
I don't know of any extension of the Cramer-Rao bound to constrained problems. One option might be to rewrite the problem as an unconstrained one. E.g., if you have a parameter x that varies between bounds -10 and 10, rewrite that particular parameter using the change of variables.
x=10*sin(y)
Finding the inv(Hessian) of this transformed objective will give you standard errors on the new parameter y.
Note: since you've already solved the problem in the space of x, you need merely transform the objective and calculate the Hessian at that solution. No need to redo the optimization.
  1 件のコメント
Matt J
Matt J 2014 年 9 月 9 日
Martin Pott Commented:
Dear Matt,
I am currently working on some improvements in the optimization, so I'm not able to try it out at the moment.
I will try your method as soon as possible. Thank you for your response.
Martin

サインインしてコメントする。


Martin Pott
Martin Pott 2014 年 9 月 15 日
Thanks everyone for helping me with my problem. After rerunning the optimization it turned out that my estimators were all well between the boundaries, meaning (if I understand correctly) that I can use the DFP approximated Hessian for finding (reasonably) correct standard errors. Please correct me if I'm wrong.
Thank you again.
Martin
  3 件のコメント
atreyu
atreyu 2016 年 6 月 30 日
編集済み: atreyu 2016 年 6 月 30 日
Was this true at the time? The documentation now says that it is in fact the Hessian at the solution.
Matt J
Matt J 2016 年 7 月 3 日
The documentation that I am seeing,
says that it is still true.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by