| KDE {fractal} | R Documentation |
Given a training matrix, this function estimates a multidimensional probability density function using the Epanechnikov kernel as a smoother. The density function is estimated at a specified and arbitrary set of points, i.e., at points not necessarily members of the training set.
KDE(x, at=NULL, n.grid=100)
x |
a matrix whose columns contain the coordinates for each dimension. Each row represents the location of a single point in a multidimensional embedding. |
at |
the locations of the points over which the KDE is to be
calculated. Default: a multidimensional uniform grid of points spanning
the training data space (defined by x). |
n.grid |
the number of divisions per dimension to using in forming
the default grid when the at input is unspecified. Default: 100. |
The kernel bandwidth is constant (non-adaptive) and is
determined by first computing the minimum variance
of all dimensions (columns) of x. This minimum variance
is then used in Scott's Rule to compute the final bandwidth.
This function is primarily used for estimating the mutual information of a time series and is included here for illustrative purposes.
an object of class KDE.
x is a single variable
(a time series), only the KDE is plotted."original", "perspective", and "contour" for plotting the
original training data, a perspective plot of the KDE, or a contour plot of
the KDE over the specifed dimensions. In the case that the primary input x is a single variable
(a time series), this parameter is automatically set to unity and a KDE is plotted.
Default: "original".x is a single variable
(a time series), this parameter is automatically set to unity and a KDE is plotted.
Default: 1:2 for multivariate training data, 1 for univariate training data.dimnames of the specified
dimensions of the training data. If missing, "X" is used. For univariate training data,
the x-axis label is set to the name of the original time series.dimnames of the specified
dimensions of the training data. If missing, "Y" is used. For univariate training data,
the y-axis label is set to "KDE"."KDE".TRUE, a grid is plotted for the "original" style plot.
Default: "FALSE".prettPrintList. Default: "left".prettyPrintList. Default: ":".prettyPrintList function).
## create a mixture of 2-D Gaussian distributed
## RVs with different means, standard
## deviations, point density, and orientation.
n.sample <- c(1000, 500, 300)
ind <- rep(1:3, n.sample)
x <- rmvnorm(sum(n.sample),
mean = rbind(c(-10,-20), c(10,0), c(0,0))[ ind, ],
sd = rbind(c(5,3), c(1,3) , c(0.3,1))[ ind, ],
rho = c(0.5, 1, -0.4)[ind])
## perform the KDE
z <- KDE(x)
print(z)
## plot a summary of the results
eda.plot(z)
## form KDE of beamchaos series
plot(KDE(beamchaos),type="l")