[R] Likelihood between observed and predicted response

Ben Bolker bolker at ufl.edu
Mon Sep 22 15:44:20 CEST 2008

Christophe LOOTS <Christophe.Loots <at> ifremer.fr> writes:

> Thank you so much for your help.
> The function "dbinom" seems to work very well.
> However, I'm a bit lost with the "dnorm" function.
> Apparently, I have to compute the mean "mu" and the standard deviation 
> "sd" but what does it mean exactly? I only have a vector of predicted 
> response and a vector of observed response that I would like to compare!
> What are "mu" and "sigma".

  mu is the mean (which you might as well set to the
predicted value).  sd is the standard deviation; in order
to calculate the likelihood in this case, you'll need an
*independent* estimate (from somewhere) of the standard
deviation.  Without thinking about it too carefully I think
you could probably get this from sqrt(sum((predicted-observed)^2)/(n-1))

> Thanks again.
> Christophe

More information about the R-help mailing list