[R] maximum likelihood estimation

pari hesabi statistics84 at hotmail.com
Tue Oct 7 10:55:26 CEST 2014


HelloI am trying to estimate the parameter of a function by the Maximum Likelihood Estimation method.If  the function is the difference between two integrals: C<-function(n){integrand3<-function(x) {((2-x)^n)*(exp(ax-2))}cc<- integrate (integrand3,0,2)print(cc)}
D<-function(n){integrand4<-function(x) {((5-ax)^n)}cc<- integrate (integrand4,0,2)print(cc)}
f(n) = C(n) - D(n)
 I need to estimate parameter (a).   loglikelihood function is in the form of  sum[F(k) log(f(k))]=lnL. I am wondering how to introduce my logliklihood function to the loop below.  Can anybody help me for correcting the following loop? if there are some other packages better than this , please let me know.Thank you,Diba
n <- c(0,1,2,3,4,5,6,7,8)
F<-c(0,0,1,3,5,7,8,11,10)
loglik <- function(a) sum(F*log(C(n)-D(n)))
re <- maxLik (loglik, start=.5)
summary(re) 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list