Description Usage Arguments Details Value Author(s) References Examples
Functions to identify the peak of a probability density distribution using a Gaussian kernel
estimator (kernestim
), a fixed-width histogram estimator (histestim
), and a
distance density estimator (distestim
).
1 2 3 |
x |
Vector of data. |
smoothing |
Smothing parameter, also named bandwidth. If the argument is defined as |
The functions kernestim
and histestim
implement two well-known methods to estimate
the density of an empirical distribution (see Van Zandt, 2000, for their application in RT analysis).
The functions can be used to find the value corresponding to the peak of an empirical distribution.
The function kernestim
center a Gaussian density over each observation and identifies
the value with the greater density.
The function histestim
divides the data in bins, starting from the lower to the higher value
of data. The function searches the bin with the higher data frequency. The peak of the distribution
is identified calculating the mean of the data into the bin.
The function distestim
is an experimental method which mixes the two previous techniques.
Around each data point (pivot), an interval [x_{i}-h/2, x_{i}+h/2] is built, where h
is the smoothing parameter. The function searches the interval (bin) with the higher data frequency.
The output value is the weighted average of the values into the selected bin, in which each
observation is weighted on the basis of the distance from the pivot. If bins with equal densities
are found, the bin presenting the smallest deviance from the pivot is chosen.
For the Gaussian kernel estimator, the smoothing parameter is calculated using the Silverman's method (Silverman, 1986). Differently, using histogram and distance estimators, the smoothing parameter is calculated as: (Q_{0.975}-Q_{0.025}) / √{n}, where Q_{p} are the quantiles for α = 0.05 and n is the sample dimension.
The value at which the peak of density is located.
Davide Massidda davide.massidda@humandata.it
Silverman, B. W. (1986). Density estimation for statistics and data analysis. London: Chapman & Hall.
Parzen, E. (1962). On estimation of a probability density function and mode. Annals of Mathematical Statistics, 33(3), 1065-1076.
Van Zandt, T. (2000). How to fit a response time distribution. Psychonomic Bulletin & Review, 7(3), 424-465.
1 2 3 4 5 6 7 8 |
Reaction Time Analysis (version 0.1-2)
[1] 606.6124
[1] 595.3623
[1] 595.375
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.