1
我们如何制作不同层次的颜色以更好地看到R中的多元函数?我想检查功能是否拟凹和拟凸,但这些东西是很难在1一个彩色图看...R在多变量图中的颜色层
# Define Sequences for Multivariate Function
xf3x1 <- seq(-100, 100, length=500)
xf3x2 <- seq(-100, 100, length=500)
# Outer Calculates the Cartesian Product
z <- outer(xf3x1,xf3x2,function(xf3x1,xf3x2) xf3x1*xf3x2)
persp(xf3x1,xf3x2,z,col="lightgreen",theta=30,phi=20, main="Problème 3: Function 3")