bayesflow.benchmarks.bernoulli_glm_raw module#
- bayesflow.benchmarks.bernoulli_glm_raw.prior(rng=None)[source]#
Generates a random draw from the custom prior over the 10 Bernoulli GLM parameters (1 intercept and 9 weights). Uses a global covariance matrix Cov for the multivariate Gaussian prior over the model weights, which is pre-computed for efficiency.
- Parameters:
- rngnp.random.Generator or None, default: None
An optional random number generator to use.
- Returns:
- thetanp.ndarray of shape (10,)
A single draw from the prior.
- bayesflow.benchmarks.bernoulli_glm_raw.simulator(theta, T=100, rng=None)[source]#
Simulates data from the custom Bernoulli GLM likelihood, see: https://arxiv.org/pdf/2101.04653.pdf, Task T.6
Returns the raw Bernoulli data.
- Parameters:
- thetanp.ndarray of shape (10,)
The vector of model parameters (theta[0] is intercept, theta[i], i > 0 are weights)
- Tint, optional, default: 100
The simulated duration of the task (eq. the number of Bernoulli draws).
- rngnp.random.Generator or None, default: None
An optional random number generator to use.
- Returns:
- xnp.ndarray of shape (T, 10)
The full simulated set of Bernoulli draws and design matrix. Should be configured with an additional trailing dimension if the data is (properly) to be treated as a set.