Param generic
Generic parameter class.
GenericParam
Bases: ABC
Generic parameter storage. Must be overriden.
Attributes:
| Name | Type | Description |
|---|---|---|
measure |
Measure
|
Probability measure. |
__init__()
Initialize class.
__repr__()
Return string representation.
__str__()
Return string representation.
from_theta(*, theta)
abstractmethod
classmethod
Initialize parameters from parameter vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
theta
|
(nparams, ) array
|
Parameter vector |
required |
get_bounds(*, subset=Subset.all, measure=Measure.PQ)
staticmethod
Get parameter bounds.
Returns:
| Type | Description |
|---|---|
list of tuples
|
Parameter bounds |
get_constraints()
Get parameter constraints.
Returns:
| Type | Description |
|---|---|
dict or sequence of dict
|
Equality and inequality constraints. See scipy.optimize.minimize |
get_model_name()
abstractmethod
staticmethod
Return model name.
Returns:
| Type | Description |
|---|---|
str
|
Parameter vector |
get_names(*, subset=Subset.all, measure=Measure.PQ)
abstractmethod
staticmethod
Return parameter names.
Returns:
| Type | Description |
|---|---|
list of str
|
Parameter names |
get_theta(*, subset=Subset.all, measure=Measure.P)
abstractmethod
Return vector of parameters.
Returns:
| Type | Description |
|---|---|
array
|
Parameter vector |
is_valid()
Check whether parameters are valid.
Returns:
| Type | Description |
|---|---|
bool
|
True for valid parameters, False for invalid |
update(*, theta, subset=Subset.all, measure=Measure.P)
abstractmethod
Update attributes from parameter vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
theta
|
(nparams, ) array
|
Parameter vector |
required |
subset
|
Subset
|
Which parameters to update. Belongs to ['all', 'vol'] |
all
|
measure
|
Measure
|
Either physical measure (P), or risk-neutral (Q) |
P
|
update_ajd()
abstractmethod
Update AJD representation.