Skip to content

Commit

Permalink
Merge pull request #11 from TomMonks/dev
Browse files Browse the repository at this point in the history
v0.1.3: guassian -> gaussian in toy_models
  • Loading branch information
TomMonks authored Jul 5, 2021
2 parents d5b7390 + 8bef4ca commit 075897a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sim_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '0.1.2'
__version__ = '0.1.3'
__author__ = 'Thomas Monks'
31 changes: 25 additions & 6 deletions sim_tools/ovs/toy_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,33 @@ def _update_moments(self, design_index, observation):



def guassian_sequence_model(start, end, step=1):
def gaussian_sequence_model(start, end, step=1):
'''
Sequence of GaussianBandit Arms. Assumes unit variance.
e.g. start = 1, end = 10 return 10 bandits arms with means 1 through 10.
Parameters:
-------
start: int,
start of sequence of means (inclusive)
end: int,
end of sequence of means (inclusive)
step: int, optional (default = 1)
step size for sequence
Returns:
-------
list of GaussianBandit objects ordered by means
'''
bandits = [GaussianBandit(mean) for mean in range(start, end+1, step)]
return BanditCasino(bandits)


def guassian_bandit_sequence(start, end, step=1):
def gaussian_bandit_sequence(start, end, step=1):
'''
Sequence of GuassianBandit Arms. Assumes unit variance.
Sequence of GaussianBandit Arms. Assumes unit variance.
e.g. start = 1, end = 10 return 10 bandits arms with means 1 through 10.
Parameters:
Expand All @@ -140,7 +159,7 @@ def guassian_bandit_sequence(start, end, step=1):
return [GaussianBandit(mean) for mean in range(start, end, step)]


def random_guassian_model(mean_low, mean_high, var_low, var_high, n_designs):
def random_gaussian_model(mean_low, mean_high, var_low, var_high, n_designs):
'''
Create a model with n system designs where the mean and variance of the normal
distributions are sampled to between the specified tolerances
Expand All @@ -164,11 +183,11 @@ def random_guassian_model(mean_low, mean_high, var_low, var_high, n_designs):
'''
means = np.random.uniform(low=mean_low, high=mean_high, size=n_designs)
sigmas = np.random.uniform(low=var_low, high=var_high, size=n_designs)
return custom_guassian_model(means, sigmas)
return custom_gaussian_model(means, sigmas)



def custom_guassian_model(mus, sigmas):
def custom_gaussian_model(mus, sigmas):
'''
Creates a simulation model where each
output distribution is distributed N ~(mu, sigma)
Expand Down

0 comments on commit 075897a

Please sign in to comment.