Gride: the Generalized Ratios ID EstimatorThe function can fit the Generalized ratios ID estimator under both the
frequentist and the Bayesian frameworks, depending on the specification of
the argument method. The model is the direct extension of the
TWO-NN method presented in
Facco et al., 2017
. See also Denti et al., 2022 \
for more details.
gride(
X = NULL,
dist_mat = NULL,
mus_n1_n2 = NULL,
method = c("mle", "bayes"),
n1 = 1,
n2 = 2,
alpha = 0.95,
nsim = 5000,
upper_D = 50,
burn_in = 2000,
sigma = 0.5,
start_d = NULL,
a_d = 1,
b_d = 1,
...
)# S3 method for gride_bayes
print(x, ...)
# S3 method for gride_bayes
summary(object, ...)
# S3 method for summary.gride_bayes
print(x, ...)
# S3 method for gride_bayes
plot(x, ...)
# S3 method for gride_mle
print(x, ...)
# S3 method for gride_mle
summary(object, ...)
# S3 method for summary.gride_mle
print(x, ...)
# S3 method for gride_mle
plot(x, ...)
a list containing the id estimate obtained with the Gride
method, along with the relative confidence or credible interval
(object est). The class of the output object changes according to the
chosen method. Similarly,
the remaining elements stored in the list reports a summary of the key
quantities involved in the estimation process, e.g.,
the NN orders n1 and n2.
data matrix with n observations and D variables.
distance matrix computed between the n observations.
vector of generalized order NN distance ratios.
the chosen estimation method. It can be
"mle"maximum likelihood estimation;
"bayes"estimation with the Bayesian approach.
order of the first NN considered. Default is 1.
order of the second NN considered. Default is 2.
confidence level (for mle) or posterior probability in
the credible interval (bayes).
number of bootstrap samples or posterior simulation to consider.
nominal dimension of the dataset (upper bound for the maximization routine).
number of iterations to discard from the MCMC sample.
Applicable if method = "bayes".
standard deviation of the Gaussian proposal used in the MH step.
Applicable if method = "bayes".
initial value for the MCMC chain. If NULL,
the MLE is used. Applicable if method = "bayes".
shape parameter of the Gamma prior distribution for d.
Applicable if method = "bayes".
rate parameter of the Gamma prior distribution for d.
Applicable if method = "bayes".
other arguments passed to specific methods.
object of class gride_mle.
It is obtained using the output of the gride function when
method = "mle".
object of class gride_mle, obtained from the function
gride_mle().
Facco E, D'Errico M, Rodriguez A, Laio A (2017). "Estimating the intrinsic dimension of datasets by a minimal neighborhood information." Scientific Reports, 7(1). ISSN 20452322, tools:::Rd_expr_doi("10.1038/s41598-017-11873-y").
Denti F, Doimo D, Laio A, Mira A (2022). "The generalized ratios intrinsic dimension estimator." Scientific Reports, 12(20005). ISSN 20452322, tools:::Rd_expr_doi("10.1038/s41598-022-20991-1").
# \donttest{
X <- replicate(2,rnorm(500))
dm <- as.matrix(dist(X,method = "manhattan"))
res <- gride(X, nsim = 500)
res
plot(res)
gride(dist_mat = dm, method = "bayes", upper_D =10,
nsim = 500, burn_in = 100)
# }
Run the code above in your browser using DataLab