mdPartialMD2full

mdPartialMD2full Rescale partial squared Mahalanobis distances to the full-dimensional scale.

Syntax

  • d2_adj=mdPartialMD2full(d2, p, pobs)example
  • d2_adj=mdPartialMD2full(d2, p, pobs,Name,Value)example

Description

example

d2_adj =mdPartialMD2full(d2, p, pobs) Example 1: default principled EM rescaling.

example

d2_adj =mdPartialMD2full(d2, p, pobs, Name, Value) Example 2: chi-square mapping.

Examples

expand all

  • Example 1: default principled EM rescaling.
  • p = 5;
    n = 100;
    rho = 0.9;
    Sigma = (1-rho)*eye(p) + rho*ones(p);
    R = chol(Sigma);
    missRate = 0.01;
    Yfull = randn(n,p) * R;
    missMask = rand(n,p) < missRate;
    Y = Yfull;
    Y(missMask) = NaN;
    mu = mean(Yfull)';
    [d2partial,pobs] = mdPartialMD(Y,mu,Sigma);
    d2_adj = mdPartialMD2full(d2partial,p,pobs);

  • Example 2: chi-square mapping.
  • p = 5;
    n = 100;
    rho = 0.9;
    Sigma = (1-rho)*eye(p) + rho*ones(p);
    R = chol(Sigma);
    missRate = 0.01;
    Yfull = randn(n,p) * R;
    missMask = rand(n,p) < missRate;
    Y = Yfull;
    Y(missMask) = NaN;
    mu = mean(Yfull)';
    [d2partial,pobs] = mdPartialMD(Y,mu,Sigma);
    d2_adj = mdPartialMD2full(d2partial,p,pobs,'method','chiMap');

    Related Examples

    expand all

  • Example 3: principled EM rescaling.
  • p = 5;
    n = 100;
    rho = 0.9;
    Sigma = (1-rho)*eye(p) + rho*ones(p);
    R = chol(Sigma);
    missRate = 0.01;
    Yfull = randn(n,p) * R;
    missMask = rand(n,p) < missRate;
    Y = Yfull;
    Y(missMask) = NaN;
    mu = mean(Yfull)';
    [d2partial,pobs] = mdPartialMD(Y,mu,Sigma);
    d2_adj = mdPartialMD2full(d2partial,p,pobs,'method','pri');

  • Example 4: determinant-based rescaling.
  • p = 5;
    n = 100;
    rho = 0.9;
    Sigma = (1-rho)*eye(p) + rho*ones(p);
    R = chol(Sigma);
    missRate = 0.01;
    Yfull = randn(n,p) * R;
    missMask = rand(n,p) < missRate;
    Y = Yfull;
    Y(missMask) = NaN;
    mu = mean(Yfull)';
    outEM = mdEM(Y,'condmeanimp',true);
    SigHat = outEM.cov;
    [d2partial,pobs] = mdPartialMD(Y,mu,SigHat);
    d2_adj = mdPartialMD2full(d2partial,p,pobs,'method','detMap', ...
    'Y',Y,'Sigma',SigHat);

    Input Arguments

    expand all

    d2 — squared partial distances. Vector.

    Vector of length n containing the squared Mahalanobis distances computed using only the observed variables for each row.

    Data Types: single | double

    p — full dimension. Positive integer scalar.

    p is the number of variables in the original data matrix.

    Data Types: single | double

    pobs — number of observed variables. Vector.

    Vector of length n containing the number of observed variables for each row.

    Data Types: single | double

    Name-Value Pair Arguments

    Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

    Example: 'method','chiMap' , 'Y',Y , 'Sigma',Sigma

    method —method used to rescale the distances.string scalar | char vector.

    Possible values are.

    'pri' : principled EM rescaling (default), d2_partial + (p - pobs).

    'expScale' : expectation scaling, d2_partial * (p / pobs).

    'zMap' : standardization mapping, p + sqrt(2*p) * ((d2_partial - pobs) ./ sqrt(2*pobs)).

    'detMap' : determinant-based rescaling, d2_partial * (p / pobs) * (g_full / g_obs) This method requires input option 'Y' and input option 'Sigma'.

    'chiMap' : chi-square quantile mapping. Use the cdf and inverse of the cdf of Chi2 distribution.

    'betaMap' : Beta quantile mapping. Use the cdf and inverse of the cdf of Beta distribution.

    Example: 'method','chiMap'

    Data Types: string scalar | char vector

    Y —original data matrix with possible missing values.matrix.

    n x p data matrix. This input is required only if method='detMap'.

    Example: 'Y',Y

    Data Types: single | double

    Sigma —covariance matrix in the full space.matrix.

    p x p covariance matrix. This input is required only if method='detMap'.

    Example: 'Sigma',Sigma

    Data Types: single | double

    Output Arguments

    expand all

    d2_adj —adjusted squared distances. Vector

    Column vector of length n containing the adjusted squared Mahalanobis distances on the full p-dimensional scale.

    If pobs(i)=0 or d2(i) is NaN, the corresponding output is NaN.

    More About

    expand all

    Additional Details

    The available methods are: 'pri' : principled EM rescaling 'expScale' : expectation scaling 'zMap' : standardization mapping 'detMap' : determinant-based rescaling 'chiMap' : chi-square mapping 'betaMap' : Beta mapping References: Little, R. J. A., & Rubin, D. B. (2020). Statistical Analysis with Missing Data (3rd ed.). Hoboken, NJ: John Wiley & Sons.

    Wilks, S. S. (1962). Mathematical Statistics. John Wiley & Sons, New York.

    Copyright 2008-2026.

    Written by FSDA team <a href="matlab: docsearchFS('mdPartialMD2full')">Link to the help page for this function</a>

    References

    Little, R. J. A., & Rubin, D. B. (2020). Statistical Analysis with Missing Data (3rd ed.). Hoboken, NJ: John Wiley & Sons.

    Wilks, S. S. (1962). Mathematical Statistics. John Wiley & Sons, New York.

    This page has been automatically generated by our routine publishFS