Model Parameters¶
Class providing model parameters for Bayesian inference—the individual free parameters of a Galacticus model that are explored during parameter estimation (e.g.via MCMC). Each parameter has a name, a prior distribution (with logPrior, priorSample, priorInvert, priorMinimum, and priorMaximum methods), and a bijective mapping to an unconstrained real line for efficient sampling (via map/unmap). Implementations include active parameters that vary during inference, and fixed parameters held at constant values.
Default implementation: modelParameterActive
Methods¶
name→type(varying_string)Return the name of this parameter as it appears in the Galacticus parameter file and in output metadata, used to identify the parameter when applying posterior sampler updates.
logPrior→double precisionReturn the natural logarithm of the prior probability density evaluated at the physical parameter value
x, used in computing the log-posterior during Bayesian inference.double precision, intent(in ) :: x
priorSample→double precisionDraw a random sample from the prior distribution for this parameter, returning a physical parameter value; used to initialize the posterior sampler or generate prior predictive samples.
priorInvert→double precisionInvert the prior, returning the parameter value given the cumulative probability.
double precision, intent(in ) :: f
priorMinimum→double precisionReturn the minimum non-zero value of the prior for this parameter.
priorMaximum→double precisionReturn the maximum non-zero value of the prior for this parameter.
randomPerturbation→double precisionReturn a random perturbation for this parameter.
map→double precisionApply the bijective mapping to transform the physical parameter value
xonto the unconstrained real line used by the posterior sampler (e.g.logarithm for positive-definite parameters).double precision, intent(in ) :: x
unmap→double precisionApply the inverse bijective mapping to transform the sampler’s unconstrained variable
xback to the physical parameter value used to evaluate the model.double precision, intent(in ) :: x
mapJacobian→double precisionCompute the Jacobian of the map at the given parameter value.
double precision, intent(in ) :: x
modelParameterActive¶
An active model parameter class representing a free parameter that participates in posterior sampling, with a prior distribution, perturbation distribution, and optional mapping transformation. The parameter name is set by [name], with prior and perturbation distributions provided as objects, and a unary operator applied to transform the parameter value for model evaluation.
(Default implementation)
Methods
isSlow— Return true if changes in this paper may lead to slow likelihood evaluation.
Parameters
[name](defaultvar_str('')) — The name of the active model parameter as it appears in the Galacticus parameter file and output metadata; used to identify and retrieve the parameter during posterior sampling runs.[slow](default.false.) — If true, changes in the parameter are considered to result in slow likelihood evaluations.
modelParameterDerived¶
A model parameter class in which the parameter value is not sampled directly but instead derived algorithmically from other model parameters via a mathematical expression. The parameter name is set by [name] and the derivation formula by [definition], enabling computed quantities to be tracked as named parameters during posterior sampling.
Methods
definition— Return the definition for this parameter.isInteger— Return true if the parameter is an integer.
Parameters
[name]— The name of the derived model parameter as it appears in the Galacticus parameter file and posterior sampling output; used to identify this computed quantity in the parameter chain.[definition]— The mathematical expression or formula used to derive this parameter’s value from other model parameters during posterior sampling.[isInteger](default.false.) — If true the derived value is treated as an integer, otherwise it is considered to be a float.
modelParameterInactive¶
An inactive model parameter class representing a fixed parameter that does not participate in posterior sampling and has no prior distribution or perturbation applied during inference. The parameter name is set by [name], making it available as a named parameter in the model parameter set without affecting the sampling space.
Parameters
[name](defaultvar_str('')) — The name of the inactive model parameter as it appears in the Galacticus parameter file; held at a fixed value during posterior sampling without contributing to the sampler’s free parameter space.