Skip to content

Commit

Permalink
Update the 'descdist' function to reduce the time taken to display 'l…
Browse files Browse the repository at this point in the history
…ines'
  • Loading branch information
aursiber committed Feb 16, 2024
1 parent 619d32e commit 2d4f247
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/descdist.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ descdist <- function(data, discrete = FALSE, boot = NULL, method = "unbiased",
shape<-exp(lshape)
s2<-4/shape
y<-kurtmax-(3+6/shape)
lines(s2,y,lty=2, xlim=c(0,xmax),ylim=c(0,ymax))
lines(s2[s2<=xmax],y[s2<=xmax],lty=2)
# lnorm dist
lshape<-seq(-100,100,0.1)
shape<-exp(lshape)
es2<-exp(shape^2)
s2<-(es2+2)^2*(es2-1)
y<-kurtmax-(es2^4+2*es2^3+3*es2^2-3)
lines(s2,y,lty=3,xlim=c(0,xmax),ylim=c(0,ymax))
lines(s2[s2<=xmax],y[s2<=xmax],lty=3)

legend(xmax*0.55, ymax*1.03,legend="Theoretical",bty="n",cex=0.8)
legend(xmax*0.6, ymax*0.98,pch=8,legend="normal",bty="n",cex=0.8)
Expand Down Expand Up @@ -189,7 +189,7 @@ descdist <- function(data, discrete = FALSE, boot = NULL, method = "unbiased",
lambda<-exp(llambda)
s2<-1/lambda
y<-kurtmax-(3+1/lambda)
lines(s2,y,lty=2, xlim=c(0,xmax),ylim=c(0,ymax))
lines(s2[s2<=xmax],y[s2<=xmax],lty=2)
}
# bootstrap sample for observed distribution
if (!is.null(boot)) {
Expand Down

0 comments on commit 2d4f247

Please sign in to comment.