AxisymmetricDSphEstimationModel#

jeanspy.model.AxisymmetricDSphEstimationModel

See methods and properties for individual lookup pages, or the alphabetical API dictionary to search all classes. The full class contract and existing member anchors are retained below.

class jeanspy.model.AxisymmetricDSphEstimationModel(data, prior, *, dsph_model=None, fixed_params=None, photometry_prior=None, parameter_specs=None)[source]#

Bases: object

Unbinned Gaussian LOS inference with the emcee sampler interface.

prior is a FlatPriorModel, a DataFrame, or a CSV with finite lower/upper bounds. Its row order defines the sampler coordinates. fixed_params supplies remaining physical parameters; sampled and fixed names must be disjoint. Stored components supply defaults for parameters not sampled; explicit fixed_params override those defaults. Supply exactly one of q and q_projected across the resulting physical schema.

An optional PhotometryPriorModel multiplies the flat prior on a coordinate explicitly mapped by pow10 to re_pc. A uniform coordinate mapped by arccos to inclination gives an isotropic orientation prior restricted to its explicitly supplied bounds. The solver also enforces physically admissible deprojection and nonnegative moments.

Notes

Inputs and units. data follows AxisymmetricKinematicData; prior is FlatPriorModel or ordered lower/upper DataFrame; fixed_params complements sampled names; dsph_model is a NumPy AxisymmetricDSphModel. p is shape (ndim,) in prior order. parameter_specs contains ordered jeanspy.parameters.SamplingParameter objects. Without specifications, coordinates map by identity only; names never imply a transformation.

Returns and shape. Per-star/summed log likelihoods and prior terms. lnposterior returns posterior plus diagnostic blobs; sample(size,rng=…) generates admissible starting coordinates; sample_data(p,rng=...) returns a NumPy array of simulated LOS velocities in km/s, shape (N,), conditional on the stored positions and measurement errors.

Validity. Gaussian LOS velocity likelihood at fixed positions; beta_z is distinct from spherical anisotropy. Exactly one of intrinsic/projected tracer flattening must be specified. Photometric prior is optional and explicit.

Errors. Malformed schema/data or sampled/fixed collisions raise ValueError; inadmissible proposals give minus-infinite posterior. sample raises after max_attempts if no valid point is found.

Backend. NumPy/SciPy CPU; stateful components, with no JAX tracing.

Differentiation. No physical-parameter automatic differentiation on this API.

Examples. examples/axisymmetric_inference.py

name = 'AxisymmetricDSphEstimationModel'#
property p_names_lnprob#

Return sampling-coordinate names in their validated prior-table order.

property ndim#

Return the integer number of free sampling coordinates.

property prior_names#

Return log-prior term names in blob order, including optional photometry.

property blobs_dtype#

Return emcee blob fields for the log likelihood and ordered log-prior terms.

property n_data#

Return the integer number of observed stars.

property data#

Return a validated copy of the stored axisymmetric kinematic catalogue.

The AxisymmetricKinematicData arrays have shape (N,); x_pc/y_pc are in pc and velocities/errors are in km/s.

property inverse_temperature#

Return the WBIC inverse temperature 1/log(N), requiring N > 1.

reset_data(data)[source]#

Validate a replacement completely before changing any observations.

convert_params(p)[source]#

Map sampling coordinates to physical parameters.

Notes

Inputs and units. One parameter vector in exact prior order; parameter_specs explicitly defines the physical names and transforms.

Returns and shape. Named physical parameters with pc, Msun/pc^3, km/s, radians and dimensionless quantities as appropriate. The axisymmetric result also incorporates fixed_params.

lnlikelihoods(p)[source]#

Return one log likelihood per star, including measurement errors.

Notes

Inputs and units. p is one parameter vector of shape (ndim,) in p_names_lnprob order. Uses already loaded observations.

Returns and shape. Per-star log densities, shape (N,).

lnlikelihood(p)[source]#

Evaluate the explicit kinematic inference target.

Notes

Inputs and units. p is one parameter vector of shape (ndim,) in p_names_lnprob order. Uses already loaded observations.

Returns and shape. Scalar sum of log likelihoods.

lnpriors(p)[source]#

Evaluate the explicit kinematic inference target.

Notes

Inputs and units. p is one parameter vector of shape (ndim,) in p_names_lnprob order. Uses already loaded observations.

Returns and shape. Sequence of log prior contributions in prior_names order.

lnposterior(p)[source]#

Evaluate the explicit kinematic inference target.

Notes

Inputs and units. p is one parameter vector of shape (ndim,) in p_names_lnprob order. Uses already loaded observations.

Returns and shape. Tuple (logposterior, loglikelihood, individual prior terms) for emcee blobs.

lnposterior_wbic(p)[source]#

Evaluate the explicit kinematic inference target.

Notes

Inputs and units. p is one parameter vector of shape (ndim,) in p_names_lnprob order. Uses already loaded observations.

Returns and shape. Tuple using loglikelihood/log(N) plus the original prior; requires N>1.

sample(size=None, *, rng=None, max_attempts=1000)[source]#

Draw feasible starting points from the priors, with bounded rejection.

Pass a NumPy Generator or seed for reproducibility. Exhaustion raises rather than returning invalid walkers or changing the requested priors.

sample_data(p, *, rng=None)[source]#

Generate velocities conditional on the stored positions and errors.

sampling_identity()[source]#

Return host metadata describing the complete sampling target.

The dictionary contains the forward model, copied observations, prior table, fixed parameters, optional photometric prior and coordinate order. The persistence layer hashes this material; this method returns no hash.