diff options
| author | Bertrand <bertrand.horel@gmail.com> | 2016-02-09 14:48:21 +0000 |
|---|---|---|
| committer | Bertrand <bertrand.horel@gmail.com> | 2016-02-09 14:48:21 +0000 |
| commit | 861100a098452ddd02a9df1cf58ec8ea8fadf07f (patch) | |
| tree | cf665c94dc745ee97dde1da64c12bfe4b70a0f1c /main.cpp | |
| parent | 486c1e061bfe039b0d8baa7cb59cab8f3b8e07ba (diff) | |
| download | projet_C++-861100a098452ddd02a9df1cf58ec8ea8fadf07f.tar.gz | |
estimateur, intervalles de confiances ...
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; } |
