############################# ##DATE: 06/07/10 ##AUTHOR: Dan McGlinn ##CONTACT: dmcglinn@email.unc.edu ##PURPOSE: to provide algorithims that: ##1) give an example of how to use the function 'midpoint' from the ##package 'FieldSim' ##Literature Cited: ##Brouste, A., S. Lambert-Lacroix, and J. Istas. 2007. On Gaussian random fields simulation. Journal of Statistical Software 1:23. ############################# library(FieldSim) ##Currently FieldSim must be version 2.1 because the function 'midpoint' is not available in version 3.1 of FieldSim. ##However, Alexandre Brouste told me that he plans to include 'midpoint' on forthcoming releases of this package library(dichromat) ##for pretty colors cls<-colorRampPalette(colorschemes\$BluetoOrange.12,space="Lab")(100) D <- c(2.01,2.5,2.95) ##fractal dimension H <- 3-D ##Hurst parameter res1 <- midpoint(H=H[1],nblevel=8)##nblevel sets the size of the grid res2 <- midpoint(H=H[2],nblevel=8) res3 <- midpoint(H=H[3],nblevel=8) par(mfrow=c(1,3)) image(res1\$Z,col=cls,axes=F) image(res2\$Z,col=cls,axes=F) image(res3\$Z,col=cls,axes=F) 3-quadvar(res1\$Z) 3-quadvar(res2\$Z) 3-quadvar(res3\$Z) ##these are very close to the D-values we input