Package gmisclib :: Module mcmc_indexclass :: Class guess
[frames] | no frames]

Class guess

source code


Instance Methods
 
__init__(self, guesses, fp=None, name='')
Create an object that produces the initial guesses at parameter values.
source code
 
comment(self, c) source code
 
clear(self) source code
numpy.ndarray
get_prms(self)
This freezes your set of parameters so no more will be added, and then returns the current guess for all the adjustable parameters.
source code
 
__repr__(self)
repr(x)
source code
 
set_user(self, user) source code
dict(tuple: set(str))
usage(self)
Tells you which users access each key.
source code
 
p(self, *key) source code
 
pc(self, *key) source code
 
p_lower(self, ll, *key)
A range, with a lower limit.
source code
 
pc_lower(self, ll, *key)
A range, with a lower limit.
source code
 
p_range(self, lb, ub, *key) source code
 
p_periodic(self, ub, *key)
A range with periodic boundary conditions 0 to ub.
source code
 
freeze(self)
This call means that all parameter names have been seen.
source code
 
set_prm(self, v, *key)
This function is used to adjust parameters in non-trivial ways.
source code
 
__call__(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
columns(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
get_all(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
a dictionary from parameter name to value.
get_fixed(self)
Get only the fixed parameters. (Inherited from gmisclib.mcmc_indexclass.index_base)
source code
 
hash(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
i_k_val(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
logdens(self, x) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
int
n(self)
Returns: the number of adjustable parameters. (Inherited from gmisclib.mcmc_indexclass.index_base)
source code
 
pN(self, num, *key) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
pNl(self, num, low, high, *key) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
pNr(self, num, low, high, *key) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
set_all_fixed(self, kv)
This sets a whole dictionary's worth of fixed parameters. (Inherited from gmisclib.mcmc_indexclass.index_base)
source code
 
set_fixed(self, v, *k)
You can have "fixed" parameters that are not updated by the MCMC optimizer. (Inherited from gmisclib.mcmc_indexclass.index_base)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, guesses, fp=None, name='')
(Constructor)

source code 

Create an object that produces the initial guesses at parameter values. Feed it a list of patterns that match parameter names, each with a function to produce a random guess for that parameter. When you request the value of a parameter via self.p or similar, it will look up the parameter name, find the first regular expression that matches it, and call the associated function to generate a random value for that parameter.

Parameters:
  • guesses (list(tuple(str, sampler))) - a list of (pattern, sampler) tuples, where pattern is an (uncompiled) regular expression, The pattern selects for which parameters sampler will be used. It must match the entire parameter name; it will be surrounded by "^$" before use. sampler is a function (or class) that produces samples from some probability distribution. Sampler is called without arguments, once for each parameter, for each guess that is needed.
  • fp (a writeable file object.) - an open file which can be used as a log, or None.
  • name (anything.) - a named for the indexer. It is just stored away, and may be accessed as the "name" attribute.
Overrides: object.__init__

comment(self, c)

source code 
Overrides: index_base.comment

clear(self)

source code 
Overrides: index_base.clear

get_prms(self)

source code 

This freezes your set of parameters so no more will be added, and then returns the current guess for all the adjustable parameters.

Returns: numpy.ndarray
a vector of the adjustable parameters
Overrides: index_base.get_prms

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

usage(self)

source code 

Tells you which users access each key.

Returns: dict(tuple: set(str))
dictops.dict_of_sets (approximately a dict) indexed by integer indices and mapping to a set of users. e.g. {('some', 'key'): set(['user1', 'user2']), ...}.

p(self, *key)

source code 
Overrides: index_base.p

p_lower(self, ll, *key)

source code 

A range, with a lower limit.

Overrides: index_base.p_lower

p_range(self, lb, ub, *key)

source code 
Overrides: index_base.p_range

freeze(self)

source code 

This call means that all parameter names have been seen. Any novel names in calls to self.p() will then raise an error.