transformationinversegamlss

How to do an inverse orderNorm transformation (bestNormalize package) from a GAMLSS object?


My y variable (n=30,000) is distributed with very heavy tails (both positive and negative), for which the fitDist GAMLSS function selects the ST4 family.

I tried to assess a GAMLSS-based regression with an explanatory variable x (pb smoothing), but tails on y are so heavy that convergence does not reach after 50 cycles, even after refit (time consuming+++).

Therefore, I normalized y using the orderNorm transformation (bestNormalize package), which allowed to easily and quickly reach convergence, and then to predict the fitted value from the GAMLSS object.

However, these fitted "orderNormalized" values are a GAMLSS object, and thus cannot be inversed using the predict function from bestNormalize (since this latter seems to not recognize a GAMLSS object).

My question: is it possible, whatever the means, to apply an inverse orderNorm transformation to fitted values from a GAMLSS object?


Solution

  • The vignette for bestNormalize has a similar example, using lm instead of GAMLSS. See the application section of the vignette. Once you have run the normalization procedure, you should be able to repeat and invert the transformation with the predict function.

    The key is storing a transformation object as an R object that can then be fed into the predict (or rather, the predict.bestNormalize) function.