Help with the JASP Likelihood Function (MATLAB)
Hi all, I am trying to implement the JZS/objective approach to calculating Bayes Factors (the approach used in JASP and the R BayesFactor package) in Matlab, with a view toward creating a power analysis toolkit. Although I am close, the BFs I calculate are slightly off compared to JASP and the PCL web tool.
I understand the objective prior, and my implementation looks identical to that in JASP. But I'm not clear on the Likelihood function, and the likelihood I calculate appears different from what appears in JASP. I have tried a few but here was my closest:
@(delta) tpdf( (sample.mean - (delta * sample.se * sqrt(sample.n)) ) / sample.se, sample.n-1);
JASP doesn't provide any likelihood info, and the R code may as well be hieroglyphics for as clear as it is to me. So I can really only judge by comparing the graphs in JASP to the ones I produce (example below). It appears that my prior matches but the posterior is slightly taller and narrower, presumably because of the likelihood calculation.
So, is my likelihood calculation off? Thanks if anyone can help.
By the way, probably aggravating this confusion is that I'm not clear what the x axis represents in this analysis (labelled as "Effect Size delta"). Am I correct in thinking this is Cohen's d? But we use t distributions so I get confused whether it is related to the_ t _stat or the delta parameter from a noncentral t distribution.