aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorBertrand <bertrand.horel@gmail.com>2016-02-09 14:48:21 +0000
committerBertrand <bertrand.horel@gmail.com>2016-02-09 14:48:21 +0000
commit861100a098452ddd02a9df1cf58ec8ea8fadf07f (patch)
treecf665c94dc745ee97dde1da64c12bfe4b70a0f1c /main.cpp
parent486c1e061bfe039b0d8baa7cb59cab8f3b8e07ba (diff)
downloadprojet_C++-861100a098452ddd02a9df1cf58ec8ea8fadf07f.tar.gz
estimateur, intervalles de confiances ...
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/main.cpp b/main.cpp
index 8692967..0728976 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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;
}