Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Adjusting the prior for correlations - matlab code

edited October 2016 in JASP & BayesFactor

Hi there,

I have been using the matlab code below to calculate BFs for correlations - I am looking to adjust the prior scale by sqrt(2), but to be honest the maths are confusing me - could anybody provide any insight into what I would need to change and how?

The code I am using is:

%%Original function fro, Sam Pen Du.
% Function to be integrated
F = @(g,r,n) exp(((n-2)./2).*log(1+g)+(-(n-1)./2).*log(1+(1-r.^2).*g)+(-3./2).*log(g)+-n./(2.*g));
% Bayes factor calculation
bf10 = sqrt((n/2)) / gamma(1/2) * integral(@(g) F(g,r,n),0,Inf)

Many thanks,
Leah

Comments

Sign In or Register to comment.