Learn R Programming

spinifex (version 0.3.10)

ide: Intrinsic dimension estimation (ide).

Description

This function estimates the intrinsic dimension of a dataset using several algorithms from the Rdimtools package. This is used to inform the number of dimension that should be kept when embedding data.

Usage

ide(data, inc_slow = FALSE)

Value

A named vector of estimated intrinsic dimensions. The names correspond to the Rdimtools function used for each estimate. NA is returned for any method that fails to run.

Arguments

data

A matrix or data frame containing the data to be analyzed.

inc_slow

A logical value indicating whether to include the more computationally expensive methods in the estimation. If TRUE, add 6 more expensive methods. Defaults to FALSE.

Examples

Run this code
# Use a tourr dataset with the default (fast) methods
dat <- spinifex::weather_na.rm[, 2:18]
(result <- ide(data = dat, inc_slow = FALSE))

# The result is a named vector, which can be summarized
summary(result)
# This suggests 6 or so dimensions may be sufficient embedding
# to describe the original 17 variables.

# Or visualized
hist(result)

# Note: Including 'inc_slow = TRUE' can take considerably longer
# to run for larger datasets.
if (FALSE) {
# Run all methods, including the slower ones, on a larger dataset
system.time(ide_long <- ide(dat, inc_slow = TRUE))
}

Run the code above in your browser using DataLab