[Gretl-users] on kernel density

Allin Cottrell cottrell at wfu.edu
Tue Jan 28 08:54:51 EST 2014

On Tue, 28 Jan 2014, Leandro Zipitria wrote:

> Dear Gretl users,
> I am trying to run a kernel approximation to a series of data (attached),
> using the command kdensity as show in the manual.
> Specifically, the inp is as follows:
> matrix d = kdensity(Water)
> gnuplot --matrix=d --with-lines --output=pruba.eps
> But, once run the output says that the second column has non finite values.
> Maybe is because values are integers [...]

No, it's because most of the values are zero, to the extent that the 
inter-quartile range (IQR) is zero. In this case our implementation of the 
Silverman bandwidth algorithm gave a bandwidth of zero, so that all the 
density values were undefined.

This is now fixed in CVS: if the IQR is zero we'll use the standard 
deviation in setting the bandwidth instead.

Allin Cottrell

More information about the Gretl-users mailing list