Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
Statistics[KernelDensityPlot] - plot the kernel density estimate of a data set
Calling Sequence
KernelDensityPlot(X, options, plotoptions)
KernelDensityPlot['interactive'](X)
Parameters
X
-
data
options
(optional) equation(s) of the form option=value where option is one of bandwidth, bins, ignore, kernel, left, method, range, right, weights, or any standard plot options; specify options for the KernelDensityPlot command
plotoptions
options to be passed to the plots[display] command
Description
The KernelDensityPlot command plots the kernel density estimate for a data sample.
The first parameter X is a single data sample - given as a Vector or list.
Options
The options argument can contain one or more of the options shown below. All unrecognized options will be passed to the plots[display] command. See plot[options] for details.
bandwidth=realcons
The bandwidth is a positive quantity that specifies the width of the kernel (the amount each data point affects distant portions of the probability density estimate). Each kernel is scaled such that the bandwidth is equal to the standard deviation of the kernel.
bins=posint
The number of bins in which to categorize data points (512 by default). This value must be a power of 2 and is equal to the size of the array returned from the routine when the option method=piecewise is specified. This parameter is ignored if method=exact.
ignore=truefalse
This option is used to specify how to handle non-numeric data. If ignore is set to true all non-numeric items in data will be ignored.
kernel=gaussian, biweight, epanechnikov, triangular, or rectangular
The default value is gaussian. This option allows a non-gaussian kernel to be used in developing the estimate. For more information, see Statistics[KernelDensity].
left=realcons
This option specifies the lower boundary on valid data values. Any data values that are smaller than this value are discarded. By default, this procedure will impose boundary conditions consistent with the specified range rng.
method=exact or piecewise
This parameter specifies the method of plotting the kernel density estimate (by default this is piecewise). For more information, see Statistics[KernelDensity].
range=deduce or realrange
By default this is deduce. This option is used to bound the horizontal real range on which the kernel density estimate is plotted.
right=realcons
This option specifies the upper boundary on valid data values. Any data values that are smaller than this value are discarded. By default, this procedure will impose boundary conditions consistent with the specified range rng.
weights=rtable
Vector of weights (one-dimensional rtable). If weights are given, the kernel density estimate will be scaled so each data point has the given weight. Note that the weights provided must have type realcons and the results are floating-point, even if the problem is specified with exact values. Both the data array and the weights array must have the same number of elements.
Notes
Note that the discrete case of kernel density estimation employs a discrete fourier transform in order to calculate the kernel sums as quickly as possible. However, this results in an estimating function which is periodic over the range left..right. Hence estimates near these lower and upper boundaries of the range will often be more imprecise than points within this range.
Note that points that do not fall into the range left..right and missing data are not considered for this operation and are normally discarded. If ignore=false and this procedure encounters missing data, it will spawn a userinfo message.
Note that all options specified in calling this command that are not parsed by KernelDensity are then passed to plot.
Examples
Plot the kernel density estimate of a data sample.
The command to create the plot from the Plotting Guide is
See Also
Statistics, Statistics[Computation], Statistics[KernelDensity], Statistics[KernelDensitySample]
Download Help Document