maximum entropy calculation engine

The 1984 Skilling and Bryan paper is available online [1] through the SAO/NASA ADS Astronomy Abstract Service:

[1]http://adsabs.harvard.edu/abs/1984MNRAS.211..111S

sbmaxent

Entropy maximization routine as described in the article J Skilling and RK Bryan; MNRAS 211 (1984) 111 - 124. (“MNRAS”: “Monthly Notices of the Royal Astronomical Society”)

license:Copyright (c) 2013, UChicago Argonne, LLC
license:This file is distributed subject to a Software License Agreement found in the file LICENSE that is included with this distribution.

References:

  1. J Skilling and RK Bryan; MON NOT R ASTR SOC 211 (1984) 111 - 124.
  2. JA Potton, GJ Daniell, and BD Rainford; Proc. Workshop Neutron Scattering Data Analysis, Rutherford Appleton Laboratory, UK, 1986; ed. MW Johnson, IOP Conference Series 81 (1986) 81 - 86, Institute of Physics, Bristol, UK.
  3. ID Culverwell and GP Clarke; Ibid. 87 - 96.
  4. JA Potton, GK Daniell, & BD Rainford, J APPL CRYST 21 (1988) 663 - 668.
  5. JA Potton, GJ Daniell, & BD Rainford, J APPL CRYST 21 (1988) 891 - 897.
SB_MaxEnt.sbmaxent.ChiNow(ax, c1, c2, s1, s2)[source]
Returns tuple:(ChiNow computation of w, beta)
SB_MaxEnt.sbmaxent.ChoSol(a, b)[source]

ChoSol: ? chop the solution vectors ?

Returns:new vector beta
SB_MaxEnt.sbmaxent.Dist(s2, beta)[source]

measure the distance of this possible solution

SB_MaxEnt.sbmaxent.EllipsoidVolume(r, aspect=1.0)[source]

Volume of an ellipsoid with diameters: \(2r\times2r\times2r\beta\)

  • \(\beta\): aspect ratio
SB_MaxEnt.sbmaxent.G_term(q, r, V, rhosq)[source]

Calculates the response matrix \(G(Q,r)\)

Parameters:
  • q (double) – \(Q\)
  • r (double) – \(r\)
  • rhosq (double) – \(|\Delta\rho|^2\), the scattering contrast
Returns double:

G(Q,r)

class SB_MaxEnt.sbmaxent.MaxEnt(data, sigma, base, IterMax, image_to_data, data_to_image, G)[source]

manage the iterative method described by Skilling and Bryan

MaxEnt_iteration()[source]

one iteration of the MaxEnt algorithm

chi_squared()[source]

returns \(\sum{z^2}\)

compute_beta()[source]

beta vector: ... meaning ...

standardized_residuals()[source]

returns vector \(\vec{z}\) of standardized_residuals

where:

  • \(\vec{z} = (\vec{y} - \hat{\vec{y}}) / \vec{\sigma}\)
  • \(\vec{y}\): measured data
  • \(\hat{\vec{y}} = opus(\vec{f}, G)\)
  • \(\vec{\sigma}\): estimated uncertainties of \(\vec{y}\)
sum_f()[source]

returns \(\sum_i{f_i}\)

exception SB_MaxEnt.sbmaxent.MaxEntException[source]

Any exception from this module

SB_MaxEnt.sbmaxent.MaxEntMove(fSum, blank, chisq, chizer, c1, c2, s1, s2)[source]

move beta one step closer towards the solution

SB_MaxEnt.sbmaxent.MaxEnt_SB(datum, sigma, base, IterMax, image_to_data, data_to_image, G, report=True)[source]

do the complete Maximum Entropy algorithm of Skilling and Bryan

Parameters:
  • datum[] (float) –
  • sigma[] (float) –
  • base[] (float) –
  • IterMax (int) –
  • image_to_data (obj) – opus function
  • data_to_image (obj) – tropus function
  • G (float[][]) – transformation matrix
Returns float[]:
 

\(f(r) dr\)

SB_MaxEnt.sbmaxent.opus(image, G)[source]

opus: transform solution-space -> data-space: [G]^tr * image

default definition, caller can use this definition or provide an alternative

Parameters:
  • image (float[N]) – solution, ndarray of shape (N)
  • G (float[M][N]) – transformation matrix, ndarray of shape (M,N)
Returns float[M]:
 

calculated data, ndarray of shape (M)

SB_MaxEnt.sbmaxent.print_arr(text, a)[source]

print the contents of an array to the console

SB_MaxEnt.sbmaxent.print_vec(text, a)[source]

print the contents of a vector to the console

SB_MaxEnt.sbmaxent.readTextData(filename)[source]

return q, I, dI from a 3-column text file

SB_MaxEnt.sbmaxent.test_ChiNow()[source]

test routine for ChiNow()

test values obtained from C version of sizes program

SB_MaxEnt.sbmaxent.test_ChoSol()[source]

test routine for ChoSol()

test values obtained from C version of sizes program

SB_MaxEnt.sbmaxent.test_Dist()[source]

test routine for Dist()

test values obtained from C version of sizes program

SB_MaxEnt.sbmaxent.test_EllipsoidVolume()[source]

test routine for EllipsoidVolume()

SB_MaxEnt.sbmaxent.test_G_term()[source]

test routine for G_term()

test values are trivial checks comparison values computed from C code

SB_MaxEnt.sbmaxent.test_MaxEntMove()[source]

test routine for MaxEntMove()

test values obtained from C version of sizes program

SB_MaxEnt.sbmaxent.test_opus_tropus()[source]

test routine for Dist()

test values are trivial checks

SB_MaxEnt.sbmaxent.tropus(data, G)[source]

tropus: transform data-space -> solution-space: [G] * data

default definition, caller can use this definition or provide an alternative

Parameters:
  • data (float[M]) – observations, ndarray of shape (M)
  • G (float[M][N]) – transformation matrix, ndarray of shape (M,N)
Returns float[N]:
 

calculated image, ndarray of shape (N)

Previous topic

About sizes

Next topic

main source code module: sizes

This Page