Error in fmincon-NaN values

5 visualizaciones (últimos 30 días)
Alessandra Costa
Alessandra Costa el 20 de Feb. de 2019
Comentada: Star Strider el 20 de Feb. de 2019
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.

Respuesta aceptada

Star Strider
Star Strider el 20 de Feb. de 2019
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.
  2 comentarios
Alessandra Costa
Alessandra Costa el 20 de Feb. de 2019
Given the dimension of the matrix, 4683 by 21 of 21 financial time series, If I omit the entire row with NaN value for all the value (in every column), I'll lose too many observations. Just think about the fact that for one series, I have an entire year of missing values and I work with daily data. Your answer confirms me that there's not an automatic way to tell to fmincon or to the handle function used in it to ignore NaN, by preserving the original size of vectors.
Thank you so much
Star Strider
Star Strider el 20 de Feb. de 2019
My pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by