draw.pcf {denpro}R Documentation

Prepares the plotting of a 2D or 1D piecewise constant function

Description

Calculates x, y, and z arguments for a piecewise constant function, to be used in "persp" or "contour" functions, or the "x" and "y" arguments to be used in "plot".

Usage

draw.pcf(pcf, pnum = rep(32,length(pcf$N)), corona = 5, dens=FALSE)

Arguments

pcf piecewise constant function; output of "pcf.kern" or "pcf.func"
pnum vector of 2 positive integers; dimension of the grid where the function will be plotted; not needed in the 1D case
corona positive integer; gives the number of zeros around the support of the function; the plots look better when there are a corona of zeros around the function
dens TRUE for densities, used in the 1D case instead of the corona

Value

in the 2D case list of vectors "x" and "y" and matrix "z", in the 1D case list of vectors "x" and "y"

Author(s)

Jussi Klemelä

See Also

pcf.kern, pcf.func, persp, contour,

Examples

# 2D case
dendat<-sim.data(n=100,type="mulmod")
pcf<-pcf.kern(dendat,h=1,N=c(32,32))

dp<-draw.pcf(pcf,pnum=c(30,30))

contour(dp$x,dp$y,dp$z,drawlabels=FALSE)

persp(dp$x,dp$y,dp$z)

# 1D case
set.seed(1)
dendat<-matrix(rnorm(20),20)   #10*1 data-matrix
pcf<-pcf.kern(dendat,h=1,N=c(25))

dp<-draw.pcf(pcf)

plot(dp$x,dp$y,type="l")


[Package denpro version 0.8.1 Index]