From 861100a098452ddd02a9df1cf58ec8ea8fadf07f Mon Sep 17 00:00:00 2001 From: Bertrand Date: Tue, 9 Feb 2016 14:48:21 +0000 Subject: estimateur, intervalles de confiances ... --- stratified_sampling.hpp | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'stratified_sampling.hpp') diff --git a/stratified_sampling.hpp b/stratified_sampling.hpp index e9e1823..cf857ec 100644 --- a/stratified_sampling.hpp +++ b/stratified_sampling.hpp @@ -54,6 +54,7 @@ struct stratified_sampling { vector get_mean(); vector get_var(); void print_mean(); + void print_sigma(); pair estimator(); private: vector p; @@ -97,22 +98,16 @@ void stratified_sampling::update(int Nk) { double scal = std::inner_product(p.begin(), p.end(), sigma.begin(), (double) 0); for (int i=0; i < I; i++) { m[i] = (Nk-I)*p[i]*sigma[i]/scal; - std::cout< @@ -143,16 +138,26 @@ vector stratified_sampling::get_var() { template void stratified_sampling::print_mean() { - for(int i=0;i<10;i++){ + cout<<"les espérances :"< +void stratified_sampling::print_sigma() { + cout<<"les écarts types :"< pair stratified_sampling::estimator() { - double est_mean; - double est_std; + double est_mean = 0; + double est_std = 0; for (int i=0; i