rgiordan / zaminfluence

Tools in R for computing and using Z-estimator approximate influence functions.
Apache License 2.0
94 stars 10 forks source link

NAs in the APIP cause error in `validate_APIP` #25

Closed rgiordan closed 2 years ago

rgiordan commented 2 years ago

A helpful user reports: When the linear approximation cannot produce a particular signal and the APIP is NA, zaminfluence fails with the following error:

Error in validate_APIP(new_APIP(n = n_drop, prop = n_drop/num_obs, inds = inds_drop)) : all(apip$inds > 0) is not TRUE

This is due to mishandling NA in validate_APIP, since I check for NULL but not NA.

rgiordan commented 2 years ago

Fixed in https://github.com/rgiordan/zaminfluence/pull/26. I'll leave the issue open until there is a unit test.

rgiordan commented 2 years ago

This is tested in the https://github.com/rgiordan/zaminfluence/tree/fix_15 branch.