transformer: Data-driven Uniform transformer.

Description Usage Arguments Value Examples

View source: R/transformer.R

Description

This function constructs a data-driven Uniform transformer to transform the distribution of x to a Uniform distribution, and returns the transformed data for the original data x and a new data newx.

Usage

1
transformer(x,newx,marginal=FALSE,type='constant')

Arguments

x

A data matrix/vector to construct the Uniform transformer

newx

A new data matrix/vector to be transformed.

marginal

An indicator for whether the Uniform transformer is constructed based on the marginal distribution or joint distribution. By defaul, marginal is FALSE, i.e., the Uniform transformer is constructed based on the joint distribution of x.

type

Type of the smooth kernel function used to approximate the density of the covariates in the control group. type should be one of 'constant', 'linear' and 'quadratic'.

Value

xt

Transformed data of x with the constructed Uniform transformer.

newxt

Transformed data of newx with the constructed Uniform transformer.

Examples

1
2
3
res=transformer(rnorm(100),rnorm(100,mean=0.5))
res$xt
res$newxt

lakerwsl/WUNT documentation built on Sept. 13, 2020, 12:15 a.m.