gavinsimpson / gratia

ggplot-based graphics and useful functions for GAMs fitted using the mgcv package
https://gavinsimpson.github.io/gratia/
Other
206 stars 28 forks source link

too_far scaling #239

Closed Silviculturalist closed 1 year ago

Silviculturalist commented 1 year ago

I noticed that the gratia::too_far function wraps mgcv::exclude.too.far.

Looking at the code in mgcv::exclude.too.far, we can see a non-standard scaling which I haven't been able to understand why it would be preferable:

(datum-min(data))/max(data)

Rather than a min-max scaling if the goal is to conform the data and prediction grid to the unit square as per the documentation.

I have reached out to Simon per email also, but do not know how active he is.

Silviculturalist commented 1 year ago

This was a misunderstanding on my part - S.W. centered the data before scaling. It is, in fact, a min-max normalisation.