Learn R Programming

Rdimtools (version 0.3.2)

est.boxcount: Box-counting dimension

Description

Box-counting dimension, also known as Minkowski-Bouligand dimension, is a popular way of figuring out the fractal dimension of a set in a Euclidean space. Its idea is to measure the number of boxes required to cover the set repeatedly by decreasing the length of each side of a box. It is defined as $$dim(S) = \lim \frac{\log N(r)}{\log (1/r)}$$ as \(r\rightarrow 0\), where \(N(r)\) is the number of boxes counted to cover a given set for each corresponding \(r\).

Usage

est.boxcount(X, nlevel = 50, show = FALSE)

Arguments

X

an (n-by-p) matrix or data frame whose rows are observations.

nlevel

the number of r (radius) to be tested.

show

a logical; FALSE for not showing visually, TRUE otherwise.

Value

a named data frame containing

r

a vector of radius used.

Nr

a vector of boxes counted for each corresponding r.

Determining the dimension

In this version, no automated method is included due to lots of possibilities for adopting any types of change point detection methods. Instead, we recommend using visual identification by looking at the slope of the linear part in the middle using either show=TRUE flag or plotting as plot(log(1/output$r),log(output$Nr)).

References

Ott, E. (1988) Chaos in Dynamical Systems. Cambridge University Press.

See Also

est.correlation

Examples

Run this code
# NOT RUN {
## generate three different dataset
X1 = aux.gensamples(dname="swiss")
X2 = aux.gensamples(dname="ribbon")
X3 = aux.gensamples(dname="twinpeaks")

## visually verify : all should have approximate slope of 2.
par(mfrow=c(1,3))
est.boxcount(X1,show=TRUE)
est.boxcount(X2,show=TRUE)
est.boxcount(X3,show=TRUE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab