aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp29
1 files changed, 22 insertions, 7 deletions
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 <cmath>
#include <algorithm>
+#include "opti.hpp"
using namespace std;
//--génération quantiles--
@@ -43,16 +44,30 @@ x = 1.64*S.estimator().second;
};
+ void exemple2 (){
+ std::vector<double> mu(16);
+ mu = argmax(0.05, 1.0, 50, 0.1, 45, 16);
+ double norm_mu = 0;
+ std::vector<double> u(16);
+ for(int i=0; i<16; i++) {
+ norm_mu += mu[i]*mu[i];
+ u[i] = mu[i]/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);
+ f_mu G(mu,A);
+ multi_gaussian_truncated MG(q[50],q[51], u);
+ for(int i=0; i<10; i++){
+ std::cout<<G(MG())<<std::endl;
+ }
+}
+
int main()
{
- std::vector<double> 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<double> r(5);
- r = G();
- for (int i=0; i<5; i++){
- std::cout<<r[i]<<std::endl;
- }
+
+ exemple2();
return 0;
}