-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formula of get_AICc #117
Comments
Hi @hayato-n. The only difference is the denominator when calculating the error variance, where here in mgwr is using the MLE (RSS/n) and in the Li paper is described using the unbiased estimator (RSS/(n-k)). I think it is more common to use the MLE one that is implemented here, so to be consistent, the later update of fastgwr uses MLE (Link). |
Hi @Ziqi-Li, thanks for your reply. # ML
sigma2 = np.sum(np.square(gwr.resid_response)) / gwr.n
# unbiased
# sigma2 = np.sum(np.square(gwr.resid_response)) / (gwr.n - gwr.ENP)
# AICc
gwr.n * (np.log(sigma2) + np.log(2*np.pi) + (gwr.n+gwr.ENP) / (gwr.n-2-gwr.ENP)) I suspect it is not intuitive that the parameter Thank you again for your helpful comment! |
Hi @hayato-n, great you find it consistent now. I think |
Yes, you are right, |
In
diagnostics.py
, get_AICc formula ismgwr/mgwr/diagnostics.py
Lines 11 to 30 in 2a95535
However, as written in its comment, it depends on the setting of
GLM
. Thus its result is different from the AICc definition described in Li et al. (2019).(Even if I changed
sigma2_v1
parameter ofgwr.GWR
), the resulting AICc value did not change.)I suspect that the following code is consistent with the definition above.
gwr.n * (np.log(np.sum(np.square(gwr.resid_response))) - np.log(gwr.n-gwr.ENP) + np.log(2*np.pi) + (gwr.n+gwr.ENP) / (gwr.n-2-gwr.ENP))
Is there any reason why the current implementation is employed?
The text was updated successfully, but these errors were encountered: