diff options
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; + //~ } } |
