pro bayesian_rho,r,n, rho,prob_rho,plot=plot,oplot=oplot,pos=pos,$ check=check,title0=TITLE0 if(n_params() le 0) then begin print,'-----------------------------------------' print,'bayesian_rho,r,n,rho,prob_rho,plot=plot,title0=title0' print,'-----------------------------------------' print,'Calculate the Jeffreys pdf (WJ 4.7) of rho' print,'based on data of N pairs with a Pearson r' print,'(+assuming a bivariate Gaussians + uniform prior for rho) print,' input: r,n print,' output: rho,prob_rho' print,'' print,'/plot -> plot distribution' print,'/oplot -> oplot distribution' print,' pos - returns probability of positive rho' print,' check=[nrho,ntrial] -> check the distribution by creating' print,' ntrial bivariate Gaussians for each' print,' nrho values of rho in a range of -1