[R] mle2(): logarithm of negative pdfs

2008-07-23 Thread Zornitsa Luleva
Hi,

In order to use the mle2-function, one has to define the likelihood function
itself. As we know, the likelihood function is a sum of the logarithm of
probability density functions (pdf).  I have implemented myself the pdfs
that I am using. My problem is, that the pdfs values are negative and I
cann't take the logarithm of them in the log-likelihood function.

So how can one take the logarithm of negative values of the pdfs?

Thanks a lot for your advice!

Zoe

[[alternative HTML version deleted]]

__
R-help@r-project.org 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: [R] mle2(): logarithm of negative pdfs

2008-07-23 Thread Patrizio Frederic
this is an off-topic, of course!
by definition, pdf MUST BE POSITIVE and log function is defined ONLY
for positive values.
check your pdf code and find out the errors.

regards

Patrizio Frederic


+-
| Patrizio Frederic
| Research associate in Statistics,
| Department of Economics,
| University of Modena and Reggio Emilia,
| Via Berengario 51,
| 41100 Modena, Italy
|
| tel:  +39 059 205 6727
| fax:  +39 059 205 6947
| mail: [EMAIL PROTECTED]
+-


2008/7/23 Zornitsa Luleva [EMAIL PROTECTED]:
 Hi,

 In order to use the mle2-function, one has to define the likelihood function
 itself. As we know, the likelihood function is a sum of the logarithm of
 probability density functions (pdf).  I have implemented myself the pdfs
 that I am using. My problem is, that the pdfs values are negative and I
 cann't take the logarithm of them in the log-likelihood function.

 So how can one take the logarithm of negative values of the pdfs?

 Thanks a lot for your advice!

 Zoe

[[alternative HTML version deleted]]

 __
 R-help@r-project.org 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.


__
R-help@r-project.org 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.