MNS: Multivariate Normal Scores

View source: R/MultivariateNormalScores.R

MNSR Documentation

Multivariate Normal Scores

Description

Get conditional or unconditional multivariate normal score (NS) of observations (X) relative to previous observations (Y).

Usage

MNS(
  X,
  Y = NULL,
  theta = NULL,
  Ftheta = NULL,
  scoring = "Z",
  alignment = "unadjusted",
  constant = NULL,
  absolute = FALSE
)

Arguments

X

matrix or data.frame. New observations to obtain the normal scores.

Y

matrix or data.frame. If Y is not defined (no previous observation available, NULL), NS is relative to X. Default NULL.

theta

vector. Value corresponding with the Ftheta quantile.

Ftheta

vector. Quantile of the data distribution. The values that take are between (0,1).

scoring

character string. If "Z" (normal scores) (default). If "Z-SQ" (normal scores squared).

Value

Multiple output. Select by output$

  • R: matrix. Multivariate Ranks for the X observations. If ties occurs, average ranks are used.

  • P: matrix. Multivariate Probability of the ranks for the X observations. Instead of Van Der Waerden normal scores where P = R/(n+1), P = (R-0.5)/n, where R stands for rank and P for the input evaluated in the inverse of a Standard Normal Distribution.

  • Z: matrix. Multivariate Normal scores for the X observations. Z if scoring is "Z" and Z^2 if scoring is "Z-SQ".

Examples

Y <- c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
Y = matrix(Y, ncol=2)
X <- c(30, 35, 45, 30, 35, 45)
X = matrix(X, ncol=2)
theta <- c(40, 40)
Ftheta <- c(0.5, 0.5)
# EXAMPLE CONDITIONAL
MNS(X = X, Y = Y, theta = theta, Ftheta = Ftheta)

LuisBenavides/SNS.test documentation built on June 25, 2022, 11:52 p.m.