sampling of a random variable I came up with the following question when I read a paper in Economics: 

Let $Z:\Omega\to\Bbb{R}$ be a random variable with density 
  $$
f(z)=\begin{cases}
\frac{1}{\sigma}\exp\left({-\frac{z+\mu}{\sigma}}\right),&\quad z+\mu\geq 0\\
0,&\quad\text{ otherwise}.
\end{cases}
$$
  where $\mu$ and $\sigma$ are constants. Give $\theta\in(0,1)$, define a random variable $R:\Omega\to\Bbb{R}$ such that
  $$
P(R=0)=\theta,\quad P(R=Z)=1-\theta.
$$

Here are my questions: 


*

*[Added:] How can I generate a numerical sample of $R$, using the inverse transform sampling?

*Is there any other way than the [inverse transform sampling] to generate a sample?

 A: Discussion in comments above converted into an answer.
You can generate a sample of $R$ using the following method which uses
inverse transform sampling but not the inverse transform of $R$ which
has a mixed distribution that would need some extra steps in
handling via direct inverse transform sampling.
Notice that $Z$ is an exponential random variable with mean $\sigma$
that has been displaced to the left by $\mu$, that is,
$\displaystyle \frac{Z+\mu}{\sigma}$ is an exponential random
variable with mean $1$. So, we can use the following method to
generate a sample of $R$. 


*

*Generate $Y \sim U(0,1)$.

*If $1-\theta < Y < 1$, set $R = 0$, else set 
$\displaystyle R = -\sigma \ln\left(\frac{Y}{1-\theta}\right) - \mu$.
If $Y$ is known to have value in 
$(0, 1-\theta)$, the conditional distribution
of $\frac{Y}{1-\theta}$  is uniform on $(0,1)$ and so
$-\ln \left(\frac{Y}{1-\theta}\right)$ is an exponential
random variable with mean $1$. This is readily converted
to an exponential random variable with mean $\sigma$ and then
displaced by $\mu$ to the left.
