Error in fmincon-NaN values
5 ビュー (過去 30 日間)
古いコメントを表示
Hi to everyone, I work with a matrix of time series (21 financial time serie), and I'm trying to use fmincon optimization function. Given the maximum likelihood function that I defined, when I call fmincon function, using interior-point algorithm, fmincon stopped because it founds NaN in the data input vectors. There are some NaN in every vector that's included in the matrix, and I would like to know if it is possible to overcome this problem. If I preliminarly treat the missing values in the matrix, with interpolation method (i.e.linear) or if I substitute NaN with 0, fmincon works, but obviously the results are influenced by missing data treatment. Is there any method to ignore NaN data in input vector?
Thank yo so much.
0 件のコメント
採用された回答
Star Strider
2019 年 2 月 20 日
The usual method MATLAB toolboxes use to deal with NaN values in data is to omit the entire row that has a NaN value in any column. (This also follows the usual MATLAB convention of rows being observations and columns being individual variable values in each observation.) You need to decide if this approach works in your situation and with your data.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!