# NOT RUN {
## univariate example
data(unicef)
fhat1 <- kdde(x=unicef[,1], deriv.order=1) ## gradient [df/dx, df/dy]
plot(fhat1, xlab="Under-5") ## df/dx
points(30,predict(fhat1, x=30))
## bivariate example
fhat2 <- kdde(x=unicef, deriv.order=2)
plot(fhat2, which.deriv.ind=2, display="persp", phi=20)
plot(fhat2, which.deriv.ind=2, display="filled.contour2", col.fun=topo.colors)
## d^2 f/(dx dy): purple=-ve, green=zero, beige=+ve
# }
Run the code above in your browser using DataLab