2
$\begingroup$

The evaluation runs for a few seconds and then Mathematica displays the unevaluated expression Expectation function

Expectation[(((w + a)*Exp[r*T]) + (s*Exp[d*T] + o*l)*P*
   Exp[(r - d - (1/2)*q^2)*T + (x*Sqrt[T]*q)])^(1-c), x \[Distributed] NormalDistribution[0, 1]]

the value of parameters are:

{{d -> 0.0269, q -> 0.3315, r -> 0.0435, T -> 1, w -> 1.1465, 
  p -> 100, l -> 1, c -> 3,a -> 0.0941, s -> 0.0029, o -> 0.0089}}
$\endgroup$
2
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    Dec 8, 2014 at 2:47
  • $\begingroup$ (i) I think you are looking for trouble by using notation like o*l which can easily be mis-read. (ii) Add Assumptions -> {r >0, etc} will help solve symbolic problems. (iii) Use NExpectation for numerical problems (given numerical parameter values): otherwise keep things symbolic. $\endgroup$
    – wolfies
    Dec 8, 2014 at 3:20

1 Answer 1

4
$\begingroup$
expr = (((w + a) Exp[r t]) + (s Exp[d t] + o*l) p Exp[(r - d - (1/2)*q^2) t + 
       (x Sqrt[t]*q)])^(1 - c) /. 
       {d -> 0.0269, q -> 0.3315, r -> 0.0435, t -> 1, w -> 1.1465, p -> 100,
        l -> 1, c -> 3, a -> 0.0941, s -> 0.0029,  o -> 0.0089};

NExpectation[expr, x \[Distributed] NormalDistribution[0, 1]]
(* 0.171448 *)

From Expectation >> Properties and Relations:

enter image description here

Therefore, you can also use the following, slower, alternatives:

N@Expectation[expr, x \[Distributed] NormalDistribution[0, 1]]
(*  0.171448 *)

Or, when symbolic evaluation

Expectation[expr, x \[Distributed] NormalDistribution[0, 1]]

returns

enter image description here

use

N[%] 

to get the same value 0.171448 for expectation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.