//
// UQ avec méthode Monte Carlo, toy problem, normal uncertainty
//
Ntest=100000;
a_mean=2;
a_var=1;
Stot=[]
for k=1:Ntest
  a=a_mean+sqrt(a_var)*rand(1,1,'normal')
  N=100
  y=1
  for i=1:N
    y=y+1/N*(-a*y)  // Euler method for the computation of S
  end
  Stot=[Stot,y];
//disp('exact value');disp(exp(-a))
//disp('obtained value');disp(S)
end
figure(1)
clf()
histplot(100,Stot)
//
disp('mean of S (with MC)');disp(mean(Stot))
disp('mean of S valeur exacte');disp(%e^(-(3/2)))
////
disp('variance of S (with MC)');disp((stdev(Stot))^2)
disp('variance of S valeur exacte');disp(%e^(-2)-%e^(-3))
//
