(1.) Done, "confidently"...
(2.) The length of the interval $[L(Y),U(Y)]=[Y,2Y]$ is $2Y-Y=Y$ hence the expected length of the interval is $\mathbb E_\theta(Y)=1/\theta$.
(3.) The interval $[aY,bY]$ is a confidence interval for $1/\theta$ with confidence level
$$
\mathbb P_\theta(aY\leqslant1/\theta\leqslant bY)=\mathbb P_\theta(1/(b\theta)\leqslant Y\leqslant1/(a\theta))=\mathrm e^{-1/b}-\mathrm e^{-1/a}.
$$
Hence every interval $[aY,bY]$ such that $\mathrm e^{-1/b}-\mathrm e^{-1/a}=\mathrm e^{-1/2}-\mathrm e^{-1}$ and $b-a\lt1$ is solution.
For example, $a=.5$ yields $b=1.01674$ hence $b-a=.51674\lt1$ (the minimum length is around $b-a=.471$ for $a=.332$ and $b=.804$).
Find an interval where the characteristics are satisfied.
??
This can be accomplished with monovariate root finding. First solve for the shape parameter, $\lambda$, in terms of the scale parameter, $k$, using the expression for the mean, $\mu$, of the standard Weibull distribution:
$$\mu = \lambda \Gamma\left(1+\frac{1}{k}\right) \rightarrow \lambda = \frac{\mu}{\Gamma\left(1+\frac{1}{k}\right)}$$
Then plug this in to the expression for the variance, $\sigma^2$, to eliminate $\lambda$ and simplify:
$$\sigma^2 = \lambda^2 \left(\Gamma\left(1+\frac{2}{k}\right) - \left(\Gamma\left(1+\frac{1}{k}\right)\right)^2\right) \rightarrow \frac{\sigma^2}{\mu^2} - \frac{\Gamma\left(1+\frac{2}{k}\right)}{\left(\Gamma\left(1+\frac{1}{k}\right)\right)^2} + 1 = 0$$
This appears to be a monotonically increasing function for $k \in (0,+\infty)$ and the specified values of $\mu$ and $\sigma^2$. The root of this function can be found in Matlab by using fzero
:
mu = 62;
sig2 = 4275;
f = @(k)sig2/mu^2-gamma(1+2./k)./gamma(1+1./k).^2+1;
k0 = 1; % Initial guess
k = fzero(f,k0) % Solve for k
lam = mu/gamma(1+1/k) % Substitue to find lambda
which yields
k =
0.948647322786540
lam =
60.540561349132474
You can then verify that this works by sampling with wblrnd
:
rng(1); % Set seed to make repeatable
n = 1e7;
r = wblrnd(lam,k,[n 1]);
mu_r = mean(r)
sig2_r = var(r)
Best Answer
If you know the mean is $\mu$ and the standard deviation is $\sigma$, then the shape parameter of a Gamma distribution is $\dfrac{\mu^2}{\sigma^2}$ and the scale parameter is $\dfrac{\sigma^2}{\mu}$, making the corresponding rate parameter $\dfrac{\mu}{\sigma^2}$
As an illustration of what is possible, suppose you knew that the mean is $40$ and you had an interval of $[30,50]$ representing about $2$ standard deviations either side of the mean
Then the standard deviation is about $\frac{50-40}{2}=5$, and the variance is therefore about $5^2=25$
For a Gamma distribution with shape parameter $k$ and scale parameter $\theta$, the mean would be $k\theta$ and the variance $k\theta^2$, suggesting with these numbers that $\theta \approx \frac{25}{40} = 0.625$ (equivalent to a rate of $1.6$) and $k \approx \frac{40^2}{25}=64$
As a check, we can look at the corresponding interval for these parameters in R
which shows this approach is not exact, but is not that far away.
$k=59.3749$ and $\theta=0.66312$ would get you closer to the confidence interval with $2.5\%$ each side but at the cost (due to the asymmetry of the Gamma distribution) of a corresponding mean of $39.372$ rather than $40$