search for: gsl_rng_set

Displaying 6 results from an estimated 6 matches for "gsl_rng_set".

2016 Aug 31
1
A bug in the R Mersenne Twister (RNG) code?
...937 - 1 (about 10^6000) and is equi-distributed in 623 dimensions. It has passed the DIEHARD statistical tests. It uses 624 words of state per generator and is comparable in speed to the other generators. The original generator used a default seed of 4357 and choosing s equal to zero in gsl_rng_set reproduces this. Later versions switched to 5489 as the default seed, you can choose this explicitly via gsl_rng_set instead if you require it. For more information see, Makoto Matsumoto and Takuji Nishimura, ?Mersenne Twister: A 623-dimensionally equidistributed uniform pseu...
2012 Jun 09
0
-lgsl -lgslcblas fatal error no such file or directory
...h.h> #include <stdlib.h> #include <gsl/gsl_rng.h> #include <gsl/gsl_randist.h> #include <R.h> void gibbsGSL(int *Np,int *thinp,int *seedp,double *xvec,double *yvec) { int i,j; int N=*Np,thin=*thinp,seed=*seedp; gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937); gsl_rng_set(r,seed); double x=0; double y=0; for (i=0;i<N;i++) { for (j=0;j<thin;j++) { x=gsl_ran_gamma(r,3.0,1.0/(y*y+4)); y=1.0/(x+1)+gsl_ran_gaussian(r,1.0/sqrt(2*x+2)); } xvec[i]=x; yvec[i]=y; } } Any advice would be appreciated. -- Vi...
2009 Dec 22
0
Rcpp 0.7.0: R/C++ integration now even easier
...to pass down a parameter for the seed, and a vector size gslrng <- ' int seed = RcppSexp(s).asInt(); int len = RcppSexp(n).asInt(); gsl_rng *r; gsl_rng_env_setup(); std::vector<double> v(len); r = gsl_rng_alloc (gsl_rng_default); gsl_rng_set (r, (unsigned long) seed); for (int i=0; i<len; i++) { v[i] = gsl_rng_get (r); } gsl_rng_free(r); return RcppSexp(v).asSexp(); ' ## turn into a function that R can call ## compileargs redundant on Debian/Ubuntu as gsl headers are found...
2009 Dec 22
0
Rcpp 0.7.0: R/C++ integration now even easier
...to pass down a parameter for the seed, and a vector size gslrng <- ' int seed = RcppSexp(s).asInt(); int len = RcppSexp(n).asInt(); gsl_rng *r; gsl_rng_env_setup(); std::vector<double> v(len); r = gsl_rng_alloc (gsl_rng_default); gsl_rng_set (r, (unsigned long) seed); for (int i=0; i<len; i++) { v[i] = gsl_rng_get (r); } gsl_rng_free(r); return RcppSexp(v).asSexp(); ' ## turn into a function that R can call ## compileargs redundant on Debian/Ubuntu as gsl headers are found...
2012 Jun 16
0
R CMD -lgsl -lgslcblas *.c returns a fatal error: gsl/gsl_rng.h no such file or directory exists
...gt; #include <stdlib.h> #include <gsl/gsl_rng.h> #include <gsl/gsl_randist.h> #include <R.h> void gibbsGSL(int *Np,int *thinp,int *seedp,double *xvec,double *yvec) { int i,j; int N=*Np,thin=*thinp,seed=*seedp; gsl_rng *r = gsl_rng_alloc(gsl_rng_mt19937); gsl_rng_set(r,seed); double x=0; double y=0; for (i=0;i<N;i++) { for (j=0;j<thin;j++) { x=gsl_ran_gamma(r,3.0,1.0/(y*y+4)); y=1.0/(x+1)+gsl_ran_gaussian(r,1.0/sqrt(2*x+2)); } xvec[i]=x; yvec[i]=y; } } Any advice would be apprecia...
2016 Aug 30
4
A bug in the R Mersenne Twister (RNG) code?
Whomever, I recently sent the "bug report" below toR-core at r-project.org and have just been asked to instead submit it to you. Although I am basically not an R user, I have installed version 3.3.1 and am also the author of a statistics program written in Visual Basic that contains a component which correctly implements the Mersenne Twister (MT) algorithm. I believe that it is