lib.parameter.Parameter¶
- class lib.parameter.Parameter(name, value=None, fixed=None, prior=None, ref=None, proposal=None, latex=None)¶
Bases:
lib.utils.BaseClassClass that represents a parameter.
- value¶
Default value for parameter.
- Type
float
- fixed¶
Whether parameter is fixed.
- Type
bool
- ref¶
Reference distribution. This is supposed to represent the expected posterior for this parameter.
- Type
- proposal¶
Proposal uncertainty.
- Type
float
- latex¶
Latex for parameter.
- Type
string, default=None
Initialize
Parameter.- Parameters
name (tuple, list, string, ParamName, Parameter) – If
Parameter, updateselfattributes. Else, arguments to initialize parameter name, seeParamName.value (float, default=False) – Default value for parameter.
fixed (bool, default=None) – Whether parameter is fixed. If
None, defaults toTrueifpriororrefis notNone, elseFalse.prior (Prior, dict, default=None) – Prior distribution for parameter, arguments for
Prior.ref (Prior, dict, default=None) – Reference distribution for parameter, arguments for
Prior. This is supposed to represent the expected posterior for this parameter. IfNone, defaults toprior.proposal (float, default=None) – Proposal uncertainty for parameter. If
None, defaults to scale (or half of limiting range) ofref.latex (string, default=None) – Latex for parameter.
Methods
Add suffix to parameter:
Return shallow copy of
self.deepcopyInstantiate and initalize class with state dictionary.
If
latexis specified (i.e.is_mpi_broadcastis_mpi_gatheredis_mpi_rootis_mpi_scatteredLoad class in numpy binary format from disk.
If different formats are possible, this method should between them based on file name extension.
log_criticallog_debuglog_errorlog_infolog_warningSave class to disk.
If different formats are possible, this method should between them based on file name extension.
Update parameter attributes with new arguments kwargs.
Attributes
Parameter limits.
loggerMPI attributes
mpicommmpirootmpistateWhether parameter is varied (i.e.
- copy()¶
Return shallow copy of
self.
- classmethod from_state(state, mpiroot=0, mpicomm=None)¶
Instantiate and initalize class with state dictionary.
- get_label()¶
If
latexis specified (i.e. notNone), returnlatexsurrounded by ‘$’ signs, elseNone.
- property limits¶
Parameter limits.
- classmethod load(filename, mpiroot=0, mpicomm=None)¶
Load class in numpy binary format from disk. If the loaded state contains
__class__and that exists incls._registry, return instance ofcls._registry[__class__](instead ofcls).
- load_auto(*args, **kwargs)¶
If different formats are possible, this method should between them based on file name extension.
- property mpiattrs¶
MPI attributes
- save(filename)¶
Save class to disk.
- save_auto(*args, **kwargs)¶
If different formats are possible, this method should between them based on file name extension.
- update(**kwargs)¶
Update parameter attributes with new arguments kwargs.
- property varied¶
Whether parameter is varied (i.e. not fixed).