aboutsummaryrefslogtreecommitdiffstats
path: root/src/projet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/projet.cpp')
-rw-r--r--src/projet.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/projet.cpp b/src/projet.cpp
index af322ed..9d3ac15 100644
--- a/src/projet.cpp
+++ b/src/projet.cpp
@@ -82,7 +82,7 @@ std::vector<double> normalize (std::vector<double> mu) {
u = normalize(mu);
vector<double> q = quantile_norm(100, 1);
vector<double> p(100, 0.01);
- asian_option A(0.05, 1.0, 50, 0.1, d, 45);
+ asian_option A(0.05, 1.0, 50, 0.1, 45, true);
exponential_tilt<asian_option> G(mu, A);
typedef compose_t<exponential_tilt<asian_option>, multi_gaussian_truncated> tilted_option;
std::vector<tilted_option> X;
@@ -90,16 +90,13 @@ std::vector<double> normalize (std::vector<double> mu) {
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<tilted_option> S(p, X);
- S.draw(1000);
+ S.draw(1000000);
cout<<"l'estimateur de la moyenne est :"<<S.estimator().first<<endl;
}
void exemple2_rqmc(int d) {
- asian_option A(0.05, 1.0, 50.0, 0.1, 16, 45);
+ asian_option A(0.05, 1.0, 50.0, 0.1, 45,true);
int N= 10000;
@@ -116,7 +113,7 @@ void exemple2_rqmc(int d) {
}
};
-int make_table(vector< vector<double> > data1, vector< vector<double> > data2) {
+int make_table1(vector< vector<double> > data1, vector< vector<double> > data2) {
std::fstream fs("doc/table.tex", std::fstream::out);;
fs<<R"(\begin{tabular}{|r|rr|rr|c|})"<<std::endl;
fs<<R"(\hline)"<<endl;
@@ -139,7 +136,7 @@ int main()
vector< vector<double> > data1 = exemple1_stratified();
cout<<"Randomised quasi Monte-Carlo sur l'exemple 1 de la normale"<<endl;
vector< vector<double> > data2 = exemple1_rqmc();
- make_table(data1, data2);
+ make_table1(data1, data2);
exemple2_stratified(16);
return 0;