bcmds {smacofx} | R Documentation |
Box-Cox MDS
Description
This function minimizes the Box-Cox Stress of Chen & Buja (2013) via gradient descent. This is a ratio metric scaling method. The transformations are not straightforward to interpret but mu is associated with fitted distances in the configuration and lambda with the dissimilarities. Concretely for fitted distances (attraction part) it is BC_{mu+lambda}(d(X))
and for the repulsion part it is delta^lambda BC_{mu}(d(X))
with BC being the one-parameter Box-Cox transformation.
Usage
bcmds(
delta,
mu = 1,
lambda = 1,
rho = 0,
type = "ratio",
ndim = 2,
weightmat = 1 - diag(nrow(delta)),
itmax = 2000,
init = NULL,
verbose = 0,
addD0 = 1e-04,
principal = FALSE,
normconf = FALSE
)
bcStressMin(
delta,
mu = 1,
lambda = 1,
rho = 0,
type = "ratio",
ndim = 2,
weightmat = 1 - diag(nrow(delta)),
itmax = 2000,
init = NULL,
verbose = 0,
addD0 = 1e-04,
principal = FALSE,
normconf = FALSE
)
bcstressMin(
delta,
mu = 1,
lambda = 1,
rho = 0,
type = "ratio",
ndim = 2,
weightmat = 1 - diag(nrow(delta)),
itmax = 2000,
init = NULL,
verbose = 0,
addD0 = 1e-04,
principal = FALSE,
normconf = FALSE
)
boxcoxmds(
delta,
mu = 1,
lambda = 1,
rho = 0,
type = "ratio",
ndim = 2,
weightmat = 1 - diag(nrow(delta)),
itmax = 2000,
init = NULL,
verbose = 0,
addD0 = 1e-04,
principal = FALSE,
normconf = FALSE
)
Arguments
delta |
dissimilarity or distance matrix, dissimilarity or distance data frame or 'dist' object |
mu |
mu parameter. Should be 0 or larger for everything working ok. If mu<0 it works but I find the MDS model is strange and normalized stress tends towards 0 regardless of fit. Use normalized stress at your own risk in that case. |
lambda |
lambda parameter. Must be larger than 0. |
rho |
the rho parameter, power for the weights (called nu in the original article). |
type |
what type of MDS to fit. Only "ratio" currently. |
ndim |
the dimension of the configuration |
weightmat |
a matrix of finite weights. Not implemented. |
itmax |
number of optimizing iterations, defaults to 2000. |
init |
initial configuration. If NULL a classical scaling solution is used. |
verbose |
prints progress if > 3. |
addD0 |
a small number that's added for D(X)=0 for numerical evaluation of worst fit (numerical reasons, see details). If addD0=0 the normalized stress for mu!=0 and mu+lambda!=0 is correct, but will give useless normalized stress for mu=0 or mu+lambda!=0. |
principal |
If 'TRUE', principal axis transformation is applied to the final configuration |
normconf |
normalize the configuration to sum(delta^2)=1 (as in the power stresses). Default is FALSE. Note that then the distances in confdist do not match manually calculated ones. |
Details
For numerical reasons with certain parameter combinations, the normalized stress uses a configuration as worst result where every d(X) is 0+addD0. The same number is not added to the delta so there is a small inaccuracy of the normalized stress (but negligible if min(delta)>>addD0). Also, for mu<0 or mu+lambda<0 the normalization cannot generally be trusted (in the worst case of D(X)=0 one would have an 0^(-a)).
Value
an object of class 'bcmds' (also inherits from 'smacofP'). It is a list with the components
delta: Observed, untransformed dissimilarities
tdelta: Observed explicitly transformed dissimilarities, normalized
dhat: Explicitly transformed dissimilarities (dhats)
confdist: Configuration dissimilarities
conf: Matrix of fitted configuration
stress: Default stress (stress 1; sqrt of explicitly normalized stress)
ndim: Number of dimensions
model: Name of MDS model
type: Must be "ratio" here.
niter: Number of iterations
nobj: Number of objects
pars: hyperparameter vector theta
weightmat: 1-diagonal matrix. For compatibility with smacofP classes.
parameters, pars, theta: The parameters supplied
call the call
and some additional components
stress.m: default stress is the explicitly normalized stress on the normalized, transformed dissimilarities
mu: mu parameter (for attraction)
lambda: lambda parameter (for repulsion)
rho: rho parameter (for weights)
Author(s)
Lisha Chen & Thomas Rusch
Examples
dis<-smacof::kinshipdelta
res<-bcmds(dis,mu=2,lambda=1.5,rho=0)
res
summary(res)
plot(res)