diff --git a/.gitignore b/.gitignore index 6595871..65f3544 100644 --- a/.gitignore +++ b/.gitignore @@ -51,10 +51,6 @@ rsconnect/ .Rdata .DS_Store -# Package documentation -man/ -*.Rd - # Manuscript manuscript/manuscript.pdf manuscript/manuscript.log diff --git a/man/assess_transformation.Rd b/man/assess_transformation.Rd new file mode 100644 index 0000000..582a9bf --- /dev/null +++ b/man/assess_transformation.Rd @@ -0,0 +1,41 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/GoodnessOfFit.R +\name{assess_transformation} +\alias{assess_transformation} +\title{Assess normality of transformed data} +\usage{ +assess_transformation(x, transformer, verbose = TRUE, ...) +} +\arguments{ +\item{x}{A vector with numeric values that should be transformed to +normality.} + +\item{transformer}{A transformer object created using +\code{find_transformation_parameters}.} + +\item{verbose}{Sets verbosity of the fubction.} + +\item{...}{Unused arguments.} +} +\value{ +p-value for empirical goodness of fit test. +} +\description{ +Not all data allows for a reasonable transformation to normality using power +transformation. For example, uniformly distributed data or multi-modal data +cannot be transformed to normality. This function computes a p-value for an +empirical goodness of fit test for central normality. A distribution is +centrally normal if the central 80\% of the data are approximately normally +distributed. The null-hypothesis is that the transformed distribution is +centrally normal. +} +\examples{ +x <- exp(stats::rnorm(1000)) +transformer <- find_transformation_parameters( + x = x, + method = "box_cox") + +assess_transformation( + x = x, + transformer = transformer) +} diff --git a/man/create_transformer_skeleton.Rd b/man/create_transformer_skeleton.Rd new file mode 100644 index 0000000..4f4029e --- /dev/null +++ b/man/create_transformer_skeleton.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/TransformationSkeleton.R +\name{create_transformer_skeleton} +\alias{create_transformer_skeleton} +\title{Create transformation object skeleton} +\usage{ +create_transformer_skeleton(method, lambda = 1, shift = 0, scale = 1) +} +\arguments{ +\item{method}{Transformation method. Can be \code{"none"}, \code{"box_cox"} or +\code{"yeo_johnson"}.} + +\item{lambda}{Value of the transformation parameter lambda. Can also be +changed using the \code{set_lambda} method.} + +\item{shift}{Value of the shift parameter. Can also be changed using the +\code{set_shift} method.} + +\item{scale}{Value of the scale parameter. Can also be changed using the +\code{set_scale} method.} +} +\value{ +A transformer object +} +\description{ +Creates skeleton objects. This generates objects without fitting +parameters. This is primarily intended for creating transformers +externally, where fitting parameters are known. +} diff --git a/man/find_transformation_parameters.Rd b/man/find_transformation_parameters.Rd new file mode 100644 index 0000000..22ef0ca --- /dev/null +++ b/man/find_transformation_parameters.Rd @@ -0,0 +1,81 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/FindParameters.R +\name{find_transformation_parameters} +\alias{find_transformation_parameters} +\title{Set transformation parameters} +\usage{ +find_transformation_parameters( + x, + method = "yeo_johnson", + robust = TRUE, + invariant = TRUE, + lambda = c(-4, 6), + empirical_gof_normality_p_value = NULL, + ... +) +} +\arguments{ +\item{x}{A vector with numeric values.} + +\item{method}{One of the following methods for power transformation: +\itemize{ +\item \code{box_cox}: Transformation using the Box-Cox transformation (Box and Cox, +1964). The Box-Cox transformation requires that all data are strictly +positive. Features that contain zero or negative values cannot be +transformed using this transformation. In their work, Box and Cox define a +shifted variant. We use this variant to shift values to a strictly positive +range, when negative values are present. The Box-Cox transformation relies +on a single parameter lambda, which is estimated through maximisation of +the log-likelihood function corresponding to a normal distribution. +\item \code{yeo_johnson}:Transformation using the Yeo-Johnson +transformation (Yeo and Johnson, 2000). Unlike the Box-Cox transformation, +the Yeo-Johnson transformation allows for negative and positive values. +Like the Box-Cox transformation, this transformation relies on a single +parameter lambda, which is estimated through maximisation of the +log-likelihood function corresponding to a normal distribution. +\item \code{none}: A fall-back method that will not transform values. +}} + +\item{robust}{Flag for using a robust version of Box-Cox or Yeo-Johnson +transformation, as defined by Raymaekers and Rousseeuw (2021). This version +is less sensitive in the presence outliers.} + +\item{invariant}{Flag for using a version of Box-Cox or Yeo-Johnson +transformation that simultaneously optimises location and scale in addition +to the lambda parameter.} + +\item{lambda}{Single lambda value, or range of lambda values that should be +considered. Default: c(4.0, 6.0). Can be \code{NULL} to force optimisation +without a constraint in lambda values.} + +\item{empirical_gof_normality_p_value}{Significance value for the empirical +goodness-of-fit test for central normality. The p-value is computed through +the \code{assess_transformation} function. By setting this parameter to a +numeric value other than \code{NULL}, the transformation will be rejected when +the p-value of the test is below the significance value.} + +\item{...}{Unused parameters.} +} +\value{ +A transformer object that can be used to transform values. +} +\description{ +\code{find_transformation_parameters} is used to find optimal parameters for +univariate transformation to normality. +} +\examples{ +x <- exp(stats::rnorm(1000)) +transformer <- find_transformation_parameters( + x = x, + method = "box_cox") +} +\references{ +\enumerate{ +\item Yeo, I. & Johnson, R. A. A new family of power transformations +to improve normality or symmetry. Biometrika 87, 954–959 (2000). +\item Box, G. E. P. & Cox, D. R. An analysis of transformations. J. R. Stat. +Soc. Series B Stat. Methodol. 26, 211–252 (1964). +\item Raymaekers, J., Rousseeuw, P. J. Transforming variables to central +normality. Mach Learn. (2021). +} +} diff --git a/man/get_residuals.Rd b/man/get_residuals.Rd new file mode 100644 index 0000000..5ed0f03 --- /dev/null +++ b/man/get_residuals.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/GoodnessOfFit.R +\name{get_residuals} +\alias{get_residuals} +\title{Compute residuals of transformation to normality} +\usage{ +get_residuals(x, transformer, ...) +} +\arguments{ +\item{x}{A vector with numeric values that should be transformed to +normality.} + +\item{transformer}{A transformer object created using +\code{find_transformation_parameters}.} + +\item{...}{Unused arguments.} +} +\value{ +A \code{data.table} containing the expected (according to a normal +distribution) and observed z-scores, and their difference as residuals. +} +\description{ +Compute residuals of transformation to normality +} +\examples{ +x <- exp(stats::rnorm(1000)) +transformer <- find_transformation_parameters( + x = x, + method = "box_cox") + +residual_data <- get_residuals( + x = x, + transformer = transformer) +} diff --git a/man/huber_estimate.Rd b/man/huber_estimate.Rd new file mode 100644 index 0000000..8222564 --- /dev/null +++ b/man/huber_estimate.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/Utilities.R +\name{huber_estimate} +\alias{huber_estimate} +\title{Huber M-estimate} +\usage{ +huber_estimate(x, k = 1.28, tol = 1e-04) +} +\arguments{ +\item{x}{Vector of numeric values for which the location and scale should be +estimated.} + +\item{k}{Numeric value > 0 that the determines the value beyond which the +signal is winsorized.} + +\item{tol}{Tolerance for the iterative procedure.} +} +\value{ +list with location estimate \code{"mu"} and scale estimate \code{"sigma"}. +} +\description{ +Iteratively computes M-estimates for location and scale. These +are robust estimates of the mean and standard deviation of the data. +} diff --git a/man/lambda-accessor-method.Rd b/man/lambda-accessor-method.Rd new file mode 100644 index 0000000..0b1b3d5 --- /dev/null +++ b/man/lambda-accessor-method.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AccessorsMutatorsLambda.R +\name{get_lambda} +\alias{get_lambda} +\alias{get_lambda,transformationPowerTransform-method} +\alias{get_lambda,transformationBoxCox-method} +\alias{get_lambda,transformationYeoJohnson-method} +\title{Get lambda value} +\usage{ +get_lambda(object, ...) + +\S4method{get_lambda}{transformationPowerTransform}(object, ...) + +\S4method{get_lambda}{transformationBoxCox}(object, ...) + +\S4method{get_lambda}{transformationYeoJohnson}(object, ...) +} +\arguments{ +\item{object}{Transformer object} + +\item{...}{Unused arguments} +} +\value{ +Lambda value of the transformer. +} +\description{ +Get the lambda value of a transformer object. +} diff --git a/man/lambda-mutator-method.Rd b/man/lambda-mutator-method.Rd new file mode 100644 index 0000000..62a5377 --- /dev/null +++ b/man/lambda-mutator-method.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AccessorsMutatorsLambda.R +\name{set_lambda} +\alias{set_lambda} +\alias{set_lambda,transformationPowerTransform-method} +\alias{set_lambda,transformationBoxCox-method} +\alias{set_lambda,transformationYeoJohnson-method} +\title{Set lambda value} +\usage{ +set_lambda(object, lambda, ...) + +\S4method{set_lambda}{transformationPowerTransform}(object, lambda, ...) + +\S4method{set_lambda}{transformationBoxCox}(object, lambda, ...) + +\S4method{set_lambda}{transformationYeoJohnson}(object, lambda, ...) +} +\arguments{ +\item{object}{Transformer object} + +\item{lambda}{Lambda value} + +\item{...}{Unused arguments} +} +\value{ +Transformer object with updated lambda value. +} +\description{ +Set the lambda value of a transformer object. +} diff --git a/man/plot_qq_plot.Rd b/man/plot_qq_plot.Rd new file mode 100644 index 0000000..7839d72 --- /dev/null +++ b/man/plot_qq_plot.Rd @@ -0,0 +1,51 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/PlotQQPlot.R +\name{plot_qq_plot} +\alias{plot_qq_plot} +\title{Create Q-Q plot} +\usage{ +plot_qq_plot( + x, + transformer, + show_original = TRUE, + show_identity = TRUE, + use_alpha = TRUE, + ggtheme = NULL +) +} +\arguments{ +\item{x}{A vector with numeric values that should be transformed to +normality.} + +\item{transformer}{A transformer object created using +\code{find_transformation_parameters}.} + +\item{show_original}{Show quantiles for original, untransformed, data in +addition to transformed data.} + +\item{show_identity}{Show identity line that indicates equivalence between +expected and observed quantiles.} + +\item{use_alpha}{Use transparency for points in case the data contains many +instances.} + +\item{ggtheme}{\code{ggplot2} theme to use for the plot. If not provided, +\code{ggplot2::theme_light} is used.} +} +\value{ +A \code{ggplot2} plot object for a Q-Q plot. +} +\description{ +Create a figure that plots the expected, theoretical normal quantiles +(z-scores) against the observed normal quantiles (z-scores) of the data. +} +\examples{ +x <- exp(stats::rnorm(1000)) +transformer <- find_transformation_parameters( + x = x, + method = "box_cox") + +plot_qq_plot( + x = x, + transformer = transformer) +} diff --git a/man/plot_residual_plot.Rd b/man/plot_residual_plot.Rd new file mode 100644 index 0000000..2b71f2d --- /dev/null +++ b/man/plot_residual_plot.Rd @@ -0,0 +1,61 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/PlotResidualPlot.R +\name{plot_residual_plot} +\alias{plot_residual_plot} +\title{Create residual plot} +\usage{ +plot_residual_plot( + x, + transformer, + centre_width = NULL, + show_original = TRUE, + use_alpha = TRUE, + use_absolute_deviation = TRUE, + ggtheme = NULL +) +} +\arguments{ +\item{x}{A vector with numeric values that should be transformed to +normality.} + +\item{transformer}{A transformer object created using +\code{find_transformation_parameters}.} + +\item{centre_width}{A numeric value between 0.0 and 1.0 that describes the +width of the centre of the data. Can be NULL.} + +\item{show_original}{Show residuals for original, untransformed, data in +addition to transformed data.} + +\item{use_alpha}{Use transparency for points in case the data contains many +instances.} + +\item{use_absolute_deviation}{Plot absolute deviation instead of residuals.} + +\item{ggtheme}{\code{ggplot2} theme to use for the plot. If not provided, +\code{ggplot2::theme_light} is used.} +} +\value{ +A \code{ggplot2} plot object for a Q-Q plot. +} +\description{ +Create a figure that plots the residuals of the data. These residuals are the +difference between expected normal quantiles and observed quantiles. +} +\examples{ +x <- exp(stats::rnorm(1000)) +transformer <- find_transformation_parameters( + x = x, + method = "box_cox") + +plot_residual_plot( + x = x, + transformer = transformer) + +# Plot only central 80\% of the data. +plot_residual_plot( + x = x, + transformer = transformer, + centre_width = 0.80, + show_original = FALSE) +} diff --git a/man/power.transform.Rd b/man/power.transform.Rd new file mode 100644 index 0000000..ad9ccc7 --- /dev/null +++ b/man/power.transform.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/power.transform-package.R +\docType{package} +\name{power.transform} +\alias{power.transform-package} +\alias{power.transform} +\title{power.transform: Transform Data to Normality using Power Transformations} +\description{ +This package was originally based on, and contains code from, the familiar +package (\url{https://cran.r-project.org/package=familiar}), under the EUPL +license. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/oncoray/power.transform} + \item Report bugs at \url{https://github.com/oncoray/power.transform/issues} +} + +} +\author{ +\strong{Maintainer}: Alex Zwanenburg \email{alexander.zwanenburg@nct-dresden.de} (\href{https://orcid.org/0000-0002-0342-9545}{ORCID}) + +Authors: +\itemize{ + \item Steffen Löck +} + +Other contributors: +\itemize{ + \item German Cancer Research Center (DKFZ) [copyright holder] +} + +} diff --git a/man/power_transform.Rd b/man/power_transform.Rd new file mode 100644 index 0000000..f8a7d6b --- /dev/null +++ b/man/power_transform.Rd @@ -0,0 +1,79 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/FindParameters.R +\name{power_transform} +\alias{power_transform} +\title{Transform values} +\usage{ +power_transform(x, transformer = NULL, oob_action = "na", ...) +} +\arguments{ +\item{x}{A vector with numeric values that should be transformed to +normality.} + +\item{transformer}{A transformer object created using +\code{find_transformation_parameters}. If \code{NULL}, a transformer is generated +internally.} + +\item{oob_action}{Action that should be taken when out-of-bounds values are +encountered in \code{x}. This can for example be 0 or negative values for +Box-Cox transformations. +\itemize{ +\item \code{na} (default): replaces out-of-bounds values by NA values. +\item \code{valid}: replaces out-of-bounds values by the closest valid boundary +values. +} + +This argument has no effect for Yeo-Johnson transformations.} + +\item{...}{ + Arguments passed on to \code{\link[=find_transformation_parameters]{find_transformation_parameters}} + \describe{ + \item{\code{method}}{One of the following methods for power transformation: +\itemize{ +\item \code{box_cox}: Transformation using the Box-Cox transformation (Box and Cox, +1964). The Box-Cox transformation requires that all data are strictly +positive. Features that contain zero or negative values cannot be +transformed using this transformation. In their work, Box and Cox define a +shifted variant. We use this variant to shift values to a strictly positive +range, when negative values are present. The Box-Cox transformation relies +on a single parameter lambda, which is estimated through maximisation of +the log-likelihood function corresponding to a normal distribution. +\item \code{yeo_johnson}:Transformation using the Yeo-Johnson +transformation (Yeo and Johnson, 2000). Unlike the Box-Cox transformation, +the Yeo-Johnson transformation allows for negative and positive values. +Like the Box-Cox transformation, this transformation relies on a single +parameter lambda, which is estimated through maximisation of the +log-likelihood function corresponding to a normal distribution. +\item \code{none}: A fall-back method that will not transform values. +}} + \item{\code{robust}}{Flag for using a robust version of Box-Cox or Yeo-Johnson +transformation, as defined by Raymaekers and Rousseeuw (2021). This version +is less sensitive in the presence outliers.} + \item{\code{invariant}}{Flag for using a version of Box-Cox or Yeo-Johnson +transformation that simultaneously optimises location and scale in addition +to the lambda parameter.} + \item{\code{lambda}}{Single lambda value, or range of lambda values that should be +considered. Default: c(4.0, 6.0). Can be \code{NULL} to force optimisation +without a constraint in lambda values.} + \item{\code{empirical_gof_normality_p_value}}{Significance value for the empirical +goodness-of-fit test for central normality. The p-value is computed through +the \code{assess_transformation} function. By setting this parameter to a +numeric value other than \code{NULL}, the transformation will be rejected when +the p-value of the test is below the significance value.} + }} +} +\value{ +A vector of transformed values of \code{x}. +} +\description{ +\code{power_transform} transforms numeric values to normality. +} +\examples{ +x <- exp(stats::rnorm(1000)) +y <- power_transform( + x = x, + method = "box_cox") +} +\seealso{ +\link{find_transformation_parameters} +} diff --git a/man/ragn.Rd b/man/ragn.Rd new file mode 100644 index 0000000..778bc30 --- /dev/null +++ b/man/ragn.Rd @@ -0,0 +1,71 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/Utilities.R +\name{ragn} +\alias{ragn} +\title{Random Values from the Asymmetric Generalised Normal Distribution} +\usage{ +ragn(n, location = 0, scale = 1, alpha = 0.5, beta = 2) +} +\arguments{ +\item{n}{number of instances} + +\item{location}{central location of the distribution} + +\item{scale}{scale of the distribution. Must be strictly positive: \code{scale > 0.0}} + +\item{alpha}{value between 0.0 and 1.0 that determines the skewness of the +distribution. \code{alpha > 0.5} creates a distribution with a negative skew +(left-skewed), i.e. the left tail of the distribution is elongated, and the +bulk of the distribution is located to the right. \code{alpha < 0.5} creates a +distribution with a positive skew (right-skewed), i.e. the right tail of +the distribution is elongated, and the bulk of the distribution is located +to the left. For \code{alpha = 0.0}, the distribution does not have a skew.} + +\item{beta}{Strictly positive value (\code{beta > 0.0}) that determines the +overall shape of the generalised normal distribution. For \code{beta = 1}, an +asymmetric Laplace distribution is used. \code{beta = 2} draws values according +to an asymmetric normal distribution. For large \code{beta} the distribution +will approximate the uniform distribution.} +} +\value{ +One or more numeric values drawn from the asymmetric generalised +normal distribution. +} +\description{ +Draws random values from an asymmetric generalised normal distribution. +} +\details{ +Random values drawn according to an asymmetric generalised normal +distribution. Here the asymmetric generalised normal distribution is a +symmetric general normal distribution, that is made asymmetric using the +procedure described by Gijbels et al. To generate random values we use the +quantile function of the symmetric generalised normal distribution that was +derived by M. Griffin. + +The default parameter values produce values as if drawn from the standard +normal distribution with \eqn{\sigma = \sqrt{2}}, that is, the standard +deviation is not \eqn{\sqrt{2}} instead of \eqn{1}. +} +\examples{ +# Draw values from a standard normal distribution. +x <- power.transform::ragn(n = 10000, scale = 1/sqrt(2)) +hist(x, 50) + +# Draw values from a left-skewed normal distribution. +x <- power.transform::ragn(n = 10000, scale = 1/sqrt(2), alpha = 0.8) +hist(x, 50) + +# Draw values from a right-skewed normal distribution. +x <- power.transform::ragn(n = 10000, scale = 1/sqrt(2), alpha = 0.2) +hist(x, 50) + +# Draw values from a standard laplace distribution. +x <- power.transform::ragn(n = 10000, scale = 1/sqrt(2), beta = 1.0) +hist(x, 50) +} +\references{ +\enumerate{ +\item Gijbels I, Karim R, Verhasselt A. Quantile Estimation in a Generalized +\item Griffin M (2018). gnorm: Generalized Normal/Exponential Power Distribution. +} +} diff --git a/man/revert_power_transform.Rd b/man/revert_power_transform.Rd new file mode 100644 index 0000000..d106d79 --- /dev/null +++ b/man/revert_power_transform.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/FindParameters.R +\name{revert_power_transform} +\alias{revert_power_transform} +\title{Revert transformation} +\usage{ +revert_power_transform(y, transformer) +} +\arguments{ +\item{y}{A vector with numeric values that was previously transformed to +normality.} + +\item{transformer}{A transformer object created using +\code{find_transformation_parameters} that was used to transform the values to +normality previously. Cannot be \code{NULL}.} +} +\value{ +A vector of values. +} +\description{ +\code{revert_power_transform} reverts the transformation of numeric values to +normality. +} +\examples{ +x0 <- exp(stats::rnorm(1000)) + +transformer <- find_transformation_parameters( + x = x0, + method = "box_cox") + +y <- power_transform( + x = x0, + transformer = transformer) + +x1 <- revert_power_transform( + y = y, + transformer = transformer) +} diff --git a/man/scale-accessor-method.Rd b/man/scale-accessor-method.Rd new file mode 100644 index 0000000..5f83da2 --- /dev/null +++ b/man/scale-accessor-method.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AccessorsMutatorsScale.R +\name{get_scale} +\alias{get_scale} +\alias{get_scale,transformationPowerTransform-method} +\alias{get_scale,transformationBoxCox-method} +\alias{get_scale,transformationYeoJohnson-method} +\title{Get scale value} +\usage{ +get_scale(object, ...) + +\S4method{get_scale}{transformationPowerTransform}(object, ...) + +\S4method{get_scale}{transformationBoxCox}(object, ...) + +\S4method{get_scale}{transformationYeoJohnson}(object, ...) +} +\arguments{ +\item{object}{Transformer object} + +\item{...}{Unused arguments} +} +\value{ +scale value of the transformer. +} +\description{ +Get the scale value of a transformer object. +} diff --git a/man/scale-mutator-method.Rd b/man/scale-mutator-method.Rd new file mode 100644 index 0000000..21cb93b --- /dev/null +++ b/man/scale-mutator-method.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AccessorsMutatorsScale.R +\name{set_scale} +\alias{set_scale} +\alias{set_scale,transformationPowerTransform-method} +\alias{set_scale,transformationBoxCox-method} +\alias{set_scale,transformationYeoJohnson-method} +\title{Set scale value} +\usage{ +set_scale(object, scale, ...) + +\S4method{set_scale}{transformationPowerTransform}(object, scale, ...) + +\S4method{set_scale}{transformationBoxCox}(object, scale, ...) + +\S4method{set_scale}{transformationYeoJohnson}(object, scale, ...) +} +\arguments{ +\item{object}{Transformer object} + +\item{scale}{scale value} + +\item{...}{Unused arguments} +} +\value{ +Transformer object with updated scale value. +} +\description{ +Set the scale value of a transformer object. +} diff --git a/man/shift-accessor-method.Rd b/man/shift-accessor-method.Rd new file mode 100644 index 0000000..051f7b0 --- /dev/null +++ b/man/shift-accessor-method.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AccessorsMutatorsShift.R +\name{get_shift} +\alias{get_shift} +\alias{get_shift,transformationPowerTransform-method} +\alias{get_shift,transformationBoxCox-method} +\alias{get_shift,transformationYeoJohnson-method} +\title{Get shift value} +\usage{ +get_shift(object, ...) + +\S4method{get_shift}{transformationPowerTransform}(object, ...) + +\S4method{get_shift}{transformationBoxCox}(object, ...) + +\S4method{get_shift}{transformationYeoJohnson}(object, ...) +} +\arguments{ +\item{object}{Transformer object} + +\item{...}{Unused arguments} +} +\value{ +shift value of the transformer. +} +\description{ +Get the shift value of a transformer object. +} diff --git a/man/shift-mutator-method.Rd b/man/shift-mutator-method.Rd new file mode 100644 index 0000000..c769c21 --- /dev/null +++ b/man/shift-mutator-method.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AccessorsMutatorsShift.R +\name{set_shift} +\alias{set_shift} +\alias{set_shift,transformationPowerTransform-method} +\alias{set_shift,transformationBoxCox-method} +\alias{set_shift,transformationYeoJohnson-method} +\title{Set shift value} +\usage{ +set_shift(object, shift, ...) + +\S4method{set_shift}{transformationPowerTransform}(object, shift, ...) + +\S4method{set_shift}{transformationBoxCox}(object, shift, ...) + +\S4method{set_shift}{transformationYeoJohnson}(object, shift, ...) +} +\arguments{ +\item{object}{Transformer object} + +\item{shift}{Shift value} + +\item{...}{Unused arguments} +} +\value{ +Transformer object with updated shift value. +} +\description{ +Set the shift value of a transformer object. +} diff --git a/man/transformation-method-accessor-method.Rd b/man/transformation-method-accessor-method.Rd new file mode 100644 index 0000000..b7e9d05 --- /dev/null +++ b/man/transformation-method-accessor-method.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/AccessorsTransformationMethod.R +\name{get_transformation_method} +\alias{get_transformation_method} +\alias{get_transformation_method,transformationPowerTransform-method} +\title{Get transformation method} +\usage{ +get_transformation_method(object, ...) + +\S4method{get_transformation_method}{transformationPowerTransform}(object, ...) +} +\arguments{ +\item{object}{Transformer object} + +\item{...}{Unused arguments} +} +\value{ +Transformation method +} +\description{ +Get the transformation method of a transformer object. +} diff --git a/man/transformationNone-class.Rd b/man/transformationNone-class.Rd new file mode 100644 index 0000000..9217467 --- /dev/null +++ b/man/transformationNone-class.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/TransformationObjects.R +\docType{class} +\name{transformationNone-class} +\alias{transformationNone-class} +\title{No transformation object} +\description{ +This class is for transformers that do not alter the data. +} +\section{Slots}{ + +\describe{ +\item{\code{method}}{Main transformation method, i.e. \code{"none"}.} + +\item{\code{complete}}{Indicates whether transformation parameters were set.} +}} + diff --git a/man/transformationPowerTransform-class.Rd b/man/transformationPowerTransform-class.Rd new file mode 100644 index 0000000..d62d8c4 --- /dev/null +++ b/man/transformationPowerTransform-class.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/TransformationObjects.R +\docType{class} +\name{transformationPowerTransform-class} +\alias{transformationPowerTransform-class} +\title{Generic transformation object} +\description{ +This is the superclass for transformation objects. +} +\section{Slots}{ + +\describe{ +\item{\code{method}}{Main transformation method.} + +\item{\code{complete}}{Indicates whether transformation parameters were set.} + +\item{\code{version}}{Version of the power.transform package that was used to create +the transformation objecst.} +}} + diff --git a/man/transformation_box_cox.Rd b/man/transformation_box_cox.Rd new file mode 100644 index 0000000..d3e1e49 --- /dev/null +++ b/man/transformation_box_cox.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/TransformationBoxCox.R +\docType{class} +\name{transformationBoxCox-class} +\alias{transformationBoxCox-class} +\alias{transformationBoxCoxInvariant-class} +\title{Box-Cox transformation object} +\description{ +This class is used for Box-Cox transformations. +} +\section{Slots}{ + +\describe{ +\item{\code{method}}{Main transformation method, i.e. \code{"box_cox"}.} + +\item{\code{robust}}{Indicates whether a robust version of the Box-Cox transformation +is used to set transformation parameters. The value depends on the \code{robust} +argument of the \code{find_transformation_parameters} function.} + +\item{\code{lambda}}{Numeric lambda parameter for the Box-Cox transformation.} + +\item{\code{shift}}{Numeric shift parameter for the Box-Cox transformation. The value +depends on the data used for setting transformation parameters. If all data +are strictly positive, \code{shift} has a value of \code{0.0}. When negative or zero +values are present, data are shifted to be strictly positive. If +\code{invariant=TRUE} in the \code{find_transformation_parameters} function, +\code{lambda}, \code{shift} and \code{scale} parameters are optimised simultaneously.} + +\item{\code{scale}}{Numeric scale parameter for the Box-Cox transformation. If +\code{invariant=TRUE} in the \code{find_transformation_parameters} function, +\code{lambda}, \code{shift} and \code{scale} parameters are optimised simultaneously. +Otherwise, the \code{scale} parameter has a value of \code{1.0}.} + +\item{\code{complete}}{Indicates whether transformation parameters were set.} +}} + +\seealso{ +\link{find_transformation_parameters} +} diff --git a/man/transformation_yeo_johnson.Rd b/man/transformation_yeo_johnson.Rd new file mode 100644 index 0000000..e1e6ae0 --- /dev/null +++ b/man/transformation_yeo_johnson.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/TransformationYeoJohnson.R +\docType{class} +\name{transformationYeoJohnson-class} +\alias{transformationYeoJohnson-class} +\alias{transformationYeoJohnsonInvariant-class} +\title{Yeo-Johnson transformation object} +\description{ +This class is used for Yeo-Johnson transformations. +} +\section{Slots}{ + +\describe{ +\item{\code{method}}{Main transformation method, i.e. \code{"yeo_johnson"}.} + +\item{\code{robust}}{Indicates whether a robust version of the Yeo-Johnson +transformation is used to set transformation parameters. The value depends +on the \code{robust} argument of the \code{find_transformation_parameters} function.} + +\item{\code{lambda}}{Numeric lambda parameter for the Yeo-Johnson transformation.} + +\item{\code{shift}}{Numeric shift parameter for the Yeo-Johnson transformation. If +\code{invariant=TRUE} in the \code{find_transformation_parameters} function, +\code{lambda}, \code{shift} and \code{scale} parameters are optimised simultaneously. +Otherwise, the \code{shift} parameter has a value of \code{0.0}.} + +\item{\code{scale}}{Numeric scale parameter for the Yeo-Johnson transformation. If +\code{invariant=TRUE} in the \code{find_transformation_parameters} function, +\code{lambda}, \code{shift} and \code{scale} parameters are optimised simultaneously. +Otherwise, the \code{scale} parameter has a value of \code{1.0}.} + +\item{\code{complete}}{Indicates whether transformation parameters were set.} +}} + +\seealso{ +\link{find_transformation_parameters} +}