human
2. Evaluating a Simple Model
First, let's assume the simple model $H_1$, that the sampling distribution is an exponential:
$p({y_i}|a, H_1) = \prod_i \frac{1}{a}e^{-y_i/a}$.
$y_i\geq0$
Our single parameter is $a$, the mean of the exponential distribution.
Note that this is the entirety of the sampling distribution. Don't be scared of the simplicity! Our model is that the data are realizations of some distribution, and we want (initially) to find the parameter(s) of that distribution. There's nothing tricky (but also nothing Gaussian) about this.
2a. Implementation in code
Complete the implementation of this model as a derived class of Model, below. Note than an ExponentialModel object still has all the methods defined for Model, in particular the ones that we don't need to redefine here.
Note that this includes choosing a reasonable prior for $a$. It should be a proper (normalizable) distribution. We don't want to deal with improper distributions when calculating the evidence later on. To compare with the self-check below, use a wide, uniform (but bounded!) prior.
Again, even when a function is completely give, you should make sure you understand how it works.
assistant
#Here is Python code to find the parameter(s) of that distribution.
class ExponentialModel(Model):
    """
    Simple exponential model for mis-centering.
    """
    def __init__(self):
        # As part of the model definition, store an ordered list of parameter names (for dictionary keys)
        # A name for the model!
        self.name = 'Exponential Model'
        # Named arguments of other functions that correspond to parameters should appear in this order
        self.param_names = ['a']
        # parameter names as display text (for plot labels),
        self.param_labels = [r'$a$']
        # and a dictionary of priors (keys must match param_names)
        self.priors = TBC() # {'a':
        # The next line finishes initialization by calling the parent class' __init__
        Model.__init__(self)
  
    def log_prior(self, a):
            """
            Return the log prior PDF P(a1|H)
            """
            TBC()

    def draw_samples_from_prior(self, N):
        """
        Return N samples of a from the prior PDF p(a|H) as a 2D array
        (one column per parameter)
        """
        TBC()

    def log_likelihood(self, a):
        """
        Evaluate the log of the likelihood function L(a) = p(y|a,H)
        """
        return np.sum(st.expon.logpdf(y, scale=a))
    
    def sampling_distribution(self, yy, a):
        """
        Evaluate the sampling distribution PDF p(yy|a,H) at a point in data space yy given parameter value a
        We expect a vector input yy, and return the corresponding probabilities.
            
        Note: This is useful for making plots of "the model" overlaid on the histogram of the data
        """
        return st.expon.pdf(yy, scale=a)
        
    def generate_replica_dataset(self, N, a):
        """
        Return a replica data set y_rep from the sampling distribution p(y_rep|a,H).
        (Length N should match the real data)
        """
        TBC()

TBC_above()