# Conditional mean of Weibull to the power of N

How can I (is it possible to) derive the conditional expectation of a variable $$w$$ that follows a 2 parameter Weibull Distribution $$W(\lambda,k)$$ with $$\lambda$$ scale parameter and $$k$$ shape parameter?

We know that:

$$E[w^n]=\lambda^n \Gamma(1+\frac{n}{k})$$

What is (is there) an expression for?

$$E[w^n | \underline{w}

As always, the effect of the scale parameter $$\lambda\gt 0$$ is merely to change the units of measurement of the variable. Consequently the answer must be a multiple of $$\lambda^n$$ and that multiple is found by assuming $$\lambda=1.$$

By definition, the survival function of a Weibull variable $$w$$ with unit scale and shape parameter $$k \gt 0$$ is given by

$$\Pr(w \gt x) = \exp\left(-x^k\right).$$

Therefore, assuming $$n\gt 0,$$

$$\Pr(w^n \gt x) = \Pr(w \gt x^{1/n}) = \exp\left(-\left(x^{1/n}\right)^k\right) = \exp\left(-x^{k/n}\right)$$

shows $$w^n$$ follows a Weibull distribution with shape parameter $$k/n$$ (and scale parameter $$1$$).

These considerations have reduced the question to finding the expectation of a Weibull variable $$X,$$ of unit scale and shape parameter $$k/n,$$ that has been truncated at the values $$l=\underline{w}\,\lambda^{-n}$$ and $$u=\bar{w}\,\lambda^{-n}.$$ This expectation will equal

$$E[X] = C^{-1}\int_l^u x\,\mathrm{d}\left(1-\exp\left(-x^{k/n}\right)\right) = \frac{k}{nC}\int_l^u x^{k/n}\exp\left(-x^{k/n}\right)\,\mathrm{d}x\tag{*}$$

where the normalizing constant is

$$C = \Pr(l \le X \le u) = \exp\left(-l^{k/n}\right) - \exp\left(-u^{k/n}\right).$$

Multiply this expression for $$E[X]$$ by $$\lambda ^n$$ to account for the scale factor in $$w.$$

To evaluate $$(*),$$ change the variable to $$y=x^{k/n},$$ giving

\eqalign{ E[w^n\mid \underline{w}\le w \le \bar{w}] &= \lambda ^n\frac{k}{nC}\int_{l^{k/n}}^{u^{k/n}} y\,e^{-y}\,\mathrm{d}\left(y^{n/k}\right)\\ &= \lambda ^n\frac{1}{C}\int_{l^{k/n}}^{u^{k/n}} y^{n/k}e^{-y}\,\mathrm{d}y \\ &= \lambda ^n\frac{\gamma\left(n/k+1, u^{k/n}\right) - \gamma\left(n/k+1, l^{k/n}\right)}{\exp\left(-l^{k/n}\right) - \exp\left(-u^{k/n}\right)}\\ &= \lambda ^n\frac{\gamma\left(n/k+1, \bar{w}^{k/n}\lambda^{-k}\right) - \gamma\left(n/k+1, \underline{w}^{k/n}\lambda^{-k}\right)}{\exp\left(-\underline{w}^{k/n}\lambda^{-k}\right) - \exp\left(-\bar{w}^{k/n}\lambda^{-k}\right)} }

where $$\gamma(s,t) = \int_0^t x^{s-1}e^{-x}\,\mathrm{d}x$$ is the incomplete Gamma function.

• Dear whuber. For the example I'm working on, I get an expected value that is negative, which doesn't really make sense. This appears to be because the incomplete Gamma function is decreasing in the second term when this is smaller than 1. Am I missing something? Sep 24, 2020 at 23:03
• @Raimundo If by "second term" you mean the second argument of $\gamma,$ then I do not understand your remark, because the rate of change of $\gamma(s,t)$ with respect to $t$ is $t^{s-1}e^{-t}$ which is positive for all $t\gt 0.$
– whuber
Sep 25, 2020 at 12:57
• you are absolutely right. i was simulating the response to changes in t and i found an error in the code. a bit embarrassing. thanks for your help! Sep 25, 2020 at 23:43
• I have posted a question because I'm getting a strang result when trying to simulate this in R. Any help would be much appreciated. stats.stackexchange.com/questions/490456/… Oct 5, 2020 at 2:00