18_PD_kernel_and_empicial: Nonparametric Distributions

Description Usage Arguments Details Value References See Also Examples

Description

Bivariate kernel density estimates and bivariate empirical cumulative distribution functions.

Usage

1
2
3
4
5
#kernel density estimates
kbvpdf (x, y, xbw, ybw, ..., xsmoothness=1, ysmoothness=1, data)

#ecdf
ebvcdf (x, y, ..., data)

Arguments

x, y

Equal length numeric vectors, of x and y values.
Ignored, if data is provided.

xbw, ybw

Optional numeric values, giving the x and y bandwidths.

xsmoothness, ysmoothness

Numeric scalars, giving the relative smoothness.
(Initial default bandwidth parameters are multiplied by the smoothness parameters).
Ignored, if the corresponding bandwidth parameters are provided.

data

A two-column data.frame object.

...

Ignored.

Details

Default xlab and ylab labels are taken for deparsed x and y names.
(Unless data is provided, in which case, column names are used).

Bandwidth parameters are optional, however, the default values are likely to be sub-optimal.

Kernel density estimates use KernSmooth::bkde2D.

Value

Self-referencing S4-based function objects.

Refer to Function Objects.

Note that you can't evaluate the function representing kernel density estimates.
(However, the bvmat function can be used to compute density matrices).

References

Refer to the vignette for an overview, references, theoretical background and better examples.

Note that the probhat package provides more tools for kernel smoothing.

See Also

Uniform
For uniform distributions.

Binomial, Poisson and Categorical
For other probability distributions of discrete random variables.

Normal, Bimodal and Dirichlet
For other probability distributions of continuous random variables.

Main Plotting Functions

Density Matrices

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
########################################
#kernel density estimates
########################################
data ("geyser", package="MASS")
attach (geyser)

#adapted from the KernSmooth package
fh <- kbvpdf (duration, waiting, 0.7, 7)

plot (fh,, TRUE)
plot (fh, TRUE, z.axis=TRUE, ref.arrows=FALSE)

detach (geyser)

########################################
#ECDF
########################################
attach (trees)

Fh <- ebvcdf (Height, Volume)

plot (Fh)
plot (Fh, FALSE)

Fh (median (Height), mean (Volume) )

detach (trees)

bivariate documentation built on April 11, 2021, 9:06 a.m.