[R] Likelihood between observed and predicted response
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.
More information about the R-help