# Path: reggie/utils/misc.py
# def rstate(rng=None):
#     """
#     Return a RandomState object. This is just a simple wrapper such that if rng
#     is already an instance of RandomState it will be passed through, otherwise
#     it will create a RandomState object using rng as its seed.
#     """
#     if not isinstance(rng, np.random.RandomState):
#         rng = np.random.RandomState(rng)
#     return rng
# 
# Path: reggie/models/_core.py
# class Model(object):
#     """
#     Interface for probabilistic models of latent functions. This interface
#     includes the ability to add input/output data, evaluate the log-likelihood
#     of this data, make predictions and sample in both the latent and
#     observed space, evaluate tail probabilities, expectations, and entropy.
#     """
#     def copy(self):
#         """
#         Copy the model; this is just a convenience wrapper around deepcopy.
#         """
#         return copy.deepcopy(self)
# 
#     def add_data(self, X, Y):
#         """
#         Add input/output data `X` and `Y` to the model.
#         """
#         raise NotImplementedError
# 
#     def get_loglike(self):
#         """
#         Return the log-likelihood of the observed data.
#         """
#         raise NotImplementedError
# 
#     def sample(self, X, size=None, latent=True, rng=None):
#         """
#         Return a sample of the model at input locations `X`.
# 
#         If `size` is not given this will return an n-vector where n is the
#         length of `X`; otherwise it will return an array of shape `(size, n)`.
#         If `latent` is true the samples will be in the latent space, otherwise
#         they will be sampled in the output space.
#         """
#         raise NotImplementedError
# 
#     def predict(self, X):
#         """
#         Return mean and variance predictions `(mu, s2)` at inputs `X`.
#         """
#         raise NotImplementedError
# 
#     def get_tail(self, f, X):
#         """
#         Compute the probability that the latent function at inputs `X` exceeds
#         the target value `f`.
#         """
#         raise NotImplementedError
# 
#     def get_improvement(self, f, X):
#         """
#         Compute the expected improvement in value at inputs `X` over the target
#         value `f`.
#         """
#         raise NotImplementedError
# 
#     def get_entropy(self, X):
#         """
#         Compute the predictive entropy evaluated at inputs `X`.
#         """
#         raise NotImplementedError


import numpy as np
import scipy.special as special
import scipy.stats as stats
from ..utils.misc import rstate
from ._core import Model
"""
Definition of simple, independent arm bandit models.
"""

from __future__ import division
from __future__ import absolute_import
from __future__ import print_function



__all__ = ['BetaBernoulli']



# Path: reggie/utils/misc.py
# def rstate(rng=None):
#     """
#     Return a RandomState object. This is just a simple wrapper such that if rng
#     is already an instance of RandomState it will be passed through, otherwise
#     it will create a RandomState object using rng as its seed.
#     """
#     if not isinstance(rng, np.random.RandomState):
#         rng = np.random.RandomState(rng)
#     return rng
# 
# Path: reggie/models/_core.py
# class Model(object):
#     """
#     Interface for probabilistic models of latent functions. This interface
#     includes the ability to add input/output data, evaluate the log-likelihood
#     of this data, make predictions and sample in both the latent and
#     observed space, evaluate tail probabilities, expectations, and entropy.
#     """
#     def copy(self):
#         """
#         Copy the model; this is just a convenience wrapper around deepcopy.
#         """
#         return copy.deepcopy(self)
# 
#     def add_data(self, X, Y):
#         """
#         Add input/output data `X` and `Y` to the model.
#         """
#         raise NotImplementedError
# 
#     def get_loglike(self):
#         """
#         Return the log-likelihood of the observed data.
#         """
#         raise NotImplementedError
# 
#     def sample(self, X, size=None, latent=True, rng=None):
#         """
#         Return a sample of the model at input locations `X`.
# 
#         If `size` is not given this will return an n-vector where n is the
#         length of `X`; otherwise it will return an array of shape `(size, n)`.
#         If `latent` is true the samples will be in the latent space, otherwise
#         they will be sampled in the output space.
#         """
#         raise NotImplementedError
# 
#     def predict(self, X):
#         """
#         Return mean and variance predictions `(mu, s2)` at inputs `X`.
#         """
#         raise NotImplementedError
# 
#     def get_tail(self, f, X):
#         """
#         Compute the probability that the latent function at inputs `X` exceeds
#         the target value `f`.
#         """
#         raise NotImplementedError
# 
#     def get_improvement(self, f, X):
#         """
#         Compute the expected improvement in value at inputs `X` over the target
#         value `f`.
#         """
#         raise NotImplementedError
# 
#     def get_entropy(self, X):
#         """
#         Compute the predictive entropy evaluated at inputs `X`.
#         """
#         raise NotImplementedError


# Path: reggie/models/bandit.py
import numpy as np
import scipy.special as special
import scipy.stats as stats
from ..utils.misc import rstate
from ._core import Model

"""
Definition of simple, independent arm bandit models.
"""

from __future__ import division
from __future__ import absolute_import
from __future__ import print_function



__all__ = ['BetaBernoulli']



class BetaBernoulli(Model):