File: info.py

package info (click to toggle)
python-scipy 0.7.2%2Bdfsg1-1%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 28,572 kB
  • ctags: 36,183
  • sloc: cpp: 216,880; fortran: 76,016; python: 71,833; ansic: 62,118; makefile: 243; sh: 17
file content (31 lines) | stat: -rw-r--r-- 1,160 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
Routines for fitting maximum entropy models
===========================================

Contains two classes for fitting maximum entropy models subject to linear
constraints on the expectations of arbitrary feature statistics.  One
class, "model", is for small discrete sample spaces, using explicit
summation. The other, "bigmodel", is for sample spaces that are either
continuous (and perhaps high-dimensional) or discrete but too large to
sum over, and uses importance sampling.  conditional Monte Carlo methods.

The maximum entropy model has exponential form

    p(x) = exp(theta^T . f_vec(x)) / Z(theta).

with a real parameter vector theta of the same length as the feature
statistic f_vec.  For more background, see, for example, Cover and
Thomas (1991), Elements of Information Theory.

See the file bergerexample.py for a walk-through of how to use these
routines when the sample space is small enough to be enumerated.

See bergerexamplesimulated.py for a a similar walk-through using
simulation.

Copyright: Ed Schofield, 2003-2006
License: BSD-style (see LICENSE.txt in main source directory)
"""

postpone_import = 1
depends = ['optimize']