Likelihood between observed and predicted response

View: New views
2 Messages — Rating Filter:   Alert me  

Likelihood between observed and predicted response

by Christophe LOOTS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I've two fitted models, one binomial model with presence-absence data
that predicts probability of presence and one gaussian model (normal or
log-normal abundances).

I would like to evaluate these models not on their capability of
adjustment but on their capability of prediction by calculating the
(log)likelihood between predicted and observed values for each type of
model.

I found the following formula for Bernouilli model :

-2 log lik = -2 sum (y*log phat + (1-y)*log(1-phat) ), with "phat" is
the probaility (between 0 and 1) and "y" is the observed values (0 or 1).

1) Is anybody can tell me if this formula is statistically true?
2) Can someone tell me what is the formula of the likelihood between
observed and predicted values for a gaussian model ?

Thanks

--
Christophe LOOTS
PhD student - Hydrobiological modelling of fish habitats
Sea Fisheries Laboratory - IFREMER Boulogne sur Mer
150, Quai Gambetta. BP 699
62321 Boulogne sur Mer- FRANCE

Tél : +33(0)3 21 99 56 86
Fax : +33(0)3 21 99 56 01
E-mail : cloots@...
http://www.ifremer.fr/drvboulogne/labo/equipe.htm

______________________________________________
R-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: Likelihood between observed and predicted response

by Ben Bolker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

>
> Hi,
>
> I've two fitted models, one binomial model with presence-absence data
> that predicts probability of presence and one gaussian model (normal or
> log-normal abundances).
>
> I would like to evaluate these models not on their capability of
> adjustment but on their capability of prediction by calculating the
> (log)likelihood between predicted and observed values for each type of
> model.
>
> I found the following formula for Bernouilli model :
>
> -2 log lik = -2 sum (y*log phat + (1-y)*log(1-phat) ), with "phat" is
> the probaility (between 0 and 1) and "y" is the observed values (0 or 1).
>
> 1) Is anybody can tell me if this formula is statistically true?

  This looks correct.

> 2) Can someone tell me what is the formula of the likelihood between
> observed and predicted values for a gaussian model ?
>

   -2 L = sum( (x_i - mu_i)^2)/sigma^2  - 2*n*log(sigma) + C

assuming independence and equal variances:
but don't trust my algebra, see ?dnorm and take the log of the
likelihood shown there for yourself.
You're reinventing the wheel a bit here:

-2*sum(dbinom(y,prob=phat,size=1,log=TRUE))

and

-2*sum(dnorm(x,mean=mu,sd=sigma,log=TRUE))

will do what you want.

  Ben Bolker

______________________________________________
R-help@... mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.