ide: Intrinsic dimension estimation (ide).

View source: R/0_util.r

ideR Documentation

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)

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.

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.

Examples

# 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.
## Not run: 
# Run all methods, including the slower ones, on a larger dataset
system.time(ide_long <- ide(dat, inc_slow = TRUE))

## End(Not run)


spinifex documentation built on Nov. 5, 2025, 7:43 p.m.