Skip to content

Commit

Permalink
more precise theoretical GFS
Browse files Browse the repository at this point in the history
  • Loading branch information
fbaumdicker committed Feb 23, 2018
1 parent 14352ff commit ae8cb87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Binary file modified panicmage
Binary file not shown.
7 changes: 4 additions & 3 deletions source/treestatistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ void theoGfs_core (float *gfs, int nsam, float theta, float rho, float core) {
int k,l;
float l2;
for (k = 1; k <= nsam; k++){
gfs[k-1] = theta/((float) k );
gfs[k-1] = std::log(theta/((float) k ) );
for( l = nsam; l >= nsam-k+1; l--){
gfs[k-1] *= l;
gfs[k-1] += std::log(l);
}
for( l2 = ((float)nsam)-1.+rho ; l2 > ((float)nsam)-k+rho-0.5; l2 -= 1.){
gfs[k-1] *= 1./l2;
gfs[k-1] += std::log(1./l2);
}
gfs[k-1] = std::exp(gfs[k-1]);
}
gfs[nsam-1] = gfs[nsam-1]+core;
// R code to do the same
Expand Down

0 comments on commit ae8cb87

Please sign in to comment.