[R] Unexpected behaviour with MBA algorithm

"Martin Häcker" red-m at gmx.de
Mon Dec 6 09:13:08 CET 2010


Hello helpers,

I get some curious results, when I apply the MBA algorithm to my test set of scattered points.

I'm using R v2.11.1 on Win XP with the package MBA v0.0-7 installed.

Here is my code:

rm(list=ls(all=TRUE))
library(MBA)
library(fields)
#regular 3x3 grid with all values zero, except for (0,0)
points<-matrix(c(-7.5,-7.5,0,0,-7.5,0,7.5,-7.5,0,-7.5,0,0,0,0,1,7.5,0,0,-7.5,7.5,0,0,7.5,0,7.5,7.5,0),ncol=3,byrow=T)
#by using all coordinates multiplied by 10, everything looks fine
#points[,1:2]<-points[,1:2]*10
mba<-mba.surf(points[,1:3], m = 1, n = 1, no.X=51, no.Y=51, extend=TRUE, h=9)$xyz.est
surface(mba)

Running this code, will result in a surface with a maximum located near (-2,-2). I would expect a maximum near (0,0) as in my dataset. The expected result I get with all point coordinates multiplied by 10, but multiplying them all by 100 turns back to the asymmetric surface.

Could somebody tell me, if this is an effect of the MBA algorithm itself or just an implementational error?


Kind regards

Martin



More information about the R-help mailing list