Aims. We aim to present a generalized Bayesian inference method for constraining interiors of super Earths and sub-Neptunes. Our methodology succeeds in quantifying the degeneracy and correlation of structural parameters for high dimensional parameter spaces. Specifically, we identify what constraints can be placed on composition and thickness of core, mantle, ice, ocean, and atmospheric layers given observations of mass, radius, and bulk refractory abundance constraints (Fe, Mg, Si) from observations of the host star’s photospheric composition.

Methods. We employed a full probabilistic Bayesian inference analysis that formally accounts for observational and model uncertainties. Using a Markov chain Monte Carlo technique, we computed joint and marginal posterior probability distributions for all structural parameters of interest. We included state-of-the-art structural models based on self-consistent thermodynamics of core, mantle, high-pressure ice, and liquid water. Furthermore, we tested and compared two different atmospheric models that are tailored for modeling thick and thin atmospheres, respectively.

Results. First, we validate our method against Neptune. Second, we apply it to synthetic exoplanets of fixed mass and determine the effect on interior structure and composition when (1) radius; (2) atmospheric model; (3) data uncertainties; (4) semi-major axes; (5) atmospheric composition (i.e., a priori assumption of enriched envelopes versus pure H/He envelopes); and (6) prior distributions are varied.

Conclusions. Our main conclusions are: (1) given available data, the range of possible interior structures is large; quantification of the degeneracy of possible interiors is therefore indispensable for meaningful planet characterization. (2) Our method predicts models that agree with independent estimates of Neptune’s interior. (3) Increasing the precision in mass and radius leads to much improved constraints on ice mass fraction, size of rocky interior, but little improvement in the composition of the gas layer, whereas an increase in the precision of stellar abundances enables to better constrain mantle composition and relative core size; (4) for thick atmospheres, the choice of atmospheric model can have significant influence on interior predictions, including the rocky and icy interior. The preferred atmospheric model is determined by envelope mass. This study provides a methodology for rigorously analyzing general interior structures of exoplanets which may help to understand how exoplanet interior types are distributed among star systems. This study is relevant in the interpretation of future data from missions such as TESS, CHEOPS, and PLATO.