x <- y <- matrix( 0, 50, 50)
x[ sample(1:50,10), sample(1:50,10)] <- rexp( 100, 0.25)
y <- disk2dsmooth( x=x, lambda=6.5)
x <- gauss2dsmooth( x=x, lambda=3, nx=25, ny=25)
par( mfrow=c(1,2))
image.plot( x, col=tim.colors(256))
image.plot( y, col=tim.colors(256))
hold <- hoods2dPrep("y", "x", thresholds=c(0.1, 0.5), levels=c(1, 3, 20), smooth.fun="gauss2dsmooth", smooth.params=list(nx=601, ny=501))
look <- hoods2d( hold, which.methods=c("fss"))
plot( look)
data( pert000)
data(pert004)
# Do the neighborhood methods with averaging performed over a radius instead of the lambda^2 nearest neighbors.
# The smoothing parameters are determined by the levels argument, and the others are passed via smooth.params.
hold <- hoods2dPrep( "pert004", "pert000", thresholds=c(1,2,5,10,20,50), levels=c(1, 3, 9, 17, 33, 65, 129, 257),
smooth.fun="disk2dsmooth")
look <- hoods2d(hold, verbose=TRUE)
look
Run the code above in your browser using DataLab