aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stratified_sampling.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/stratified_sampling.cpp b/stratified_sampling.cpp
new file mode 100644
index 0000000..1ba7360
--- /dev/null
+++ b/stratified_sampling.cpp
@@ -0,0 +1,28 @@
+#include <iostream>
+#include <gsl/gsl_rng.h>
+
+#include "rtnorm.hpp"
+#include <gsl/gsl_cdf.h>
+
+
+
+//--génération quantiles--
+std::vector<double> quantile_norm(int n, double sigma){
+ vector<double> quantile_norm(n);
+ for (int i=0, i<n, i++) {
+ quantile_norm[i]=gsl_cdf_gaussian_Pinv (i/n, sigma);
+ }
+ return quantile_norm;
+}
+
+int main()
+{
+ //--- GSL random init ---
+ gsl_rng_env_setup(); // Read variable environnement
+ const gsl_rng_type* type = gsl_rng_default; // Default algorithm 'twister'
+ gsl_rng *gen = gsl_rng_alloc (type); // Rand generator allocation
+
+
+ return 0;
+}
+