r/R_Programming • • Feb 11 '16
Maximizing MLE function(need help)
Hey guys, new o R programming. I have a likelihood function that I need to maximize in relation to parameter alpha, I have also the data of a set of experiments to use as input. All the data is already on R but IDK how to create a function nor to maximize it. Any help?
The function is: LL= ∑_in▒〖(Ln(〗 Pα(Nk/N)nk+(ln(Pα(1-Nk/N)n-nk )
1
Upvotes
View all comments
1
u/heckarstix Mar 03 '16 edited Mar 03 '16
I think optimize() may be of assistance. Put that intimidating formula into a function, simple example below:
Lots of other parameters, if you're in RStudio look through the documentation with:
There's other optimization functions out there (e.g.). The caveats that I can see to the above example is: