1
$\begingroup$

I am trying to fit non-linear equation base explanation of the Mathemaica package https://github.com/joshburkart in the Computational Bayesian analysis in Mathematica: Any plans to develop MCMC? .But as I try define list of data for my code it's confusing for me, how define it.

Import["mcmc.m"];

datalens = 
  Import[
   "https://github.com/soroushnajafian/strong-lensing-data/blob/main/stronglens.dat", 
   HeaderLines -> 1];

ELCDM[z_?NumberQ, om_?NumberQ] := 1/Sqrt[om*(1 + z)^3 + 1-om];

angdist[zmin_?NumberQ, zmax_?NumberQ, om_?NumberQ] := 
  (3*10^5)/(1 + zmax) NIntegrate[ELCDM[z, om], {z, zmin, zmax}];

Dtheory[zmin_?NumberQ, zmax_?NumberQ, om_?NumberQ] := 
  angdist[zmin, zmax, om]/angdist[zmin*0, zmax, om];

newtable = Table[
  {datalens[[row, 2]], datalens[[row, 3]], datalens[[row, 5]]}, 
  {row, 1, Length[datalens]}];

sigma2list = datalens[[All, 6]];

errors = sigma2list;

spr = 0.04;

mcmc1 = 
  MCMCModelFit[newtable, errors, errors, 
    Dtheory[x, y, om], {{om, .2, spr, Real}}, {{x, y}}, 100000];
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.