@@ -9,7 +9,9 @@ def simulator():
9
9
return dict (parameters = prior_draws , observables = observables )
10
10
11
11
12
- def get_random_student_t (dim : int = 2 , mu_scale : float = 15. , shape_scale : float = 0.01 , rng : np .random .Generator = None ):
12
+ def get_random_student_t (
13
+ dim : int = 2 , mu_scale : float = 15.0 , shape_scale : float = 0.01 , rng : np .random .Generator = None
14
+ ):
13
15
"""A helper function to create a "frozen" multivariate student-t distribution of dimensions `dim`.
14
16
15
17
Parameters
@@ -42,7 +44,9 @@ def get_random_student_t(dim: int = 2, mu_scale: float = 15., shape_scale: float
42
44
return multivariate_t (loc = mu , shape = shape_scale , df = 2 , allow_singular = True , seed = rng )
43
45
44
46
45
- def draw_mixture_student_t (num_students : int , n_draws : int = 46 , dim : int = 2 , mu_scale : float = 15.0 , rng : np .random .Generator = None ):
47
+ def draw_mixture_student_t (
48
+ num_students : int , n_draws : int = 46 , dim : int = 2 , mu_scale : float = 15.0 , rng : np .random .Generator = None
49
+ ):
46
50
"""Helper function to generate `n_draws` random draws from a mixture of `num_students`
47
51
multivariate Student-t distributions.
48
52
@@ -105,7 +109,15 @@ def prior(lower_bound: float = -3.0, upper_bound: float = 3.0, rng: np.random.Ge
105
109
return rng .uniform (low = lower_bound , high = upper_bound , size = 5 )
106
110
107
111
108
- def observation_model (params : np .ndarray , n_obs : int = 4 , n_dist : int = 46 , dim : int = 2 , mu_scale : float = 15.0 , flatten : bool = True , rng : np .random .Generator = None ):
112
+ def observation_model (
113
+ params : np .ndarray ,
114
+ n_obs : int = 4 ,
115
+ n_dist : int = 46 ,
116
+ dim : int = 2 ,
117
+ mu_scale : float = 15.0 ,
118
+ flatten : bool = True ,
119
+ rng : np .random .Generator = None ,
120
+ ):
109
121
"""Generates data from the SLCP model designed as a benchmark for a simple likelihood
110
122
and a complex posterior due to a non-linear pushforward params -> x. In addition, it
111
123
outputs uninformative distractor data.
0 commit comments