0

I would like to find the 95% CI for the MLE for my parameter in a function but I have no idea how.

The given function is a power-law distribution with

f(x)=Cx^(-mu),

I calculated the MLE for mu using the bbmle package in R.

Some people on the internet say use profile likelihood to do it but I am not sure how to in R, or other methods which lead to the same results are fine too.

Much appreciate and thanks in advance!

Update:

load("fakedata500.Rda")
> library(stats4)
> library(bbmle)
> x<-fakedata500
> pl <- function(u){-length(x)*log(u-1)-length(x)*(u-1)*log(min(x))+u*sum(log(x))}

mle1<-mle2(pl, start=list(u=2), data=list(x))
> summary(mle1)
Maximum likelihood estimation

Call:
mle2(minuslogl = pl, start = list(u = 2), data = list(x))

Coefficients:
Estimate Std. Error z value     Pr(z)    
u  2.00510    0.04495  44.608 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

-2 log L: 1300.166 

So the estimated mu is 2.00510 and I would like to get the 95% CI of it, it might look nonsense since my started mu was 2 so 2.00510 is very close to it, but I am going to apply this method to other data sets too which I havn't come across yet so really hope to find a way to do it.

user3579282
  • 45
  • 2
  • 9

1 Answers1

2

(Converted from a comment.)

If you're using mle2 from the bbmle package you should just be able to say confint(mle1) to get the 95% profile confidence intervals. See ?confint.mle2, or try vignette("mle2",package="bbmle") and search for "confint" for more information.

Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
  • Hey Ben! Do you know if there is a much more recent update on how to find confidence intervals on MLL functions? These approaches seem to be outdated and I've been scouring for months trying to find out to generate the CI for MLLs. I would appreciate any imput – Rspacer May 03 '21 at 20:14
  • If you have any time today, I would be grateful if you can take a peek at my question https://stackoverflow.com/questions/67374974/how-to-incorporate-sigma-or-error-function-and-95-confidence-interval-in-maxi – Rspacer May 03 '21 at 20:19