ksmooth2: Plot/estimate surface

Description Usage Arguments Examples

View source: R/zksmooth.R

Description

Plot/estimate surface

Usage

1
2
ksmooth2(x, data, h = NULL, xlab = NULL, ylab = NULL, zlab = "",
  gridsize = rep(51L, 2), ...)

Arguments

x

formula or data

data

data.frame

h

bandwidth

xlab

X label

ylab

Y label

zlab

Z label

gridsize

grid size of kernel smoother

...

Additional arguments to graphics routine (persp3d or persp)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
ksmooth2(rmvn(1e4,sigma=diag(2)*.5+.5),c(-3.5,3.5),h=1)
ksmooth2(rmvn(1e4,sigma=diag(2)*.5+.5),c(-3.5,3.5),h=1,
        rgl=FALSE,theta=30)

ksmooth2(function(x,y) x^2+y^2, c(-20,20))
ksmooth2(function(x,y) x^2+y^2, xlim=c(-5,5), ylim=c(0,10))

f <- function(x,y) 1-sqrt(x^2+y^2)
surface(f,xlim=c(-1,1),alpha=0.9,aspect=c(1,1,0.75))
surface(f,xlim=c(-1,1),clut=heat.colors(128))
##play3d(spin3d(axis=c(0,0,1), rpm=8), duration=5)

ksmooth2(f,c(-1,1),rgl=FALSE,image=fields::image.plot)

surface(function(x) dmvn(x,sigma=diag(2)),c(-3,3),lit=FALSE,smooth=FALSE,box=FALSE,alpha=0.8)

lava documentation built on May 2, 2019, 4:49 p.m.