Deterministic
DeterministicPMF
Bases: RandomVariable
A deterministic (degenerate) random variable that represents a PMF.
Default constructor
Automatically checks that the elements in value can be indeed
considered to be a PMF by calling
pyrenew.distutil.validate_discrete_dist_vector on each one of its
entries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
A name to assign to the variable. |
required |
value
|
ArrayLike
|
An ArrayLike object. |
required |
tol
|
float
|
Passed to pyrenew.distutil.validate_discrete_dist_vector. Defaults to 1e-5. |
1e-05
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in pyrenew/deterministic/deterministicpmf.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
sample
Retrieves the deterministic PMF
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
object
|
Additional keyword arguments passed through to internal |
{}
|
Returns:
| Type | Description |
|---|---|
ArrayLike
|
|
Source code in pyrenew/deterministic/deterministicpmf.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
size
size() -> int
Returns the size of the PMF
Returns:
| Type | Description |
|---|---|
int
|
The size of the PMF |
Source code in pyrenew/deterministic/deterministicpmf.py
77 78 79 80 81 82 83 84 85 86 87 | |
DeterministicVariable
Bases: RandomVariable
A deterministic (degenerate) random variable. Useful to pass fixed quantities.
Default constructor
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
A name to assign to the variable. |
required |
value
|
ArrayLike
|
An ArrayLike object. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in pyrenew/deterministic/deterministic.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
sample
Retrieve the value of the deterministic Rv
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
bool
|
Whether to record the value of the deterministic RandomVariable. Defaults to False. |
False
|
**kwargs
|
object
|
Additional keyword arguments passed through to internal sample calls, should there be any. |
{}
|
Returns:
| Type | Description |
|---|---|
ArrayLike
|
|
Source code in pyrenew/deterministic/deterministic.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
NullObservation
NullObservation()
Bases: NullVariable
A null observation random variable. Sampling returns None.
Default constructor.
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in pyrenew/deterministic/nullrv.py
47 48 49 50 51 52 53 54 55 56 | |
sample
Retrieve the value of the Null (None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
ArrayLike
|
Unused parameter, represents mean of non-null distributions |
required |
obs
|
ArrayLike | None
|
Observed data. Defaults to None. |
None
|
**kwargs
|
object
|
Additional keyword arguments passed through to internal sample calls, should there be any. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in pyrenew/deterministic/nullrv.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
NullVariable
NullVariable()
Bases: DeterministicVariable
A null (degenerate) random variable. Sampling returns None.
Default constructor.
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in pyrenew/deterministic/nullrv.py
14 15 16 17 18 19 20 21 22 23 | |
sample
sample(**kwargs: object) -> None
Retrieve the value of the Null (None)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
object
|
Ignored. |
{}
|
Returns:
| Type | Description |
|---|---|
None
|
|
Source code in pyrenew/deterministic/nullrv.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |