scale0to1 | R Documentation |
This function can take a matrix or a vector and scale it to values from zero to one
scale0to1(x)
unscale0to1(x)
x |
a matrix or a vector |
This function is created to facilitate the construction of a design matrix where the explanatory variables are scaled to values from zero to one. This can be helpful for example if neural networks are fitted to a GAMLSS model like in p 306 of Stasinopoulos et al (2017).
=The rsult is a scaled matrix
Mikis Stasinopoulos
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, http://www.jstatsoft.org/v23/i07.
Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC.
(see also http://www.gamlss.org/).
library(gamlss)
# variable unscaled
plot(y~x, data=abdom)
sabdom <- scale0to1(abdom)
plot(y~x, data=sabdom)
unabdom <- unscale0to1(sabdom)
plot(y~x, data= unabdom)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.