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

Class index

source code


Instance Methods
 
__init__(self, keymap, p=None, name='', fixed=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
hash(self) source code
 
clear(self) source code
 
set_prms(self, prm)
This sets the vector of parameters to be used and modified.
source code
 
set_prm(self, v, *key)
This sets one element of the parameters vector.
source code
float
p(self, *key)
Returns: the parameter indexed by *key.
source code
 
p_lower(self, ll, *key) 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
float
pc(self, *key)
Returns: the parameter indexed by *key.
source code
 
pc_lower(self, ll, *key) source code
numpy.ndarray
get_prms(self)
Returns: a vector of the adjustable parameters
source code
 
toDisplay(self, reprkeys=None) source code
 
__repr__(self)
repr(x)
source code
sequence( (key, value) ) where key could be anything hashable, but is usually a tuple of strings, and value is a float.
items(self)
Returns: a sequence of all the parameter, fixed or adjustable.
source code
 
keys(self) source code
 
__call__(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
columns(self) (Inherited from gmisclib.mcmc_indexclass.index_base) source code
 
comment(self, c) (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
 
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__

Class Variables
  reprkeys = re.compile(r'.')
Properties

Inherited from object: __class__

Method Details

__init__(self, keymap, p=None, name='', fixed=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

hash(self)

source code 
Overrides: index_base.hash

clear(self)

source code 
Overrides: index_base.clear

set_prms(self, prm)

source code 

This sets the vector of parameters to be used and modified. Note that p_lower() can affect the prm argument! No copy is made and this side effect is needed for the problem_definition.fixer() function.

This function should only be called after the map is established.

set_prm(self, v, *key)

source code 

This sets one element of the parameters vector. This function should only be called after the map is established; it cannot be used to set fixed parameters.

p(self, *key)

source code 
Parameters:
  • key (tuple(str))
Returns: float
the parameter indexed by *key.
Overrides: index_base.p

p_lower(self, ll, *key)

source code 
Raises:
  • KeyError - when you apply it to a fixed parameter below the specified ll.
Overrides: index_base.p_lower

Note: this may have side effects on the array passed to prms().

p_range(self, lb, ub, *key)

source code 
Raises:
  • KeyError - when you apply it to a fixed parameter outside specified range (lb,ub).
Overrides: index_base.p_range

Note: this may have side effects on the array passed to prms().

p_periodic(self, ub, *key)

source code 

A range with periodic boundary conditions 0 to ub.

Raises:
  • KeyError - when you apply it to a fixed parameter outside specified range (lb,ub).

Note: this may have side effects on the array passed to prms().

pc(self, *key)

source code 
Parameters:
  • key (tuple(str))
Returns: float
the parameter indexed by *key.

pc_lower(self, ll, *key)

source code 
Raises:
  • KeyError - when you apply it to a fixed parameter below the specified ll.

Note: this may have side effects on the array passed to prms().

get_prms(self)

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

toDisplay(self, reprkeys=None)

source code 

Note: This prints the values without the folding or wrapping that is done by p_range, p_periodic, p_lower, or p_upper. So, you should not be surprised or disturbed if you see a value outside the expected range. If you extract the values normally, using the p_* accessor funcitons, all will be well.

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

items(self)

source code 
Returns: sequence( (key, value) ) where key could be anything hashable, but is usually a tuple of strings, and value is a float.
a sequence of all the parameter, fixed or adjustable.