ParameterSubspace
Instances of ParameterSubspace
represent subspaces
of the global parameter space associated with a model.
- class xpsi.ParameterSubspace.ParameterSubspace(*args, **kwargs)[source]
Ordered parameter subspace.
- Parameters:
prefix (str) – In common modelling patterns there are multiple instances of a particular subspace, so provide a unique naming prefix. The prefix will be suffixed with a double-underscore. Note that this prefix will prepend prefixes for encapsulated parameters lower in the hierarchy which themselves have identification prefixes.
args – Instances of
Parameter
, or iterables over instances ofParameter
orParameterSubspace
. All parameters and subspaces will be merged into this new subspace.
- __call__(p=None)[source]
Useful callable way to update parameters with a simple vector.
The order must match the order in which parameters were merged into the subspace. Note that this method is often overwritten in subclasses, but this parent method can always be accessed if required.
- Parameters:
p (array-like) – New point to update to. If
None
, the current point is returned. The object must be ordered to match that of containerself
.- Returns:
Current point (if the call was not an update).
- Return type:
array-like
- property cached
Get the cached values of all free parameters in the subspace.
- clear_cache()[source]
Clear the cache for all free parameters in the subspace.
Note
That this also deletes the current parameter values, in addition to the cached previous values.
- property names
Get a list of parameter names.
- property needs_update
Do cached dependencies need to be updated?
- property params
Get the list of parameter objects.
- property prefix
Get the unique prefix for subspace identification.
- property vector
Get all variable values (free parameters and fixed/derived).