<< ksdensity_kernelcdf Miscellaneous quantile >>

Stixbox >> Stixbox > Miscellaneous > ksdensity_kernelpdf

ksdensity_kernelpdf

Evaluate kernel for PDF

Calling Sequence

K=ksdensity_kernelpdf(u)
K=ksdensity_kernelpdf(u,akernel)

Parameters

u :

a npoints-by-1 matrix of doubles, the points to evaluate the kernel

akernel :

a 1-by-1 matrix of strings, the type of kernel (default="normal"). Available values are "normal", "biweight", "triangle", "epanechnikov".

K :

a npoints-by-1 matrix of doubles, the kernel value

Description

Evaluate the kernel at point u.

The available kernels are the following.

Examples

// Plot available kernels
scf();
//
subplot(2,2,1)
title("Normal")
u=linspace(-3,3,100);
K=ksdensity_kernelpdf(u,"normal");
plot(u,K,"r-")
//
subplot(2,2,2)
title("Epanechnikov")
u=linspace(-1.5,1.5,100);
K=ksdensity_kernelpdf(u,"epanechnikov");
plot(u,K,"r-")
//
subplot(2,2,3)
title("Biweight")
u=linspace(-1.5,1.5,100);
K=ksdensity_kernelpdf(u,"biweight");
plot(u,K,"r-")
//
subplot(2,2,4)
title("Triangle")
u=linspace(-1.5,1.5,101);
K=ksdensity_kernelpdf(u,"triangle");
plot(u,K,"r-")
//
// Plot available kernels
scf();
xlabel("u");
ylabel("K(u)");
u=linspace(-1.5,1.5,101);
K=ksdensity_kernelpdf(u,"normal");
plot(u,K,"m-")
K=ksdensity_kernelpdf(u,"epanechnikov");
plot(u,K,"b--")
K=ksdensity_kernelpdf(u,"biweight");
plot(u,K,"r-.")
K=ksdensity_kernelpdf(u,"triangle");
plot(u,K,"g-")
legend(["Normal","Epanechnikov","Biweight","Triangle"]);

Authors

Bibliography

http://en.wikipedia.org/wiki/Kernel_(statistics)#Kernel_functions_in_common_use


Report an issue
<< ksdensity_kernelcdf Miscellaneous quantile >>