Projection and reverse transformation for nonparanormal and Zscore transformations, reusing parameters to project a new dataset on the same scale as previous one, or reverse the transformation into the original scale.
You can install the development version of projectNPN from GitHub with:
# install.packages("devtools")
devtools::install_github("AlexWeinreb/projectNPN")
We have data following a given distribution, e.g. $N(12, 5)$. We can
apply a Z-score transformation (subtracting the mean and dividing by the
sd) to obtain transformed data that follows
What this package implements is a Z-score, returning the original mean and sd along with the transformed data. This allows two things: first, we can now have a new dataset from the same distribution and transform it into the same scale as the first dataset, without computing statistics on it. Second, we can now reverse the transformation, given the transformed data and the original mean and sd.
While the Z-score is an intuitive example, we also implement the same
method for the NPN transform (from the {huge}
package).
The functions here expect the data to be provided in matrices, and operate on each column of the matrix as a separate variable.