Displaying 1 result from an estimated 1 matches for "accept_prob_fn".
2003 Dec 14
1
compile error with C code and standalone R math C library
...THETA 2
#include <Rmath.h>
#include <time.h>
void advance(double *node, int *current_pos, double newval);
void retreat(double *node, int *current_pos);
double new_val(double *node, double theta, int current_pos);
double accept_prob(double *node, double theta, int current_pos);
double accept_prob_fn(double a, double y);
int main()
{
int currentpos = 0;
int i;
double newval, node[T+2], theta = THETA, p, u;
set_seed(time(NULL), clock());
node[0]=0;
for(i=1;i<=T;i++)
node[i]= INITVAL; /* for simplicity choose all values the same */
node[T+1]=0;
for(i=0; currentpos <...