Learn R Programming

epandist (version 1.1.1)

depan: Probability density function (pdf) for an uncensored epanechnikov distribution

Description

This function is simply a polynomial of second degree.

Usage

depan(x = 0, mu = 0, r = 5^0.5)

Arguments

x
point on x-axis.
mu
mean of distribution.
r
half the range of the distribution, ie the distance from the mean to the smallest/largest value supported by the distribution. r=5^.5 corresponds to a standard deviation of 1.

Value

point density associated with x, mu and r.

Examples

Run this code
#Probability distribution function, epanechnikov:
curve(depan(x),col='blue',ylim=c(0,.4),xlim=c(-3.5,3.5),yaxs='i',xaxs='i',
main='Probability distribution function',ylab='Probability')

#Probability distribution function, normal:
curve(dnorm(x),col='green',add=TRUE)

#Legend
legend(x=-3.5,y=.4,legend=c('Epanechnikov pdf','Normal pdf'),lty=c(1,1),col=c('blue','green'))

Run the code above in your browser using DataLab