It is well known in astronomy that propagating non-Gaussian prediction uncertainty in photometric redshift estimates is key to reducing bias in downstream cosmological analyses. Similarly, likelihood-free inference approaches, which are beginning to emerge as a tool for cosmological analysis, require a characterization of the full uncertainty landscape of the parameters of interest given observed data. However, most machine learning (ML) or training-based methods with open-source software target point prediction or classification, and hence fall short in quantifying uncertainty in complex regression and parameter inference settings. As an alternative to methods that focus on predicting the response (or parameters) $\mathbf{y}$ from features $\mathbf{x}$, we provide nonparametric conditional density estimation (CDE) tools for approximating and validating the entire probability density function (PDF) $\mathrm{p}(\mathbf{y}|\mathbf{x})$ of $\mathbf{y}$ given (i.e., conditional on) $\mathbf{x}$. As there is no one-size-fits-all CDE method, the goal of this work is to provide a comprehensive range of statistical tools and open-source software for nonparametric CDE and method assessment which can accommodate different types of settings and be easily fit to the problem at hand. Specifically, we introduce four CDE software packages in $\texttt{Python}$ and $\texttt{R}$ based on ML prediction methods adapted and optimized for CDE: $\texttt{NNKCDE}$, $\texttt{RFCDE}$, $\texttt{FlexCode}$, and $\texttt{DeepCDE}$. Furthermore, we present the $\texttt{cdetools}$ package, which includes functions for computing a CDE loss function for tuning and assessing the quality of individual PDFs, along with diagnostic functions. We provide sample code in $\texttt{Python}$ and $\texttt{R}$ as well as examples of applications to photometric redshift estimation and likelihood-free cosmological inference via CDE.
A t-test is considered a standard procedure for inference on population means and is widely used in scientific discovery. However, as a special case of a likelihood-ratio test, t-test often shows drastic performance degradation due to the deviations from its hard-to-verify distributional assumptions. Alternatively, in this article, we propose a new two-sample Lq-likelihood-ratio-type test (LqRT) along with an easy-to-use Python package for implementation. LqRT preserves high power when the distributional assumption is violated, and maintains the satisfactory performance when the assumption is …
We present $\textbf{PyRMLE}$, a Python module that implements Regularized Maximum Likelihood Estimation for the analysis of Random Coefficient models. $\textbf{PyRMLE}$ is simple to use and readily works with data formats that are typical to Random Coefficient problems. The module makes use of Python's scientific libraries $\textbf{NumPy}$ and $\textbf{SciPy}$ for computational efficiency. The main implementation of the algorithm is executed purely in Python code which takes advantage of Python's high-level features.
focus and focus-cpt: Fast Online Changepoint Detection in R and Python
Lancaster University(兰开斯特大学);Université Paris-Saclay, CNRS, INRAE, Univ Evry, Institute of Plant Sciences Paris-Saclay (IPS2)(巴黎萨克雷大学,法国国家科学研究中心,法国国家农业食品与环境研究院,埃夫里大学,巴黎萨克雷植物科学研究所);Université Paris-Saclay, AgroParisTech, INRAE, UMR MIA Paris-Saclay(巴黎萨克雷大学,巴黎高等师范学院农业学院,法国国家农业食品与环境研究院,巴黎萨克雷UMR MIA)
From data collection to photometric fitting and analysis of white dwarfs to generating a white dwarf luminosity function requires numerous Astrophysical, Mathematical and Computational domain knowledge. The steep learning curve makes it difficult to enter the field, and often individuals have to reinvent the wheel to perform identical data reduction and analysis tasks. We have gathered a wide range of publicly available white dwarf cooling models and synthetic photometry to provide a toolkit that allows (1) visualisation of various models, (2) photometric fitting of a white dwarf with or witho…
Common analysis techniques in multi-messenger astronomy involve hypothesis tests with unbinned log-likelihood (LLH) functions using data recorded in celestial coordinates to identify sources of high-energy cosmic particles in the Universe. We present the new Python-based tool "SkyLLH" to develop such analyses in a telescope-independent framework. The main goal of the software is to provide an easy-to-use and modularized concept to implement and to execute such LLH functions efficiently on the computer with high-performance. SkyLLH can be applied on different multi-messenger data like neutrino …
Lightstack: A Python Package for Creating Photometric Data Cubes
Universidade Federal do Rio Grande do Sul(南里奥格兰德联邦大学);University of Hertfordshire(赫特福德大学);University of North Carolina at Chapel Hill(北卡罗来纳大学教堂山分校);European Southern Observatory(欧洲南方天文台);Université Clermont Auvergne(克莱蒙奥弗涅大学);University of California, Irvine(加州大学尔湾分校)
In probabilistic (Bayesian) inferences, we typically want to compute properties of the posterior distribution, describing knowledge of unknown quantities in the context of a particular dataset and the assumed prior information. The marginal likelihood, also known as the "evidence", is a key quantity in Bayesian model selection. The Diffusive Nested Sampling algorithm, a variant of Nested Sampling, is a powerful tool for generating posterior samples and estimating marginal likelihoods. It is effective at solving complex problems including many where the posterior distribution is multimodal or h…
Obtaining accurately calibrated redshift distributions of photometric samples is one of the great challenges in photometric surveys like LSST, Euclid, HSC, KiDS, and DES. We present an inference methodology that combines the redshift information from the galaxy photometry with constraints from two-point functions, utilizing cross-correlations with spatially overlapping spectroscopic samples, and illustrate the approach on CosmoDC2 simulations. Our likelihood framework is designed to integrate directly into a typical large-scale structure and weak lensing analysis based on two-point functions. …
This research focuses on identifying high redshift galaxies from LABOCA(LArge APEX BOlometer CAmera) and SPIRE(The Spectral and Photometric Imaging Receiver) maps towards proto-cluster candidates initially selected from the SPT (South pole telescope) survey. Based on the Multi-Gaussian fitting algorithm, we cross-match all significant LABOCA sources at SPIRE wavelengths based on their coordinates and signal to noise ratio to derive their photometry at 250, 350, 500 and 870 $μm$. We use this information to calculate a photometric redshift for SPT sources towards cluster fields. The code was dev…
BayesicFitting is a comprehensive, general-purpose toolbox for simple and standardized model fitting. Its fitting options range from simple least-squares methods, via maximum likelihood to fully Bayesian inference, working on a multitude of available models. BayesicFitting is open source and has been in development and use since the 1990s. It has been applied to a variety of science applications, chiefly in astronomy. BayesicFitting consists of a collection of PYTHON classes that can be combined to solve quite complicated inference problems. Amongst the classes are models, fitters, priors, err…
pocoMC is a Python package for accelerated Bayesian inference in astronomy and cosmology. The code is designed to sample efficiently from posterior distributions with non-trivial geometry, including strong multimodality and non-linearity. To this end, pocoMC relies on the Preconditioned Monte Carlo algorithm which utilises a Normalising Flow in order to decorrelate the parameters of the posterior. It facilitates both tasks of parameter estimation and model comparison, focusing especially on computationally expensive applications. It allows fitting arbitrary models defined as a log-likelihood f…
PetroFit is an open-source Python package, based on Astropy and Photutils, that can calculate Petrosian profiles and fit galaxy images. It offers end-to-end tools for making accurate photometric measurements, estimating morphological properties, and fitting 2D models to galaxy images. Petrosian metric radii can be used for model parameter estimation and aperture photometry to provide accurate total fluxes. Correction tools are provided for improving Petrosian radii estimates affected by galaxy morphology. PetroFit also provides tools for sampling Astropy-based models (including custom profiles…
Spectral energy distributions (SEDs) are useful primary and complementary tools in the analysis of observations of young stars. However, the process of collating, inspecting, and flux-converting archival photometry and spectroscopy to build spectral energy distributions for young stars can be time-consuming. Here, I present SEDBYS (Spectral Energy Distribution Builder for Young Stars), a python-based repository of command-line tools built to (i) query online photometric and spectroscopic catalogs and a distributed database of archival photometry, (ii) use a look-up table of zero points to flux…
We present a Python package, pwv_kpno, that provides models for the atmospheric transmission due to precipitable water vapor (PWV) at user specified sites. Using the package, ground-based photometric observations taken between $3,000$ and $12,000$ $Å$ can be corrected for atmospheric effects due to PWV. Atmospheric transmission in the optical and near-infrared is highly dependent on the PWV column density along the line of sight. By measuring the delay of dual-band GPS signals through the atmosphere, the SuomiNet project provides accurate PWV measurements for hundreds of locations around the w…
Improving the Physical Interpretability of Gaussian Processes in Stellar Activity Modeling: A Study Case on Photometric Variability Among Stellar Clusters
Planétarium de Montréal, Espace pour la Vie(蒙特利尔天文馆,生命空间);Trottier Institute for Research on Exoplanets, Université de Montréal(特罗蒂尔系外行星研究所,蒙特利尔大学);Department of Astrophysics, American Museum of Natural History(美国自然历史博物馆天体物理学部);Department of Astronomy, Columbia University(哥伦比亚大学天文学系)
Data with uncertain, missing, censored, and correlated values are commonplace in many research fields including astronomy. Unfortunately, such data are often treated in an ad hoc way in the astronomical literature potentially resulting in inconsistent parameter estimates. Furthermore, in a realistic setting, the variables of interest or their errors may have non-normal distributions which complicates the modeling. I present a novel approach to compute the likelihood function for such data sets. This approach employs Gaussian copulas to decouple the correlation structure of variables and their …
UltraNest is a general-purpose Bayesian inference package for parameter estimation and model comparison. It allows fitting arbitrary models specified as likelihood functions written in Python, C, C++, Fortran, Julia or R. With a focus on correctness and speed (in that order), UltraNest is especially useful for multi-modal or non-Gaussian parameter spaces, computational expensive models, in robust pipelines. Parallelisation to computing clusters and resuming incomplete runs is available.
We describe the $\texttt{Period detection and Identification Pipeline Suite}$ ($\texttt{PIPS}$) -- a new, fast, and statistically robust platform for period detection and analysis of astrophysical time-series data. $\texttt{PIPS}$ is an open-source Python package that provides various pre-implemented methods and a customisable framework for automated, robust period measurements with principled uncertainties and statistical significance calculations. In addition to detailing the general algorithm that underlies $\texttt{PIPS}$, this paper discusses one of $\texttt{PIPS'}$ central and novel feat…
In the next decade, the LSST will become a major facility for the astronomical community. However accurately determining the redshifts of the observed galaxies without using spectroscopy is a major challenge. Reconstruction of the redshifts with high resolution and well-understood uncertainties is mandatory for many science goals, including the study of baryonic acoustic oscillations. We investigate different approaches to establish the accuracy that can be reached by the LSST six-band photometry. We construct a realistic mock galaxy catalog, based on the GOODS survey luminosity function, by s…
Approximate Bayesian Computation (ABC) enables parameter inference for complex physical systems in cases where the true likelihood function is unknown, unavailable, or computationally too expensive. It relies on the forward simulation of mock data and comparison between observed and synthetic catalogues. Here we present cosmoabc, a Python ABC sampler featuring a Population Monte Carlo (PMC) variation of the original ABC algorithm, which uses an adaptive importance sampling scheme. The code is very flexible and can be easily coupled to an external simulator, while allowing to incorporate arbitr…
Using a grid of $\sim 2$ million elements ($Δz = 0.005$) adapted from COSMOS photometric redshift (photo-z) searches, we investigate the general properties of template-based photo-z likelihood surfaces. We find these surfaces are filled with numerous local minima and large degeneracies that generally confound rapid but "greedy" optimization schemes, even with additional stochastic sampling methods. In order to robustly and efficiently explore these surfaces, we develop BAD-Z [Brisk Annealing-Driven Redshifts (Z)], which combines ensemble Markov Chain Monte Carlo (MCMC) sampling with simulated …
Hypothesis tests based on unbinned log-likelihood (LLH) functions are a common technique used in multi-messenger astronomy, including IceCube's neutrino point-source searches. We present the general Python-based tool "SkyLLH", which provides a modular framework for implementing and executing log-likelihood functions to perform data analyses with multi-messenger astronomy data. Specific SkyLLH framework features for a new and improved time-integrated IceCube point-source analysis are highlighted, including the support for kernel density estimation (KDE) based probability density functions. In a…
When we perform probabilistic inferences with the Gaia Mission data, we technically require a likelihood function, or a probability of the (raw-ish) data as a function of stellar (astrometric and photometric) properties. Unfortunately, we aren't (at present) given access to the Gaia data directly; we are only given a Catalog of derived astrometric properties for the stars. How do we perform probabilistic inferences in this context? The answer - implicit in many publications - is that we should look at the Gaia Catalog as containing the parameters of a likelihood function, or a probability of t…
We present a flexible template-based photometric redshift estimation framework, implemented in C#, that can be seamlessly integrated into a SQL database (or DB) server and executed on-demand in SQL. The DB integration eliminates the need to move large photometric datasets outside a database for redshift estimation, and utilizes the computational capabilities of DB hardware. The code is able to perform both maximum likelihood and Bayesian estimation, and can handle inputs of variable photometric filter sets and corresponding broad-band magnitudes. It is possible to take into account the full co…
The nature of dark matter (DM) is still an open question in Physics. Gamma-ray and neutrino telescopes have been searching for DM signatures for several years and no detection has been obtained so far. In their quest, these telescopes have gathered a wealth of observations that, if properly combined and analyzed, can improve on the constraints to the nature of DM set by individual instruments. In this contribution, we present two open-source analysis tools aimed at performing the before mentioned combined analysis: gLike, a general-purpose ROOT-based code framework for the numerical maximizati…
We present a new technique to fit color-magnitude diagrams of open clusters based on the Cross-Entropy global optimization algorithm. The method uses theoretical isochrones available in the literature and maximizes a weighted likelihood function based on distances measured in the color-magnitude space. The weights are obtained through a non parametric technique that takes into account the star distance to the observed center of the cluster, observed magnitude uncertainties, the stellar density profile of the cluster among others. The parameters determined simultaneously are distance, reddening…
Machine learning techniques offer a precious tool box for use within astronomy to solve problems involving so-called big data. They provide a means to make accurate predictions about a particular system without prior knowledge of the underlying physical processes of the data. In this article, and the companion papers of this series, we present the set of Generalized Linear Models (GLMs) as a fast alternative method for tackling general astronomical problems, including the ones related to the machine learning paradigm. To demonstrate the applicability of GLMs to inherently positive and continuo…
We present improved methods for using stars found in astronomical exposures to calibrate both star and galaxy colors as well as to adjust the instrument flat field. By developing a spectroscopic model for the SDSS stellar locus in color-color space, synthesizing an expected stellar locus, and simultaneously solving for all unknown zeropoints when fitting to the instrumental locus, we increase the calibration accuracy of stellar locus matching. We also use a new combined technique to estimate improved flat-field models for the Subaru SuprimeCam camera, forming `star flats' based on the magnitud…
We introduce a new method for analyzing sparse photometric data of asteroids and apply it to Zwicky Transient Facility observations of the Jupiter Trojan asteroids. The method relies on the creation of a likelihood model that includes the probability distribution of rotational brightness variations at an unknown rotation phase. The likelihood model is analyzed via a Markov Chain Monte Carlo to quantify the uncertainty in our parameter estimates. Using this method, we provide color, phase parameter, absolute magnitude and amplitude of rotation measurements for 1049 Jupiter Trojans. We find that…
We present allesfitter, a public and open-source python software for flexible and robust inference of stars and exoplanets given photometric and radial velocity data. Allesfitter offers a rich selection of orbital and transit/eclipse models, accommodating multiple exoplanets, multi-star systems, transit-timing variations, phase curves, stellar variability, star spots, stellar flares, and various systematic noise models including Gaussian Processes. It features both parameter estimation and Bayesian model selection, allowing to easily run either a Markov Chain Monte Carlo (MCMC) or Nested Sampl…