How to evaluate a ksdensity at x-values?

1 回表示 (過去 30 日間)
Cyril
Cyril 2013 年 11 月 26 日
編集済み: Wayne King 2013 年 11 月 26 日
I try to evaluate my fitting of a kernel density estimate over a range of x-values. Is there a way to call the function directly?
My problem is that my fitting given by ksdensity is a vector (pdfKernel 1x10000 double), not a function.
Thank you for your help.

回答 (1 件)

Wayne King
Wayne King 2013 年 11 月 26 日
編集済み: Wayne King 2013 年 11 月 26 日
You can input a vector of values as the 2nd input argument to ksdensity()
xi = -3:.01:3;
y = randn(1000,1);
[F,XI] = ksdensity(y,xi);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by