how does glm / lassoglm treat NaN's - how do they avoid them ?

11 Ansichten (letzte 30 Tage)
Aravind Krishna
Aravind Krishna am 15 Sep. 2017
Kommentiert: Rajesh Balagam am 29 Sep. 2017
i understand that the lassoglm and glm function ignore the NaNs or the absence of data and still generate models. How do they avoid these missing values - do they convert NaNs into zeros ? or is it some other method.
I tried reading the source code for that function - but couldn't understand much

Antworten (1)

Rajesh Balagam
Rajesh Balagam am 18 Sep. 2017
If you are referring to "glmfit" function, it is mentioned in the corresponding documentation page that "glmfit treats NaNs in either X or y as missing values, and ignores them."
Based on the MATLAB code in glmfit.m file, it is calling an internal function "statremovenan". You can also use "isfinite" function to find the indices of the data that are not finite (returns true for finite data and false for other values) and ignore them for further processing.
  2 Kommentare
Aravind Krishna
Aravind Krishna am 18 Sep. 2017
I got the part where it ignores them- So does it ignore the complete observation ? meaning an entire row of that array ? or just that specific parameter for that particular observation ?
Rajesh Balagam
Rajesh Balagam am 29 Sep. 2017
The entire row is ignored.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by