fidanka.fiducial.methods package
Submodules
fidanka.fiducial.methods.mc module
- fidanka.fiducial.methods.mc.log_likelihood(theta: ndarray[Any, dtype[float64]], binned_mag: ndarray[Any, dtype[[numpy.ndarray[Any, numpy.dtype[numpy.float64]], numpy.ndarray[Any, numpy.dtype[numpy.float64]]]]], binned_color: ndarray[Any, dtype[[numpy.ndarray[Any, numpy.dtype[numpy.float64]], numpy.ndarray[Any, numpy.dtype[numpy.float64]]]]], binned_color_err: ndarray[Any, dtype[[numpy.ndarray[Any, numpy.dtype[numpy.float64]], numpy.ndarray[Any, numpy.dtype[numpy.float64]]]]]) float
Calculate the logrithmic likelihood for given parameters
- Parameters:
theta (FARRAY_1D) – Parameters corresponding to the color (first half) and magnitude ( second half) of each bin
binned_mag (FARRAY_2D_2C,) – binned magnitude of all input data
binned_color – binned color of all input data
binned_color_err (FARRAY_2D_2C,) – binned color of all input data
- Returns:
log_like – logrithmic likelihood of given set of parameters
- Return type:
float
- fidanka.fiducial.methods.mc.log_prior(theta: ndarray[Any, dtype[float64]], binsLeft: ndarray[Any, dtype[float64]], binsRight: ndarray[Any, dtype[float64]], colorLeft: ndarray[Any, dtype[float64]], colorRight: ndarray[Any, dtype[float64]]) float
provide an uninformative prior for mcmc
- Parameters:
theta (FARRAY_1D) – Parameters corresponding to the color (first half) and magnitude ( second half) of each bin
binsLeft (ndarray[float64]) – left edges of bins in magnitude space
binsRight (ndarray[float64]) – right edges of bins in magnitude space
colorLeft (ndarray[float64]) – left edges of bins in color space
colorRight (ndarray[float64]) – right edges of bins in color space
- Returns:
prior – a uniform prior within the boundary
- Return type:
float
- fidanka.fiducial.methods.mc.log_probability(theta: ndarray[Any, dtype[float64]], binned_color: ndarray[Any, dtype[[numpy.ndarray[Any, numpy.dtype[numpy.float64]], numpy.ndarray[Any, numpy.dtype[numpy.float64]]]]], binned_mag: ndarray[Any, dtype[[numpy.ndarray[Any, numpy.dtype[numpy.float64]], numpy.ndarray[Any, numpy.dtype[numpy.float64]]]]], binned_color_err: ndarray[Any, dtype[[numpy.ndarray[Any, numpy.dtype[numpy.float64]], numpy.ndarray[Any, numpy.dtype[numpy.float64]]]]], binsLeft: ndarray[Any, dtype[float64]], binsRight: ndarray[Any, dtype[float64]], colorLeft: ndarray[Any, dtype[float64]], colorRight: ndarray[Any, dtype[float64]]) float
Calculate the logrithmic probabilty for the parameter. Note, compare to the verticalized cmd method, this method also take into the consideration of the relation between neighbor bins. The main drawbacks of mcmc is that it is very ineffcient in recovering those parameters when they are highly correlated and the curse of dimensionality also suggests that using mcmc in this case can be very computationally expensive.
- Parameters:
theta (FARRAY_1D,) – Parameters corresponding to the color (first half) and magnitude ( second half) of each bin
binned_mag (FARRAY_2D_2C,) – binned magnitude of all input data
binned_color – binned color of all input data
binned_color_err (FARRAY_2D_2C,) – binned color of all input data
binsLeft (ndarray[float64]) – left edges of bins in magnitude space
binsRight (ndarray[float64]) – right edges of bins in magnitude space
colorLeft (ndarray[float64]) – left edges of bins in color space
colorRight (ndarray[float64]) – right edges of bins in color space
- Returns:
logrithmic probability of given sets of parameters
- Return type:
log_prop
- fidanka.fiducial.methods.mc.plm(color, mag, error1, error2, piecewise_linear, binsLeft, binsRight, i, allowMax)