sweverett / CluStR

Calculates various scaling relations from cluster catalogs.
5 stars 4 forks source link

using parts other peoples code? #33

Closed paigemkelly closed 4 years ago

paigemkelly commented 4 years ago

Can we use parts of Brandon Kelly's code for the fitting class we have? or is that not allowed?

sweverett commented 4 years ago

reglib is just writing code that wraps around other people's fitters! The following lines in run_linmix() is where all the action is happening:

model = linmix.LinMix(x, y, err_x, err_y, xycov, delta, 2, 2)
model.run_mcmc(Nmin, Nmax, silent=vb)

We still want to use that

sweverett commented 4 years ago

In other words - you should be able to leave the run_linmix() function alone and use it as is.

jjobel commented 4 years ago

In the reglib.py, What is the Nmin=5000 and Nmax=5000? and do we need to know how mcmc works? (part of def run_linmix)

sweverett commented 4 years ago

It's the min and max number of Monte Carlo samples respectively before quitting the fitter. run_mcmc() is running the Monte-Carlo Markov Chain (MCMC) that (hopefully) efficiently samples the parameter space of the fancy linear model we're fitting. It returns the chains of slopes, intercepts, and intrinsic scatters for each sample in the MCMC. We often just use the mean value of the chains, but you can do fancier things like looking at the distribution of values in the chain (the posterior).

I can look for some online resources if you aren't too familiar with how MCMC's work.