bmds | R Documentation |
Provide object configuration and estimates of parameters, for number of dimensions from min_p to max_p
bmds(DIST,min_p=1, max_p=6,nwarm = 1000,niter = 5000,...)
DIST |
symmetric data matrix of dissimilarity measures for pairs of objects |
min_p |
minimum number of dimensions for object configuration (default=1) |
max_p |
maximum number of dimensions for object configuration (default=6) |
nwarm |
number of iterations for burn-in period in MCMC (default=1000) |
niter |
number of MCMC iterations after burn-in period (default=5000) |
... |
arguments to be passed to methods. |
Model
The basic model for Bayesian multidimensional scaling given in Oh and Raftery (2001) is as follows. Given the number of dimensions p, we assume that an observed dissimilarity measure follows a truncated multivariate normal distribution with mean equal to Euclidean distance, i.e.,
d_{ij} \sim N ( δ_{ij}, σ^2 )I( d_{ij} > 0), independently for i \ne j, i,j=1, \cdots,n,
where
n is the number of objects, i.e, numner of rows in DIST
d_{ij} is an observed dissimilarity measure between objects i and j
δ_{ij} is the distance between objects i and j in a p-dimensional Euclidean space, i.e.,
δ_{ij} = √{ ∑_{k=1}^p (x_{ik}-x_{jk})^2 }
x_i=(x_{i1},...,x_{ip}) denotes the values of the attributes possessed by object i, i.e., the coordinates of object i in a p-dimensional Euclidean space.
Priors
Prior distribution of x_i is given as a multivariate normal distribution with mean 0 and a diagonal covariance matrix Λ, i.e., x_i \sim N(0,Λ), independently for i = 1,\cdots,n. Note that the zero mean and diagonal covariance matrix is assumed because Euclidean distance is invariant under translation and rotation of X=\{x_i\}.
Prior distribution of the error variance σ^2 is given as σ^2 \sim IG(a,b), the inverse Gamma distribution with mode b/(a+1).
Hyperpriors for the elements of Λ = diag (λ_1,...,λ_p) are given as λ_j \sim IG(α, β_j), independently for j=1,\cdots,p.
We assume prior independence among X, Λ,σ^2.
Measure of fit
A measure of fit, called STRESS, is defined as
STRESS =√{{∑_{i > j} (d_{ij}-\hat{δ}_{ij})^2 } \over {∑_{i > j} d_{ij}^2 }},
where \hat{δ}_{ij} is the Euclidean distance between objects i and j, computed from the estimated object configuration. Note that the squared STRESS is proportional to the sum of squared residuals, SSR=∑_{i > j} (d_{ij}-\hat{δ}_{ij})^2.
in bmds
object
number of objects, i.e., number of rows in DIST
minimum number of dimensions
maximum number of dimensions
number of MCMC iterations
number of burn-in in MCMC
the following lists contains objects from bmdsMCMC
for number of dimensions from min_p to max_p
a list of object configurations
a list of minimum sum of squares of residuals between the observed dissimilarities and the estimated Euclidean distances between pairs of objects
a list of the indecies of the iteration corresponding to minimum SSR
a list of STRESS values
a list of posterior mean of σ^2
a list of posterior variance of σ^2
a list of posterior samples of SSR
a list of posterior samples of elements of Λ
a list of posterior samples of σ^2, the error variance
a list of posterior samples of δs,Euclidean distances between pairs of objects)
a list of object configuration from the classical multidimensional scaling of Togerson(1952)
a list of outputs from bmdsMCMC founction for each number of dimensions
Oh, M-S., Raftery A.E. (2001). Bayesian Multidimensional Scaling and Choice of Dimension, Journal of the American Statistical Association, 96, 1031-1044.
Torgerson, W.S. (1952). Multidimensional Scaling: I. Theory and Methods, Psychometrika, 17, 401-419.
data(cityDIST) out <- bmds(cityDIST)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.