diff options
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -31,13 +31,23 @@ int main() stratified_sampling<gaussian_truncated> S(p,rvar); S.update(100); S.draw(); - for(int i=0;i<10;i++){ - cout<<S.get_mean()[i]<<endl; - } - S.update(500); + double x = 1.64*S.estimator().second; + cout<<"l'estimateur de la moyenne est :"<<S.estimator().first<<endl; + cout<<"Son intervalle de confiance à 95% est :"<<"["<<S.estimator().first-(x/10)<<" ,"<<S.estimator().first+(x/10)<<"]"<<endl; + S.update(1000); S.draw(); - for(int i=0;i<10;i++){ - cout<<S.get_mean()[i]<<endl; - } + x = 1,64*S.estimator().second; + cout<<"l'estimateur de la moyenne est :"<<S.estimator().first<<endl; + cout<<"Son intervalle de confiance à 95% est :"<<"["<<S.estimator().first-(x/sqrt(1100))<<" ,"<<S.estimator().first+(x/sqrt(1100))<<"]"<<endl; + S.update(10000); + S.draw(); + x = 1,64*S.estimator().second; + cout<<"l'estimateur de la moyenne est :"<<S.estimator().first<<endl; + cout<<"Son intervalle de confiance à 95% est :"<<"["<<S.estimator().first-(x/sqrt(11100))<<" ,"<<S.estimator().first+(x/sqrt(11100))<<"]"<<endl; + + //~ S.draw(); + //~ for(int i=0;i<10;i++){ + //~ cout<<S.get_mean()[i]<<endl; + //~ } return 0; } |
