Priors for the linear model mixing hyperparameter estimation
This class contains the priors developed for the hyperparameters of the mixing function for the first method, linear model mixing. This class can be expanded by the user to employ any other desired priors.
Priors
Source code in samba/priors.py
6 7 8 9 10 11 12 13 14 15 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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
__init__()
Prior class for the three mixing functions currently in the package -> logistic, cdf, and cosine. These are found in the LMM() class. In future, users can input these functions themselves for their choice of mixing function and data set.
Example
Priors()
Returns:
Type | Description |
---|---|
None. |
Source code in samba/priors.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
lpdf(params)
Log pdf of the priors for the parameters. Must be truncated for the sampler to walk in valid regions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
ndarray
|
The hyperparameters of the mixing function that are being estimated. |
required |
Returns:
Type | Description |
---|---|
The value of the total log pdf of the priors on the hyperparameters. |
Source code in samba/priors.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
luniform(theta, a, b)
General uniform prior to be used to truncate the normal distributions used in the parameter priors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
theta |
float
|
The parameter in question. |
required |
a |
float
|
The lower cutoff of the uniform prior. |
required |
b |
float
|
The upper cutoff of the uniform prior. |
required |
Returns:
Type | Description |
---|---|
The value of the log uniform prior given the value of the hyperparameter theta. |
Source code in samba/priors.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|