Commit 1a4b1652 by Rustam Gainutdinov

### Added MCMC parameter estimation for massless Two-Body problem

parent 04e1013a
 __precompile__() module Cornerplot #Pretty corner plot for MCMC chains using PyPlot using Statistics export chain_estimates, cornerplot function chain_estimates(fchain) n = size(fchain)[1] fchmeds = [quantile!(fchain[i,:], 0.5) for i in 1:n] f_alims = [quantile!(fchain[i,:], 0.16) for i in 1:n] f_blims = [quantile!(fchain[i,:], 0.84) for i in 1:n] f_lerr = fchmeds - f_alims f_rerr = f_blims - fchmeds return fchmeds, f_lerr, f_rerr end function cornerplot(fchain, lnames, lnames_ed, hbinsize, cmap, errsize) println("Printing...") n = size(fchain)[1] figure(figsize = (25,25)) fchmeds, f_lerr, f_rerr = chain_estimates(fchain) fchmedsstr = string.(round.(fchmeds; sigdigits=3)) f_lerrstr = string.(round.(f_lerr; sigdigits=3)) f_rerrstr = string.(round.(f_rerr; sigdigits=3)) lborders = fchmeds .- f_lerr .* errsize rborders = fchmeds .+ f_rerr .* errsize flims = [(lborders[i], rborders[i]) for i in 1:n] for i in 1:n for j in 1:i ax = subplot2grid((n, n), (i-1, j-1)) if i == j mesh = fchain[i,:] mesh = mesh[flims[i][1] .< mesh .< flims[i][2]] #xlim(flims[i]) hist(mesh, bins=hbinsize) title("\\$"*lnames[i]*"="*fchmedsstr[i]*"^{+"*f_rerrstr[i]*"}_{-"*f_lerrstr[i]*"}\\$", fontsize=9) else #xlim(flims[j]) #ylim(flims[i]) mesh1 = fchain[j,:] mesh2 = fchain[i,:] mesh2 = mesh2[flims[j][1] .< mesh1 .< flims[j][2]] mesh1 = mesh1[flims[j][1] .< mesh1 .< flims[j][2]] mesh1 = mesh1[flims[i][1] .< mesh2 .< flims[i][2]] mesh2 = mesh2[flims[i][1] .< mesh2 .< flims[i][2]] hexbin(mesh1, mesh2, gridsize=hbinsize, cmap=cmap) end if i < n setp(ax.get_xticklabels(), visible=false) else xlabel(lnames_ed[j], fontsize=11) end if j > 1 || j == i && j == 1 setp(ax.get_yticklabels(), visible=false) elseif i > 1 ylabel(lnames_ed[i], fontsize=11) end end end tight_layout() end end
 __precompile__() module DataSets using CSV export sstars_data, θ₀ sstars_df = CSV.read("./data/sstarsdata.csv", header=false) sstars_t = sstars_df[!, 1] S2_RA = sstars_df[!, 2] S2_ΔRA = sstars_df[!, 3] S2_Dec = sstars_df[!, 4] S2_ΔDec = sstars_df[!, 5] S2_RV = sstars_df[!, 6] S2_ΔRV = sstars_df[!, 7] S38_RA = sstars_df[!, 8] S38_ΔRA = sstars_df[!, 9] S38_Dec = sstars_df[!, 10] S38_ΔDec = sstars_df[!, 11] S38_RV = sstars_df[!, 12] S38_ΔRV = sstars_df[!, 13] S55_RA = sstars_df[!, 14] S55_ΔRA = sstars_df[!, 15] S55_Dec = sstars_df[!, 16] S55_ΔDec = sstars_df[!, 17] S55_RV = sstars_df[!, 18] S55_ΔRV = sstars_df[!, 19] sstars_art = sstars_df[!, 20] sstars_data = [sstars_t, [S2_RA, S2_Dec, S2_RV, S38_RA, S38_Dec, S38_RV, S55_RA, S55_Dec, S55_RV], [S2_ΔRA, S2_ΔDec, S2_ΔRV, S38_ΔRA, S38_ΔDec, S38_ΔRV, S55_ΔRA, S55_ΔDec, S55_ΔRV]] θ₀ = [98947.158163, 161544.112937, -2.19582537e+02, 6.04500473e+02, 1.33902287e+02, 2.26126780e+02, 215932.83605999997, 29862.5963615, 6.71724897e+01, 5.87446040e+02, 1.70792316e+02, 9.34728478e+01, 139381.778738, -37591.510541999996, -3.45931227e+02, 1.00503663e+03, 1.53023909e+02, 3.23354746e+02, 4.31, 8.3, 0.0, 0.0, -3.49118611e-06, 1.47495749e-05, 1.0, 1.0] end
 ... ... @@ -34,7 +34,4 @@ module EoMs end #S2 params: 98947.158163, 161544.112937, -0.0007324487518145469, 0.0020163968040454333, 4.31, 1.0, 1.0 #θ₀ = [(98947.158163, 161544.112937, -2.19582537e+02, 6.04500473e+02, 1.33902287e+02, 2.26126780e+02), (215932.83605999997, 29862.5963615, 6.71724897e+01, 5.87446040e+02, 1.70792316e+02, 9.34728478e+01), (139381.778738, -37591.510541999996, -3.45931227e+02, 1.00503663e+03, 1.53023909e+02, 3.23354746e+02), 4.31, 8.3, 0.0, 0.0, -3.49118611e-06, 1.47495749e-05, 1.0, 1.0] end