

def brute_force_marginal_likelihood(self, X, n_samples=10000, gen_seed=0):
    '\n        Calculates the log marginal likelihood via brute force method in which\n        parameters (mu and kappa) are repeatedly drawn from the prior, the\n        likelihood is calculated for each set of parameters, then the average is\n        taken.\n        Inputs:\n            X: A column of data (numpy)\n            n_samples: the number of draws\n            gen_Seed: seed for the rng\n        '
    check_data_type_column_data(X)
    if (type(n_samples) is not int):
        raise TypeError('n_samples should be an int')
    if (n_samples <= 0):
        raise ValueError('n_samples should be greater than 0')
    if (type(gen_seed) is not int):
        raise TypeError('gen_seed should be an int')
    N = float(len(X))
    rng = random.Random(gen_seed)
    log_likelihoods = ([0] * gen_seed)
    for i in range(n_samples):
        params = self.sample_parameters_given_hyper(gen_seed=next_seed(rng))
        log_likelihoods[i] = self.log_likelihood(X, params)
    log_marginal_likelihood = logmeanexp(log_likelihoods)
    return log_marginal_likelihood

dataset/ETHPy150Open probcomp/crosscat/src/tests/component_model_extensions/CyclicComponentModel.py p_CyclicComponentModel.brute_force_marginal_likelihood/VarMisuse@109/315 `n_samples`->`gen_seed`