Not really an issue, as I don't use mgwr (or haven't yet), more a question.
Are the constant scale factors applied to the kernel functions in _kernel_funcs(self, zs) here correct?
Perhaps more relevant, in the GWR context are they even necessary?
I ask because there is an odd mixture of constants applied to the kernels in some cases and not applied in others.
In density estimation applications of spatial kernels, volume preservation under the density surface is important. If this matters in the GWR case, then rather obviously the triangular function is not volume preserving as written given that the volume of a cone is $\pi r^2h/3$ for a cone of height $h$ and base radius $r$. This means that a volume preserving triangular kernel of bandwidth $w$ would have height (i.e. constant multiplier) $3/\pi w^2$. I assume since that's not applied (similarly the Gaussian and quartic kernels as written are not volume preserving, and none of the others are either, given that none of them are parameterised by a bandwidth.
They're not really kernels, which usually implies estimation of a PDF, so much as spatial interaction functions.
Anyway... if volume preservation doesn't matter then that means there's no point in applying any constant scaling factors to any of them so that the (3. / 4) applied to the quadratic and the (15. / 16) applied to the quartic can safely be dropped, and some infinitesimal amount of time saved!
Not really an issue, as I don't use
mgwr(or haven't yet), more a question.Are the constant scale factors applied to the kernel functions in
_kernel_funcs(self, zs)here correct?Perhaps more relevant, in the GWR context are they even necessary?
I ask because there is an odd mixture of constants applied to the kernels in some cases and not applied in others.
In density estimation applications of spatial kernels, volume preservation under the density surface is important. If this matters in the GWR case, then rather obviously the triangular function is not volume preserving as written given that the volume of a cone is$\pi r^2h/3$ for a cone of height $h$ and base radius $r$ . This means that a volume preserving triangular kernel of bandwidth $w$ would have height (i.e. constant multiplier) $3/\pi w^2$ . I assume since that's not applied (similarly the Gaussian and quartic kernels as written are not volume preserving, and none of the others are either, given that none of them are parameterised by a bandwidth.
They're not really kernels, which usually implies estimation of a PDF, so much as spatial interaction functions.
Anyway... if volume preservation doesn't matter then that means there's no point in applying any constant scaling factors to any of them so that the
(3. / 4)applied to the quadratic and the(15. / 16)applied to the quartic can safely be dropped, and some infinitesimal amount of time saved!