diff options
| author | Bertrand <bertrand.horel@gmail.com> | 2016-02-26 15:17:01 +0000 |
|---|---|---|
| committer | Bertrand <bertrand.horel@gmail.com> | 2016-02-26 15:17:01 +0000 |
| commit | e21e4882c9755a4b8e8194a79ecf5702fc935248 (patch) | |
| tree | 7d32df6f0ddfda7ccc60f81465cf896a6ae243e5 /src/main.cpp | |
| parent | 4909d262ba578dc71b7431bd3f3c2ef9b3132384 (diff) | |
| download | projet_C++-e21e4882c9755a4b8e8194a79ecf5702fc935248.tar.gz | |
on utilise plus .current et on améliore exemple 2
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index 88f3737..fb6df08 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -60,10 +60,21 @@ x = 1.64*S.estimator().second; vector<double> p(100, 0.01); 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++){ - std::cout<<G(MG())<<std::endl; - } + std::vector<compose_t <f_mu, multi_gaussian_truncated> > X; + X.push_back(compose(G, multi_gaussian_truncated(GSL_NEGINF,q[0], u))); + for(int i=1; i<100; i++) { + X.push_back(compose(G, multi_gaussian_truncated(q[i-1],q[i], u))); + } + for(int i=0; i<100; i=i+10){ + std::cout<<X[i]()<<endl; + } + stratified_sampling<compose_t <f_mu, multi_gaussian_truncated> > S(p, X); + S.draw(1000); + cout<<"l'estimateur de la moyenne est :"<<S.estimator().first<<endl; + //~ compose_t <f_mu, multi_gaussian_truncated> X = compose(G,MG); + //~ for(int i=0; i<10; i++){ + //~ std::cout<<X()<<std::endl; + //~ } } |
