Forum: developers


RE: Evaluating the loglike of a set of parameters [ Reply ] By: Bernardo Mello on 2009-04-01 15:58 | [forum:1382] |
Arne, Since I need to test some data that was leading to different results with code="Fortran" and code="R", I implemented it without waiting for your reply. I didn't update the documentation, since I don't know if the changes will really be incorporated. The problematic data is the file prodAgrBrazil, which I included in the folder data. I changed the frontierRTest.R to make the differences evident. Look for c1FF in frontierRTest.R.out. You will see how the same parameters lead to (sometimes very) different logLike when using the Fortran or R coding. Furthermore, when I calculate the logLike using the R code, but incorporating the approximations used in Frontier41, I get the same logLike of frontier41. |
Evaluating the loglike of a set of parameters [ Reply ] By: Bernardo Mello on 2009-04-01 12:35 | [forum:1381] |
For several reasons it can be usefull to calculate the value of the logLike of a given set of parameters. One reason is that the logLike calculated by frontier4.1 is often different from the value calculated by the R code. Frequently, the reason is that the frontier4.1 doesn't handle appropriately the log of the p-value. So having functions doing this would bring light over the discrepancies. However, the raw data must be suitably formated before it can be calculated. I have two suggestions for the implementations: - Separate part of the code of the frontier function in another function called prepareData, for example. Have another function, called frontierLogLike, to calculate the logLike. (As a bonus, it would also make smaller the frontier function, which, I think, is too big.) - Include one more argument on the function frontier. It could be named evalLogLike, for example. |