diff options
| author | Bertrand <bertrand.horel@gmail.com> | 2016-02-26 14:48:54 +0000 |
|---|---|---|
| committer | Bertrand <bertrand.horel@gmail.com> | 2016-02-26 14:48:54 +0000 |
| commit | 4909d262ba578dc71b7431bd3f3c2ef9b3132384 (patch) | |
| tree | a19a74c8a6dff8851802667b9b550c87b99331cf /src/main.cpp | |
| parent | d637151c4acae4a06ffef927bf7ececd77d67a44 (diff) | |
| download | projet_C++-4909d262ba578dc71b7431bd3f3c2ef9b3132384.tar.gz | |
debbugage de main
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp index 561b8c2..88f3737 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,17 +45,20 @@ x = 1.64*S.estimator().second; void exemple2 (){ - std::vector<double> mu(16); - mu = argmax(0.05, 1.0, 50, 0.1, 45, 16); + int d= 16; + std::vector<double> mu(d); + mu = argmax(0.05, 1.0, 50, 0.1, 45, d); double norm_mu = 0; - std::vector<double> u(16); - for(int i=0; i<16; i++) { + std::vector<double> u(d); + for(int i=0; i<d; i++) { norm_mu += mu[i]*mu[i]; - u[i] = mu[i]/norm_mu; + } + for(int i=0; i<d; i++) { + u[i] = mu[i]/sqrt(norm_mu); } vector<double> q = quantile_norm(100, 1); vector<double> p(100, 0.01); - asian_option A(0.05, 1.0, 50, 0.1, 45, 16); + asian_option A(0.05, 1.0, 50, 0.1, d, 45); f_mu G(mu,A); multi_gaussian_truncated MG(q[50],q[51], u); for(int i=0; i<10; i++){ |
