varin sacha
2022-Feb-13 10:44 UTC
[R] Exact 95% CIs around the mean for Weibull distribution
Dear R-experts, Here below my R code. I am trying to get the exact 95% confidence intervals around the meanlog for lognormal, around the mean for gamma and around the mean for weibull distributions. For lognormal and gamma everything is working but for weibull, I get error messages. After having used the ??eweibull function, I am not sure I can get the 95% CIs around the mean. Is there a way to get the exact 95% CIs around the mean for the weibull distribution ? ########################## #Exact 95% CIs for the mean lognormal distribution library(EnvStats) x=rlnorm(100000,0,1) elnorm(x,method="mvue",ci=TRUE,ci.type="two-sided",ci.method="exact",conf.level=0.95) #Exact 95% CIs for the mean gamma distribution library(EnvStats) x=rgamma(n=100000,shape=2,rate=5) egamma(x,method="mle",ci=TRUE,ci.type="two-sided",conf.level=0.95) #Exact 95% CIs for the mean weibull distribution library(EnvStats) x=rweibull(100000,2,2) eweibull(x,method="mle",ci=TRUE,ci.type="two-sided",conf.level=0.95) ##########################
Eric Berger
2022-Feb-13 11:10 UTC
[R] Exact 95% CIs around the mean for Weibull distribution
I did a Google search on "R confidence interval for Weibull distribution parameters" and there were several packages that appear to provide that information. Have you tried any of them? On Sun, Feb 13, 2022 at 12:44 PM varin sacha via R-help <r-help at r-project.org> wrote:> > Dear R-experts, > > Here below my R code. I am trying to get the exact 95% confidence intervals around the meanlog for lognormal, around the mean for gamma and around the mean for weibull distributions. For lognormal and gamma everything is working but for weibull, I get error messages. After having used the ??eweibull function, I am not sure I can get the 95% CIs around the mean. Is there a way to get the exact 95% CIs around the mean for the weibull distribution ? > > ########################## > #Exact 95% CIs for the mean lognormal distribution > library(EnvStats) > > x=rlnorm(100000,0,1) > elnorm(x,method="mvue",ci=TRUE,ci.type="two-sided",ci.method="exact",conf.level=0.95) > > #Exact 95% CIs for the mean gamma distribution > library(EnvStats) > > x=rgamma(n=100000,shape=2,rate=5) > egamma(x,method="mle",ci=TRUE,ci.type="two-sided",conf.level=0.95) > > > #Exact 95% CIs for the mean weibull distribution > library(EnvStats) > > x=rweibull(100000,2,2) > eweibull(x,method="mle",ci=TRUE,ci.type="two-sided",conf.level=0.95) > > ########################## > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.