# NOT RUN {
library(RandomFields)
x <- seq(0, 10000)
# generate a random field
truealpha <- 1.5
rf <- GaussRF(x = x, model = "stable", grid = TRUE,
param = c(mean=0, variance=1, nugget=0, scale=100,
alpha=truealpha))
#compute fractal dimension using various methods
methods <- c("madogram", "variogram", "hallwood", "boxcount",
"periodogram","dctII", "wavelet")
fdts <- fd.estimate (rf, methods = methods, window.size = 500,
step.size = 100, nlags = 10, trim = FALSE, debuglevel = 3)
# plot the variation
cols <- rainbow(length(methods))
plot(ts(fd.get (fdts, methods[1])$fd),ylim=c(min(fdts$fd), max(fdts$fd)),
ylab="fd", col=cols[1])
for (imeth in 2:length(methods))
lines(ts(fd.get (fdts, methods[imeth])$fd), col=cols[imeth])
legend('topleft', legend=methods, col=cols, lwd=1)
abline(h=2-truealpha/2)
# }
Run the code above in your browser using DataLab