Estimate the gradient of an undefined surface
问题 I want to estimate the gradient (slope and aspect) of an undefined surface (i.e., the function is unknown). To test my methods, here is the test data: require(raster); require(rasterVis) set.seed(123) x <- runif(100, min = 0, max = 1) y <- runif(100, min = 0, max = 1) e <- 0.5 * rnorm(100) test <- expand.grid(sort(x),sort(y)) names(test)<-c('X','Y') z1 <- (5 * test$X^3 + sin(3*pi*test$Y)) realy <- matrix(z1, 100, 100, byrow = F) # And a few plots for demonstration # persp(sort(x), sort(y),