Finding lambda parameter of an exponential distribution I understand that exponential distribution can be modeled as a function
$$
f(x) = \lambda e^{-\lambda x} u(x)
$$
Suppose a scenario where I want to observe the lifespan of an object and $T$ is the time in year belonging to an exponential distribution, with an expected value of $4$ years. May I know how would I go about calculating the $\lambda$ for $t = 3, 4, 5$?  
Thank you.
 A: Suppose a particular kind of electronic components have lifetimes
$X_1 \sim \mathsf{Exp}(\text{rate}=\lambda = 1/4).$ Then the average time to failure
is $\mu = E(X_1) = 1/\lambda = 4.$ That is, the average component lasts for
about four years. The density function is $f_1(t) = .25e^{-.25t},$ for $t > 0.$
You can show by calculus that $\mu = \int_0^\infty tf_1(t)\,dt = 1/4.$
The probability such a component will fail within half a year is
$F_1(.5) = 1 = e^{-.25(1/2)} = 0.1175,$ where $F_1(t) = 1 - e^{-\lambda t}.$
In R statistical software the computation can be done in two ways, where
pexp is the name of the CDF.
 1 - exp(-.25*.5)
 ## 0.1175031

 pexp(.5, .25)
 ## 0.1175031

In R statistical software, you can generate lifetimes of 1000 components,
and make a histogram of them as shown below. The R function rexp generates
a random sample and dexp is an exponential density function.
x1 = rexp(1000, .25)
hist(x1, prob=T, ylim=c(0,.25), col="skyblue2", main="Hist of 1000 obs from EXP(.25)")
curve(dexp(x, .25), add=T, lwd=2, col="blue")
abline(v = .5, lwd=2, col="red")


Now, if you want to model lifetimes over a four year time period, you
could use $$X_4 \sim \mathsf{Exp}(\lambda = 4(.25) = 1).$$ Then
$E(X_4) = 1.$ If there are .25 failures on average in one year then there is
1 on average in a four-year period. 
