scale0to1: Scaling Matrices or Vectors to Values from Zero to One

View source: R/scale0to1.R

scale0to1R Documentation

Scaling Matrices or Vectors to Values from Zero to One

Description

This function can take a matrix or a vector and scale it to values from zero to one

Usage

scale0to1(x)

unscale0to1(x)

Arguments

x

a matrix or a vector

Details

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).

Value

=The rsult is a scaled matrix

Author(s)

Mikis Stasinopoulos

References

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/).

Examples

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)

mstasinopoulos/GAMLSS-utilities documentation built on July 8, 2023, 11:25 p.m.