felix-clark / ndarray-glm

Rust library for linear, logistic, and generalized linear model regression
MIT License
22 stars 0 forks source link

Logistic regression standardized and studentized residuals are slightly different from those given in R #31

Open felix-clark opened 3 years ago

felix-clark commented 3 years ago

This is apparent in the logistic integration test log_termination_0, which now compares several fit statistics to those given by R. For the standardized/studentized residual equality checks to pass the tolerance has to be increased to ~0.05, so they are approximately equal but not exact up to FPEs.

I'm including these residual functions in 0.0.10 since they are close and should still be useful, but the source of the difference should be investigated further.

felix-clark commented 12 months ago

This is likely due to the leverage component using the projection matrix from the data alone, not the full adjusted hat matrix from the fit result. These are only identical in the linear case.

This will be addressed in the weighted regression update #37 .