-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Hi all,
I have a problem with the AIC when I make a pffr model. I fitted a model like this:
pffr_adj_fit1 = pffr(MIMS ~ age + gender + BMI, data = nhanes_ave[1:500,])
and I found the AIC value like this:
pffr_adj_fit1$aic
However, how is this value calculated? Because I found an astronomical value that doesn't coincide with the formula presented by Krivobokova (2007) or Crainiceanu (2024).
n=500
n*log(pffr_adj_fit1$deviance) + 2*sum(pffr_adj_fit1$edf) # Krivobokova equation 4
log(pffr_adj_fit1$deviance) + 2*sum(pffr_adj_fit1$edf)/n # Crainiceanu page 42
I have a second issue regarding how the REML score is calculated. I can find it, but it doesn't match any proxy that I have.
pffr_adj_fit1$gcv.ubre
References:
Krivobokova, T., & Kauermann, G. (2007). “A Note on Penalized Spline Smoothing with Correlated Errors.” Journal of the American Statistical Association, 102(480), 1328–1337, doi: 10.1198/016214507000000978
Crainiceanu, C.M. et al. (2024). "Functional Data Analysis with R". CRC Press, doi: 10.1201/9781003278726