sbgcop.mcmc
is used to semiparametrically estimate the parameters of
a Gaussian copula. It can be used for posterior inference on the copula
parameters, and for imputation of missing values in a matrix of ordinal
and/or continuous values.
sbgcop.mcmc(Y, S0 = diag(dim(Y)[2]), n0 = dim(Y)[2] + 2, nsamp = 100,
odens = max(1, round(nsamp/1000)), impute = any(is.na(Y)),
plugin.threshold = 100, plugin.marginal = (apply(Y, 2, function(x) {
length(unique(x)) }) > plugin.threshold), seed = 1, verb = TRUE)
an n x p matrix. Missing values are allowed.
a p x p positive definite matrix
a positive integer
number of iterations of the Markov chain.
output density: number of iterations between saved samples.
save posterior predictive values of missing data(TRUE/FALSE)?
if the number of unique values of a variable exceeds this integer, then plug-in the empirical distribution as the marginal.
a logical of length p. Gives finer control over which margins to use the empirical distribution for.
an integer for the random seed
print progress of MCMC(TRUE/FALSE)?
An object of class psgc
containing the following components:
an array of size p x p x nsamp/odens
, consisting of
posterior samples of the correlation matrix.
the original datamatrix with imputed values replacing missing data
an
array of size n x p x nsamp/odens
, consisting of copies of the
original data matrix, with posterior samples of missing values included.
the log-probability of the latent variables at each saved sample. Used for diagnostic purposes.
This function produces MCMC samples from the posterior distribution of a correlation matrix, using a scaled inverse-Wishart prior distribution and an extended rank likelihood. It also provides imputation for missing values in a multivariate dataset.
http://www.stat.washington.edu/hoff/
# NOT RUN {
fit<-sbgcop.mcmc(swiss)
summary(fit)
plot(fit)
# }
Run the code above in your browser using DataLab