|
From: Rhys U. <rhy...@gm...> - 2014-01-07 23:47:52
|
When plotting with 'smooth kdensity' I must provide 1/number-of-points
as the second plotting column to get a normalized histogram. Does
that scaling factor need to change to get a properly normalized
histogram when using a logarithmic x axis? I should be able to sort
through this myself, but my head's not working today.
More concretely, should the (1.0/nsamp) factor be modified in some
fashion to obtain a normalized kernel density estimate for the second
plot below?
set print "random.tmp"
mean = 5
nsamp = 10000
do for [i=1:nsamp] {
print sprintf("%8.5g", invnorm(rand(0)) + mean)
}
unset print
set term postscript
# Normalized per 'help smooth kdensity'
set output "regular.ps"
plot "random.tmp" using 1:(1.0/nsamp) smooth kdensity
# How should this be normalized?
set logscale x
set output "logscale.ps"
plot "random.tmp" using 1:(1.0/nsamp) title 'Logscale x' smooth kdensity
Thank you,
Rhys
|