0
$\begingroup$

i need your help again. I would like to calculate EW[k_] with EW[1],EW[2] and EW[3]. My code works only for one calculation from EW (in the code below it is EW[1]) but i would like to calculate the three EW's simultaneously. I think the problem is the table but i can not find the mistake.

Table[
     Clear[\[Epsilon], c, \[Eta], \[Eta]Markt, \[Eta]tilde, Ertrag, EW, 
      Liste1];
     \[Eta]tilde[t_, k_] := \[Eta]tilde[t, k] = 
       RandomVariate[NormalDistribution[]];
     \[Eta]Markt[t_] := \[Eta]Markt[t] = 
       RandomVariate[NormalDistribution[]];
     c = 0.1;(*für c=0,c=0.1 und c=0.9*)
     \[Epsilon] = 0.1;
     Ertrag[0, 1] = 48.48;
     Ertrag[0, 2] = 9.56;
     Ertrag[0, 3] = 2.3;
     T = 400;
     i = 0.0931;
     \[Eta][t_, k_] := \[Eta][t, k] = 
       Sqrt[c]*\[Eta]Markt[t] + Sqrt[1 - c]*\[Eta]tilde[t, k];
     Ertrag[t_, k_] := 
      Ertrag[t, k] = Ertrag[t - 1, k] (1 + \[Epsilon]*\[Eta][t, k]);
     EW[k_] := {Sum[Ertrag[t, k]/(1 + i)^t, {t, 1, T}], 
       Sum[Ertrag[t, k]/(1 + i)^t, {t, T + 1, 2 T}]};
     EW[1],
     {i, 1, 10}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.