I have an Integral in terms of parameters a,b,p,q. My probability densitiy function of data x is
GB2PdfCalc=function(x){
out=(abs(a)*x^(a*p-1))/(b^(a*p)*beta(p,q)*(1+(x/b)^(a))^(p+q))
return(out)
}
I want to an integral of this using GB2PdfCalc:
pdfIntegration<-function(x){
[...]
integral[i]=integrate(GB2PdfCalc,x[k],x[j])[1]
integral=as.vector(integral,mode="numeric")
return(integral)
}
pdfIntegration(x)
However, I want to maximize this Integral in terms of a,b,p,q. Eventually, I want to calculate a Maximum Likelihood function. Using mle(pdfIntegration) or optim() didn't help me here. Anybody got ideas?