Skip to content
Prev 279258 / 398506 Next

density function always evaluating to zero

I didn't try out your extensive code, but here's one potentially serious
problem:

You only pass two arguments to f(), alpha and h, but within f you nonetheless
use x1 and y and several other things. This is bad practice, and dangerous:
you should pass all the necessary arguments to f(), not rely on the environment
to contain them.

After you fix that, working through your function step by step at the command
line and looking at the results of each line of code can be very educational.

Sarah
On Sun, Dec 4, 2011 at 7:47 AM, napps22 <n.j.apps22 at gmail.com> wrote: