Identifiability API¶
The identifiability methods, the report they return, and its parts. Guide: Identifiability.
IdentifiabilityMethod ¶
Bases: InferenceMethod[ResultT], Generic[ResultT]
The configuration of an identifiability method, whose result is
ResultT.
Calibrator.identifiability(method) runs it, and returns its result
type. The methods of commol return an IdentifiabilityReport.
Source code in commol/context/inference/method.py
StructuralRank ¶
Bases: IdentifiabilityMethod[IdentifiabilityReport], RangeChecked
Structural identifiability, local and numerical: the rank of the scaled sensitivities at random points inside the bounds.
The sensitivities come from finite differences, with a step and an error
set by the accuracy of the engine; a singular value counts when it is
above the norm of that error. The engine must be deterministic. The
points come from the seed of the calibrator, Calibrator.seed.
Attributes:
| Name | Type | Description |
|---|---|---|
points |
int
|
How many rows of a Latin hypercube over the bounds, at least 1. |
design |
str
|
|
Source code in commol/context/inference/identifiability.py
Collinearity ¶
Bases: IdentifiabilityMethod[IdentifiabilityReport], RangeChecked
Collinearity analysis after Brun et al. (2001): the sensitivity measure of each parameter and the collinearity index of each subset.
The index of a subset is 1 when its sensitivities are orthogonal and grows without bound as they approach linear dependence. The literature puts the threshold between 5 and 20. The engine must be deterministic.
Attributes:
| Name | Type | Description |
|---|---|---|
at |
CalibrationResult | ParameterSample
|
Where to evaluate: the best point of a fit, or each draw of a sample, summarized by the weighted median. |
max_subset_size |
int
|
The largest subset, at least 2 and at most the number of parameters. Every subset up to 6 parameters is evaluated; a greedy search adds parameters above. |
threshold |
float
|
The index below which a subset can be fitted together. No default: it is a modelling judgment. |
Source code in commol/context/inference/identifiability.py
SampleIdentifiability ¶
Bases: IdentifiabilityMethod[IdentifiabilityReport], RangeChecked
Practical identifiability from any parameter sample: how much it contracts each parameter, which parameters move together, and which marginals have several modes.
Attributes:
| Name | Type | Description |
|---|---|---|
sample |
ParameterSample
|
The sample, such as the draws of an uncertainty method. |
reference |
{bounds, prior}
|
The distribution the contraction compares with: |
correlation_threshold |
float
|
The absolute correlation above which a pair is listed and its parameters are poorly determined, strictly between 0 and 1. No default: it is a modelling judgment. |
priors |
Priors | dict[str, Distribution] | None
|
The prior of each parameter, with |
Source code in commol/context/inference/identifiability.py
Methods:¶
read_priors
classmethod
¶
Read a mapping of parameter to distribution as Priors.
Source code in commol/context/inference/identifiability.py
check_priors ¶
The priors go with reference="prior", and only with it.
Source code in commol/context/inference/identifiability.py
StartsIdentifiability ¶
Bases: IdentifiabilityMethod[IdentifiabilityReport], RangeChecked
Practical identifiability from the starts of a calibration
(Calibrator.run(starts=n)): converged starts of equal loss that end
apart flag the parameters that differ.
Attributes:
| Name | Type | Description |
|---|---|---|
result |
CalibrationResult
|
The result, with at least two converged starts. |
parameter_tolerance |
float
|
The share of its bound width above which a parameter differs. |
loss_tolerance |
float
|
The share of the best loss within which two losses are equal. |
Source code in commol/context/inference/identifiability.py
IdentifiabilityReport ¶
Bases: _FrozenResult
Which parameters the model and the data determine: one structural and one practical verdict per parameter, and the evidence of each method.
The structural verdict comes from StructuralRank on the design of the
observations, and from a flat profile; a dense design answers what
denser data would determine, so its verdicts stay in its section. The
practical verdict comes from Collinearity, SampleIdentifiability,
StartsIdentifiability and the other profiles.
Attributes:
| Name | Type | Description |
|---|---|---|
parameters |
list[str]
|
The parameters, in problem order. |
verdicts |
dict[str, ParameterVerdicts]
|
The verdicts of each parameter. |
structural, collinearity, sample, starts, profile |
list
|
The sections of the methods that ran, one per run. |
Source code in commol/context/inference/identifiability.py
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | |
Methods:¶
check_parameters ¶
Check that the verdicts hold the parameters, in order.
Source code in commol/context/inference/identifiability.py
report ¶
Report the identifiability of each parameter as plain data.
Returns:
| Type | Description |
|---|---|
IdentifiabilityReportData
|
|
Source code in commol/context/inference/identifiability.py
merge ¶
merge(*others: IdentifiabilityReport) -> IdentifiabilityReport
Join this report with others of the same parameters.
The sections are kept side by side. A verdict that the reports agree
on stays, with the reasons of each; one they disagree on is
conflicting, with every reason.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*others
|
IdentifiabilityReport
|
The reports to join. |
()
|
Returns:
| Type | Description |
|---|---|
IdentifiabilityReport
|
The joined report. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a report has other parameters. |
Source code in commol/context/inference/identifiability.py
ParameterVerdicts ¶
Bases: _FrozenResult
The two verdicts of one parameter; None when no evidence gives one.
Attributes:
| Name | Type | Description |
|---|---|---|
structural |
StructuralVerdict | None
|
From the structural rank on the design of the observations. |
practical |
PracticalVerdict | None
|
From collinearity, a sample or the starts. |
Source code in commol/context/inference/identifiability.py
StructuralVerdict ¶
Bases: _FrozenResult
The structural verdict of one parameter.
Attributes:
| Name | Type | Description |
|---|---|---|
verdict |
StructuralVerdictName
|
|
reasons |
list[str]
|
Why, one per piece of evidence. |
combinations |
list[str]
|
The algebraic combinations that hold the parameter, such as
|
Source code in commol/context/inference/identifiability.py
PracticalVerdict ¶
Bases: _FrozenResult
The practical verdict of one parameter.
Attributes:
| Name | Type | Description |
|---|---|---|
verdict |
PracticalVerdictName
|
|
reasons |
list[str]
|
Why, one per piece of evidence. |
Source code in commol/context/inference/identifiability.py
StructuralSection ¶
Bases: _FrozenResult
The evidence of StructuralRank.
Attributes:
| Name | Type | Description |
|---|---|---|
design |
str
|
The design the sensitivities were evaluated on: |
points |
list[PointRank]
|
Each feasible point. |
skipped |
list[str]
|
Why each infeasible point was skipped. |
generic_rank |
int
|
The rank at most points. |
projections |
dict[str, float]
|
The norm of the projection of each parameter on the null space, averaged over the points of generic rank. |
verdicts |
dict[str, StructuralVerdictName]
|
The verdict of each parameter on this design. |
combinations |
list[Combination]
|
The identifiable combinations. |
Source code in commol/context/inference/identifiability.py
PointRank ¶
Bases: _FrozenResult
The rank of the scaled sensitivities at one point.
Attributes:
| Name | Type | Description |
|---|---|---|
values |
dict[str, float]
|
The point. |
singular_values |
list[float]
|
The singular values, largest first. |
threshold |
float
|
The norm of the estimated errors of the sensitivities, which a singular value must pass to count. |
rank |
int
|
How many pass it. |
Source code in commol/context/inference/identifiability.py
Combination ¶
Bases: _FrozenResult
A combination of parameters the data determine: the product of each parameter raised to its exponent.
Attributes:
| Name | Type | Description |
|---|---|---|
exponents |
dict[str, float]
|
The exponent of each parameter, in problem order. |
text |
str
|
The product, such as |
Source code in commol/context/inference/identifiability.py
CollinearitySection ¶
Bases: _FrozenResult
The evidence of Collinearity.
Attributes:
| Name | Type | Description |
|---|---|---|
threshold |
float
|
The index below which a subset can be fitted together. |
points |
int
|
How many points were used: one for a fit, one per feasible draw of a sample. |
skipped |
list[str]
|
Why each infeasible point was skipped. |
sensitivity |
dict[str, float]
|
The weighted median of Brun's sensitivity measure of each parameter. |
pair_gamma |
dict[str, dict[str, float]]
|
The weighted median of the index of each pair. |
best_by_size |
list[SubsetIndex]
|
The subset of lowest index of each size. |
admissible |
list[SubsetIndex]
|
The largest subsets whose index is below the threshold. |
Source code in commol/context/inference/identifiability.py
SubsetIndex ¶
Bases: _FrozenResult
A subset of parameters and its collinearity index.
Attributes:
| Name | Type | Description |
|---|---|---|
parameters |
list[str]
|
The parameters, in problem order. |
gamma |
float
|
The weighted median of the index over the points. |
share_below |
float
|
The share of the weight of the points where the index is below the threshold. |
Source code in commol/context/inference/identifiability.py
SampleSection ¶
Bases: _FrozenResult
The evidence of SampleIdentifiability.
Attributes:
| Name | Type | Description |
|---|---|---|
reference |
{bounds, prior}
|
The distribution the contraction compares with: |
correlation_threshold |
float
|
The absolute correlation above which a pair is listed. |
contraction |
dict[str, float]
|
|
correlation |
dict[str, dict[str, float]]
|
The weighted correlation matrix. |
correlated_pairs |
list[CorrelatedPair]
|
The pairs above the threshold. |
modes |
dict[str, list[float]]
|
The modes of the marginal of each parameter. |
Source code in commol/context/inference/identifiability.py
CorrelatedPair ¶
Bases: _FrozenResult
Two parameters whose absolute correlation is above the threshold.
Attributes:
| Name | Type | Description |
|---|---|---|
first, second |
str
|
The parameters, in problem order. |
correlation |
float
|
Their weighted correlation. |
Source code in commol/context/inference/identifiability.py
StartsSection ¶
Bases: _FrozenResult
The evidence of StartsIdentifiability.
Attributes:
| Name | Type | Description |
|---|---|---|
parameter_tolerance |
float
|
The share of its bound width above which a parameter differs. |
loss_tolerance |
float
|
The share of the best loss within which two losses are equal. |
near_best |
list[int]
|
The converged starts within the loss tolerance of the best. |
spread |
dict[str, float]
|
The largest difference of each parameter between them, as a share of its bound width. |
flagged |
list[str]
|
The parameters whose spread is above the tolerance. |
Source code in commol/context/inference/identifiability.py
ProfileSection ¶
Bases: _FrozenResult
The evidence of a ProfileLikelihood.
Attributes:
| Name | Type | Description |
|---|---|---|
threshold |
{chi_square, beale, bootstrap_calibrated}
|
The rule of the threshold. |
confidence_level |
float
|
The level of each pointwise interval. |
tolerance |
float
|
The numerical tolerance of the statistic. |
verdicts |
dict[str, ProfileVerdictName | None]
|
The verdict of each profiled parameter; None when its threshold is below the tolerance. |
intervals |
dict[str, tuple[float | None, float | None]]
|
The interval of each profiled parameter; None on a side that does not cross the threshold. |