Description Usage Arguments Value Author(s) See Also Examples
View source: R/denpro.R View source: R/draw.pcf.R
Computes 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".
1 2 |
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 |
minval |
real number, gives the level of the basis plane of the picture, one takes "minval" typically to be the minimum value of the function (for densities it would be zero) |
drawkern |
TRUE or FALSE; internal parameter; when one wants to use function "drawkern" for calculation, then one should specify drawkern=TRUE, this can be used in the case that "pcf" is a kernel density estimate |
in the 2D case list of vectors "x" and "y" and matrix "z", in the 1D case list of vectors "x" and "y"
Jussi Klemela
pcf.kern
,
pcf.func
,
persp
,
contour
,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.