Displaying 4 results from an estimated 4 matches for "gsl_rng_mt19937".
2016 Aug 31
1
A bug in the R Mersenne Twister (RNG) code?
...g the default RNG definitely
| introduces problems in reproducibility, so it's not obvious that we
| would do it.
Yep. FWIW the GNU GSL adopted the 2002 version a while ago too. Quoting from
https://www.gnu.org/software/gsl/manual/html_node/Random-number-generator-algorithms.html
Generator: gsl_rng_mt19937
The MT19937 generator of Makoto Matsumoto and Takuji Nishimura is a
variant of the twisted generalized feedback shift-register algorithm, and
is known as the ?Mersenne Twister? generator. It has a Mersenne prime
period of 2^19937 - 1 (about 10^6000) and is equi-distributed in 623
di...
2012 Jun 09
0
-lgsl -lgslcblas fatal error no such file or directory
...h>
#include <math.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 a...
2012 Jun 16
0
R CMD -lgsl -lgslcblas *.c returns a fatal error: gsl/gsl_rng.h no such file or directory exists
...t;
#include <math.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 advic...
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