I am fitting my data (wind data) to different distributions (two and three parameter weibull and gamma distributions). I used the method explained here (mle2 using "L-BFGS-B" method) to estimate the parameters of the three-parameter weibull distribution: Weibull Distribution parameter estimation error I used fitdist (from fitdistrplus library) to estimate the parameters of the two-weibull and gamma distribution. Now I want to compare the fit of the two-parameter weibull, three-parameter weibull and gamma distribution to my data on the same plot. I was able to compare the fit of two-parameter weibull and gamma but failed to include three-parameter weibull (it's a different class). Is it possible to plot the weibull two-parameter and three-parameter on the same plot. I would highly appreciate any suggestions. Thank you.
estimating parameters of three-parameter and two-parameter weibull:
library(bbmle)
library(FAdist)
y = my.data
eps <- 1e-8
weibull3 <- mle2(y ~ dweibull3(shape=shape, scale = scale, thres = thres), start=list(shape=1, scale=1, thres=-5),lower=c(shape=0,scale=0,thres=-Inf), upper=c(shape=Inf,scale=Inf,thres=min(y)-eps), method="L-BFGS-B", data=data.frame(y))
weibull3
call:
mle2(minuslogl = y ~ dweibull3(shape = shape, scale = scale, thres = thres), start = list(shape = 1, scale = 1, thres = -5), method = "L-BFGS-B", data = data.frame(y), lower = c(shape = 0, scale = 0, thres = -Inf), upper = c(shape = Inf, scale = Inf, thres = min(y) - eps))
coefficients:
shape scale thre
2.4828383 5.5248459 -0.2530033
Log-likelihood: -1358214
library (fitdistrplus)
weibull2 = fitdist(my.data, "weibull")
weibull2
Fitting of the distribution ' weibull ' by maximum likelihood
Parameters:
estimate Std. Error
shape 2.324290 0.002344834
scale 5.238753 0.002980665