# How to computed "truncated shifted exponential distribution"?

I have a research problem to solve. For regular exponential distribution, $$F(z|\lambda)=\begin{cases}0\;\;\;\;\text{if }z<0\\1-e^{-\lambda z}\;\;\;\;\text{ if }z\geq 0\end{cases}$$ with density $$f(z|\lambda)=\begin{cases}0\;\;\;\;\text{ if }z<0\\\lambda e^{-\lambda z}\;\;\;\;\text{if }z\geq 0\end{cases}$$ Now we introduce the shifted exponential distribution: $$F(z|\lambda,z_0)=\begin{cases}0\;\;\;\;\text{ if }z and for $$x\geq 0$$ and $$\Delta\geq0$$, we have $$E(z|\lambda)=\frac{1}{\lambda}$$ $$E(z|z\geq x,\lambda)=x+\frac{1}{\lambda}$$ $$E[z|z\in[x,x+\Delta],\lambda]=x+E[z|z<\Delta,\lambda]$$ Now I want to show that $$E[z|z<\Delta,\lambda]=\frac{1}{\lambda}-\frac{\Delta \cdot [1-F(\Delta|\lambda)]}{F(\Delta|\lambda)}$$ Could somebody be kind enough to show me the steps?

• Yes, there was a typo. Sorry about that. Commented Jun 7, 2022 at 13:19
• You might want to skip the following piec in you question which seems superfluous: Now we introduce the shifted exponential distribution: $$F(z|\lambda,z_0)=\begin{cases}0\;\;\;\;\text{ if }z<z_0\\1-e^{-\lambda(z-z_0)}\;\;\;\;\text{if }z\geq z_0\end{cases}$$ Commented Jun 7, 2022 at 17:11

We have that

$$E[Z] = E[Z|A] \cdot P(A) + E[Z|!A] \cdot P(!A)$$

or differently written

$$E[Z|A] = \frac{ E[Z] - E[Z|!A] \cdot P(!A)}{P(A)}$$

Now let the event $$A$$ be $$z<\Delta$$, then this becomes

$$\begin{array}{} E[Z|z<\Delta] &=& \frac{ E[Z] - E[Z|z \geq \Delta] \cdot P(z\geq\Delta)}{P(z<\Delta)}\\ &=& \frac{ E[Z] - E[Z|z \geq \Delta] \cdot (1-F(\Delta))}{F(\Delta)}\\ &=& \frac{ \lambda^{-1} - (\lambda^{-1}+\Delta) \cdot (1-F(\Delta))}{F(\Delta)}\\ &=& \lambda^{-1} - \frac{ \Delta \cdot (1-F(\Delta))}{F(\Delta)}\\ \end{array}$$

I imagine that you could also compute it straightforward like working out the below integrals:

$$E[Z|z<\Delta] = \frac{\int_0^\Delta z \lambda e^{-\lambda z} dz}{\int_0^\Delta \lambda e^{-\lambda z} dz}$$

In addition to @SextusEmpiricus 's beautiful solution (+1), following is the direct computation (as also noted in the answer): \begin{align}E[z|z<\Delta,\lambda]&=\int_0^\Delta z f(z|z<\Delta,\lambda)dz =\int_0^\Delta z \frac{\lambda e^{-\lambda z}}{F(\Delta|\lambda)} dz \\&=\frac{1}{F(\Delta|\lambda)}\int_0^\Delta \underbrace{z}_{u} \underbrace{\lambda e^{-\lambda z} dz}_{dv}\\&=\frac{1}{F(\Delta|\lambda)}\left(-ze^{-\lambda z}\bigg|_0^\Delta+\int_0^\Delta e^{-\lambda z} dz\right)\\&=\frac{1}{F(\Delta|\lambda)}\left(-\Delta e^{-\Delta\lambda}-\frac{1}{\lambda}e^{-\lambda z}\bigg|_0^\Delta\right) \\&=\frac{1}{F(\Delta|\lambda)}\left(-\Delta (1-F(\Delta|\lambda))-\frac{1}{\lambda} \underbrace{(e^{-\lambda \Delta}-1)}_{-F(\Delta|\lambda)}\right)\\&=\frac{-\Delta(1-F(\Delta|\lambda))}{F(\Delta|\lambda)}+\frac{1}{\lambda}\end{align}