From 906c2dee383a7eb72632bfbdf61916a576a5460d Mon Sep 17 00:00:00 2001 From: Bertrand Date: Sun, 21 Feb 2016 16:35:30 +0000 Subject: création de la struct f_mu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index f6e998a..561b8c2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include "stratified_sampling.hpp" #include #include +#include "opti.hpp" using namespace std; //--génération quantiles-- @@ -43,16 +44,30 @@ x = 1.64*S.estimator().second; }; + void exemple2 (){ + std::vector mu(16); + mu = argmax(0.05, 1.0, 50, 0.1, 45, 16); + double norm_mu = 0; + std::vector u(16); + for(int i=0; i<16; i++) { + norm_mu += mu[i]*mu[i]; + u[i] = mu[i]/norm_mu; + } + vector q = quantile_norm(100, 1); + vector p(100, 0.01); + asian_option A(0.05, 1.0, 50, 0.1, 45, 16); + f_mu G(mu,A); + multi_gaussian_truncated MG(q[50],q[51], u); + for(int i=0; i<10; i++){ + std::cout< u {sqrt(0.2), sqrt(0.2), sqrt(0.2), sqrt(0.2), sqrt(0.2)}; - multi_gaussian_truncated G(0, 2, u); - std::vector r(5); - r = G(); - for (int i=0; i<5; i++){ - std::cout<