{"word_count": 118, "character_count": 1512}
Profile likelihood is an interesting theory to visualize and compute confidence interval for estimators (see e.g. Venzon &#38; Moolgavkar (1988)). As we will use is, we will plotBut more generally, it is possible to considerwhere . Then (under standard suitable conditions)which can be used to derive confidence intervals.&#62; base1=read.table(+ "http://freakonometrics.free.fr/danish-univariate.txt",+ header=TRUE)&#62; library(evir)&#62; X=base1$Loss.in.DKM&#62; u=5The function to draw the profile likelihood for the tail index parameter is then&#62; Y=X[X&#62;u]-u&#62; loglikelihood=function(xi,beta){+ sum(log(dgpd(Y,xi,mu=0,beta))) }&#62; XIV=(1:300)/100;L=rep(NA,300)&#62; for(i in 1:300){+ XI=XIV[i]+ profilelikelihood=function(beta){+ -loglikelihood(XI,beta) }+ L[i]=-optim(par=1,fn=profilelikelihood)$value }&#62; plot(XIV,L,type="l")It is possible to use it that profile likelihood function to derive a confidenceinterval,&#62; PL=function(XI){+ profilelikelihood=function(beta){+ -loglikelihood(XI,beta) }+ return(optim(par=1,fn=profilelikelihood)$value)}&#62; (OPT=optimize(f=PL,interval=c(0,3)))$minimum[1] 0.6315989$objective[1] 754.1115&#62; up=OPT$objective&#62; abline(h=-up)&#62; abline(h=-up-qchisq(p=.95,df=1)/2,col="red")&#62; I=which(L&#62;=-up-qchisq(p=.95,df=1)/2)&#62; lines(XIV[I],rep(-up-qchisq(p=.95,df=1)/2,length(I)),+ lwd=5,col="red")&#62; abline(v=range(XIV[I]),lty=2,col="red")This is done with the following code&#62; library(ismev)&#62; gpd.profxi(gpd.fit(X,5),xlow=0,xup=3)