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 ... --- main.cpp | 24 +++++++++++++++++------- qmc | 1 + rtnorm | Bin 0 -> 9538576 bytes stratified_sampling.hpp | 29 +++++++++++++++++------------ 4 files changed, 35 insertions(+), 19 deletions(-) create mode 160000 qmc create mode 100644 rtnorm 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 S(p,rvar); S.update(100); S.draw(); - for(int i=0;i<10;i++){ - cout< 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