0

I would like to compute the following function of two independent random variables:

Expectation[
     1 - Exp[-ρ ((K (1 + s*K^(β - 1)*ϵ) - c*s*K))], { 
      c \[Distributed] NormalDistribution[Subscript[μ, c], Subscript[σ, c]],
      ϵ \[Distributed] NormalDistribution[Subscript[μ, r], Subscript[σ, r]]}]

However, it seems Mathematica can not compute it.

MarcoB
  • 67,153
  • 18
  • 91
  • 189
user63801
  • 1
  • 1

1 Answers1

2

What version are you using? It works just fine on my 11.3 installation:

In[2]:= Expectation[1-Exp[-\[Rho] ((K (1+s*K^(\[Beta]-1)*\[Epsilon])-c*s*K))],{c\[Distributed]NormalDistribution[Subscript[\[Mu],c],Subscript[\[Sigma],c]],\[Epsilon]\[Distributed]NormalDistribution[Subscript[\[Mu],r],Subscript[\[Sigma],r]]}]

Out[2]= 1-E^(1/2 [Rho] (-2 K+2 K s Subscript[[Mu], c]-2 K^[Beta] s Subscript[[Mu], r]+K^2 s^2 [Rho] Subsuperscript[[Sigma], c, 2]+K^(2 [Beta]) s^2 [Rho] Subsuperscript[[Sigma], r, 2]))

enter image description here

Some general pointers though:

  1. Specify Assumptions if symbolic computations are failing. Very often Mathematica needs to know that certain variables are real or positive rather than complex-valued
  2. Do not use Subscript for variables/parameters in symbolic computations. Sometimes it works (like it did just now), but often enough it won't and it's just not worth the bother. It's better to stick with normal symbols most of the time. See also: Can we use letter with a subscript as a variable in Mathematica?
Sjoerd Smit
  • 23,370
  • 46
  • 75
  • 1
    It doesn't work as is on version 10.4. But if one follows your good advice about avoiding Subscript, it works fine on 10.4. – JimB Apr 03 '19 at 14:25
  • Most thanks Sjoerd Smit and JimB for your very helpful advices!!! Indeed, it works perfectly w/o Subscript! – user63801 Apr 04 '19 at 06:45