Solved – Expected Value of Random Variable

expected valuerrandom variablesimulation

I'm trying to find the expected value of a random variable $t_i$ which is the solution of

$$\epsilon_i=\mu(t_i-t_{i-1})-\sum^{i-1}_{k=1}\frac{\alpha}{\beta}\left(1-e^{-\beta(t_i-t_k)}\right)$$

where $t_1,…, t_{i-1} , \alpha, \beta, \mu$ are all known constants and where $\epsilon_i$ is a random variable with exponential(1) distribution. The text I'm reading says that this can be done using simulations, but I have no idea of how to do it in R. I have tried finding $t_i$ as a function of $\epsilon_i$ but I only got this far

$$ \log(t_i)-\beta t_i=\log\left(\epsilon_i+\mu t_{i-1}+(i-1) \frac{\alpha}{\beta}\right)-\log\sum^{i-1}_{k=1}e^{\beta t_k} -\log\mu- \log\left(\frac{\alpha}{\beta}\right)$$

Any ideas of what to do next are welcome!

Best Answer

Assuming that the algebraic expression you have is correct, do the following:

Suppose that you want the time $t_i$ simulation and you have data up to time $t_{i-1}$:

  1. Take a random draw for $\varepsilon_i \sim Exp(1)$
  2. Plug in values to the expression you have to create $x_i = \log(t_i) - \beta t_i$
  3. Use the Lambert W function to get $t_i$. $$t_i = -\frac{W(-e^{x_i} \beta)}{\beta}$$ Here's a link to how to use the Lambert W package in R: http://www.inside-r.org/packages/cran/LambertW/docs/W

After you have a large number of simulations, take the average.

Related Question