From scipy-svn at scipy.org Tue Jun 1 00:09:29 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Mon, 31 May 2010 23:09:29 -0500 (CDT)
Subject: [Scipy-svn] r6462 - trunk/doc/source/tutorial/stats
Message-ID: <20100601040929.1281D39CAEA@scipy.org>
Author: oliphant
Date: 2010-05-31 23:09:28 -0500 (Mon, 31 May 2010)
New Revision: 6462
Added:
trunk/doc/source/tutorial/stats/continuous.lyx
trunk/doc/source/tutorial/stats/discrete.lyx
Log:
Add back original LyX files
Added: trunk/doc/source/tutorial/stats/continuous.lyx
===================================================================
--- trunk/doc/source/tutorial/stats/continuous.lyx (rev 0)
+++ trunk/doc/source/tutorial/stats/continuous.lyx 2010-06-01 04:09:28 UTC (rev 6462)
@@ -0,0 +1,4972 @@
+#LyX 1.5.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 276
+\begin_document
+\begin_header
+\textclass article
+\language english
+\inputencoding auto
+\font_roman default
+\font_sans default
+\font_typewriter default
+\font_default_family default
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+\graphics default
+\paperfontsize default
+\spacing single
+\papersize default
+\use_geometry true
+\use_amsmath 2
+\use_esint 0
+\cite_engine basic
+\use_bibtopic false
+\paperorientation portrait
+\leftmargin 1in
+\topmargin 1in
+\rightmargin 1in
+\bottommargin 1in
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\defskip medskip
+\quotes_language english
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\author ""
+\end_header
+
+\begin_body
+
+\begin_layout Title
+Continuous Statistical Distributions
+\end_layout
+
+\begin_layout Section
+Overview
+\end_layout
+
+\begin_layout Standard
+All distributions will have location (L) and Scale (S) parameters along
+ with any shape parameters needed, the names for the shape parameters will
+ vary.
+ Standard form for the distributions will be given where
+\begin_inset Formula $L=0.0$
+\end_inset
+
+ and
+\begin_inset Formula $S=1.0.$
+\end_inset
+
+ The nonstandard forms can be obtained for the various functions using (note
+
+\begin_inset Formula $U$
+\end_inset
+
+ is a standard uniform random variate).
+
+\end_layout
+
+\begin_layout Standard
+\align center
+
+\size small
+\begin_inset Tabular
+
+
+
+
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Function Name
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+Standard Function
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+Transformation
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Cumulative Distribution Function (CDF)
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $F\left(x\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $F\left(x;L,S\right)=F\left(\frac{\left(x-L\right)}{S}\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Probability Density Function (PDF)
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $f\left(x\right)=F^{\prime}\left(x\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $f\left(x;L,S\right)=\frac{1}{S}f\left(\frac{\left(x-L\right)}{S}\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Percent Point Function (PPF)
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $G\left(q\right)=F^{-1}\left(q\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $G\left(q;L,S\right)=L+SG\left(q\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Probability Sparsity Function (PSF)
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $g\left(q\right)=G^{\prime}\left(q\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $g\left(q;L,S\right)=Sg\left(q\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Hazard Function (HF)
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $h_{a}\left(x\right)=\frac{f\left(x\right)}{1-F\left(x\right)}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $h_{a}\left(x;L,S\right)=\frac{1}{S}h_{a}\left(\frac{\left(x-L\right)}{S}\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Cumulative Hazard Functon (CHF)
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $H_{a}\left(x\right)=$
+\end_inset
+
+
+\begin_inset Formula $\log\frac{1}{1-F\left(x\right)}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $H_{a}\left(x;L,S\right)=H_{a}\left(\frac{\left(x-L\right)}{S}\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Survival Function (SF)
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $S\left(x\right)=1-F\left(x\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $S\left(x;L,S\right)=S\left(\frac{\left(x-L\right)}{S}\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Inverse Survival Function (ISF)
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $Z\left(\alpha\right)=S^{-1}\left(\alpha\right)=G\left(1-\alpha\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $Z\left(\alpha;L,S\right)=L+SZ\left(\alpha\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Moment Generating Function (MGF)
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $M_{Y}\left(t\right)=E\left[e^{Yt}\right]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $M_{X}\left(t\right)=e^{Lt}M_{Y}\left(St\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Random Variates
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $Y=G\left(U\right)$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $X=L+SY$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+(Differential) Entropy
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $h\left[Y\right]=-\int f\left(y\right)\log f\left(y\right)dy$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $h\left[X\right]=h\left[Y\right]+\log S$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+(Non-central) Moments
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $\mu_{n}^{\prime}=E\left[Y^{n}\right]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $E\left[X^{n}\right]=L^{n}\sum_{k=0}^{N}\left(\begin{array}{c}
+n\\
+k\end{array}\right)\left(\frac{S}{L}\right)^{k}\mu_{k}^{\prime}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+Central Moments
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $\mu_{n}=E\left[\left(Y-\mu\right)^{n}\right]$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $E\left[\left(X-\mu_{X}\right)^{n}\right]=S^{n}\mu_{n}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+mean (mode, median), var
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $\mu,\,\mu_{2}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $L+S\mu,\, S^{2}\mu_{2}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\begin_inset Text
+
+\begin_layout Standard
+skewness, kurtosis
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $\gamma_{1}=\frac{\mu_{3}}{\left(\mu_{2}\right)^{3/2}},\,$
+\end_inset
+
+
+\begin_inset Formula $\gamma_{2}=\frac{\mu_{4}}{\left(\mu_{2}\right)^{2}}-3$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset Formula $\gamma_{1},\,\gamma_{2}$
+\end_inset
+
+
+\end_layout
+
+\end_inset
+ |
+
+
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\InsetSpace ~
+
+\end_layout
+
+\begin_layout Subsection
+Moments
+\end_layout
+
+\begin_layout Standard
+Non-central moments are defined using the PDF
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\int_{-\infty}^{\infty}x^{n}f\left(x\right)dx.\]
+
+\end_inset
+
+ Note, that these can always be computed using the PPF.
+ Substitute
+\begin_inset Formula $x=G\left(q\right)$
+\end_inset
+
+ in the above equation and get
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\int_{0}^{1}G^{n}\left(q\right)dq\]
+
+\end_inset
+
+ which may be easier to compute numerically.
+ Note that
+\begin_inset Formula $q=F\left(x\right)$
+\end_inset
+
+ so that
+\begin_inset Formula $dq=f\left(x\right)dx.$
+\end_inset
+
+ Central moments are computed similarly
+\begin_inset Formula $\mu=\mu_{1}^{\prime}$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu_{n} & = & \int_{-\infty}^{\infty}\left(x-\mu\right)^{n}f\left(x\right)dx\\
+ & = & \int_{0}^{1}\left(G\left(q\right)-\mu\right)^{n}dq\\
+ & = & \sum_{k=0}^{n}\left(\begin{array}{c}
+n\\
+k\end{array}\right)\left(-\mu\right)^{k}\mu_{n-k}^{\prime}\end{eqnarray*}
+
+\end_inset
+
+ In particular
+\begin_inset Formula \begin{eqnarray*}
+\mu_{3} & = & \mu_{3}^{\prime}-3\mu\mu_{2}^{\prime}+2\mu^{3}\\
+ & = & \mu_{3}^{\prime}-3\mu\mu_{2}-\mu^{3}\\
+\mu_{4} & = & \mu_{4}^{\prime}-4\mu\mu_{3}^{\prime}+6\mu^{2}\mu_{2}^{\prime}-3\mu^{4}\\
+ & = & \mu_{4}^{\prime}-4\mu\mu_{3}-6\mu^{2}\mu_{2}-\mu^{4}\end{eqnarray*}
+
+\end_inset
+
+ Skewness is defined as
+\begin_inset Formula \[
+\gamma_{1}=\sqrt{\beta_{1}}=\frac{\mu_{3}}{\mu_{2}^{3/2}}\]
+
+\end_inset
+
+ while (Fisher) kurtosis is
+\begin_inset Formula \[
+\gamma_{2}=\frac{\mu_{4}}{\mu_{2}^{2}}-3,\]
+
+\end_inset
+
+ so that a normal distribution has a kurtosis of zero.
+
+\end_layout
+
+\begin_layout Subsection
+Median and mode
+\end_layout
+
+\begin_layout Standard
+The median,
+\begin_inset Formula $m_{n}$
+\end_inset
+
+ is defined as the point at which half of the density is on one side and
+ half on the other.
+ In other words,
+\begin_inset Formula $F\left(m_{n}\right)=\frac{1}{2}$
+\end_inset
+
+ so that
+\begin_inset Formula \[
+m_{n}=G\left(\frac{1}{2}\right).\]
+
+\end_inset
+
+ In addition, the mode,
+\begin_inset Formula $m_{d}$
+\end_inset
+
+, is defined as the value for which the probability density function reaches
+ it's peak
+\begin_inset Formula \[
+m_{d}=\arg\max_{x}f\left(x\right).\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Fitting data
+\end_layout
+
+\begin_layout Standard
+To fit data to a distribution, maximizing the likelihood function is common.
+ Alternatively, some distributions have well-known minimum variance unbiased
+ estimators.
+ These will be chosen by default, but the likelihood function will always
+ be available for minimizing.
+
+\end_layout
+
+\begin_layout Standard
+If
+\begin_inset Formula $f\left(x;\boldsymbol{\theta}\right)$
+\end_inset
+
+ is the PDF of a random-variable where
+\begin_inset Formula $\boldsymbol{\theta}$
+\end_inset
+
+ is a vector of parameters (
+\emph on
+e.g.
+
+\begin_inset Formula $L$
+\end_inset
+
+
+\emph default
+ and
+\begin_inset Formula $S$
+\end_inset
+
+), then for a collection of
+\begin_inset Formula $N$
+\end_inset
+
+ independent samples from this distribution, the joint distribution the
+ random vector
+\begin_inset Formula $\mathbf{x}$
+\end_inset
+
+ is
+\begin_inset Formula \[
+f\left(\mathbf{x};\boldsymbol{\theta}\right)=\prod_{i=1}^{N}f\left(x_{i};\boldsymbol{\theta}\right).\]
+
+\end_inset
+
+ The maximum likelihood estimate of the parameters
+\begin_inset Formula $\boldsymbol{\theta}$
+\end_inset
+
+ are the parameters which maximize this function with
+\begin_inset Formula $\mathbf{x}$
+\end_inset
+
+ fixed and given by the data:
+\begin_inset Formula \begin{eqnarray*}
+\boldsymbol{\theta}_{es} & = & \arg\max_{\boldsymbol{\theta}}f\left(\mathbf{x};\boldsymbol{\theta}\right)\\
+ & = & \arg\min_{\boldsymbol{\theta}}l_{\mathbf{x}}\left(\boldsymbol{\theta}\right).\end{eqnarray*}
+
+\end_inset
+
+ Where
+\begin_inset Formula \begin{eqnarray*}
+l_{\mathbf{x}}\left(\boldsymbol{\theta}\right) & = & -\sum_{i=1}^{N}\log f\left(x_{i};\boldsymbol{\theta}\right)\\
+ & = & -N\overline{\log f\left(x_{i};\boldsymbol{\theta}\right)}\end{eqnarray*}
+
+\end_inset
+
+ Note that if
+\begin_inset Formula $\boldsymbol{\theta}$
+\end_inset
+
+ includes only shape parameters, the location and scale-parameters can be
+ fit by replacing
+\begin_inset Formula $x_{i}$
+\end_inset
+
+ with
+\begin_inset Formula $\left(x_{i}-L\right)/S$
+\end_inset
+
+ in the log-likelihood function adding
+\begin_inset Formula $N\log S$
+\end_inset
+
+ and minimizing, thus
+\begin_inset Formula \begin{eqnarray*}
+l_{\mathbf{x}}\left(L,S;\boldsymbol{\theta}\right) & = & N\log S-\sum_{i=1}^{N}\log f\left(\frac{x_{i}-L}{S};\boldsymbol{\theta}\right)\\
+ & = & N\log S+l_{\frac{\mathbf{x}-S}{L}}\left(\boldsymbol{\theta}\right)\end{eqnarray*}
+
+\end_inset
+
+ If desired, sample estimates for
+\begin_inset Formula $L$
+\end_inset
+
+ and
+\begin_inset Formula $S$
+\end_inset
+
+ (not necessarily maximum likelihood estimates) can be obtained from samples
+ estimates of the mean and variance using
+\begin_inset Formula \begin{eqnarray*}
+\hat{S} & = & \sqrt{\frac{\hat{\mu}_{2}}{\mu_{2}}}\\
+\hat{L} & = & \hat{\mu}-\hat{S}\mu\end{eqnarray*}
+
+\end_inset
+
+ where
+\begin_inset Formula $\mu$
+\end_inset
+
+ and
+\begin_inset Formula $\mu_{2}$
+\end_inset
+
+ are assumed known as the mean and variance of the
+\series bold
+untransformed
+\series default
+ distribution (when
+\begin_inset Formula $L=0$
+\end_inset
+
+ and
+\begin_inset Formula $S=1$
+\end_inset
+
+) and
+\begin_inset Formula \begin{eqnarray*}
+\hat{\mu} & = & \frac{1}{N}\sum_{i=1}^{N}x_{i}=\bar{\mathbf{x}}\\
+\hat{\mu}_{2} & = & \frac{1}{N-1}\sum_{i=1}^{N}\left(x_{i}-\hat{\mu}\right)^{2}=\frac{N}{N-1}\overline{\left(\mathbf{x}-\bar{\mathbf{x}}\right)^{2}}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Standard notation for mean
+\end_layout
+
+\begin_layout Standard
+We will use
+\begin_inset Formula \[
+\overline{y\left(\mathbf{x}\right)}=\frac{1}{N}\sum_{i=1}^{N}y\left(x_{i}\right)\]
+
+\end_inset
+
+ where
+\begin_inset Formula $N$
+\end_inset
+
+ should be clear from context as the number of samples
+\begin_inset Formula $x_{i}$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Alpha
+\end_layout
+
+\begin_layout Standard
+One shape parameters
+\begin_inset Formula $\alpha>0$
+\end_inset
+
+ (paramter
+\begin_inset Formula $\beta$
+\end_inset
+
+ in DATAPLOT is a scale-parameter).
+ Standard form is
+\begin_inset Formula $x>0:$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\alpha\right) & = & \frac{1}{x^{2}\Phi\left(\alpha\right)\sqrt{2\pi}}\exp\left(-\frac{1}{2}\left(\alpha-\frac{1}{x}\right)^{2}\right)\\
+F\left(x;\alpha\right) & = & \frac{\Phi\left(\alpha-\frac{1}{x}\right)}{\Phi\left(\alpha\right)}\\
+G\left(q;\alpha\right) & = & \left[\alpha-\Phi^{-1}\left(q\Phi\left(\alpha\right)\right)\right]^{-1}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+M\left(t\right)=\frac{1}{\Phi\left(a\right)\sqrt{2\pi}}\int_{0}^{\infty}\frac{e^{xt}}{x^{2}}\exp\left(-\frac{1}{2}\left(\alpha-\frac{1}{x}\right)^{2}\right)dx\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+No moments?
+\begin_inset Formula \[
+l_{\mathbf{x}}\left(\alpha\right)=N\log\left[\Phi\left(\alpha\right)\sqrt{2\pi}\right]+2N\overline{\log\mathbf{x}}+\frac{N}{2}\alpha^{2}-\alpha\overline{\mathbf{x}^{-1}}+\frac{1}{2}\overline{\mathbf{x}^{-2}}\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Anglit
+\end_layout
+
+\begin_layout Standard
+Defined over
+\begin_inset Formula $x\in\left[-\frac{\pi}{4},\frac{\pi}{4}\right]$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \sin\left(2x+\frac{\pi}{2}\right)=\cos\left(2x\right)\\
+F\left(x\right) & = & \sin^{2}\left(x+\frac{\pi}{4}\right)\\
+G\left(q\right) & = & \arcsin\left(\sqrt{q}\right)-\frac{\pi}{4}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & 0\\
+\mu_{2} & = & \frac{\pi^{2}}{16}-\frac{1}{2}\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & -2\frac{\pi^{4}-96}{\left(\pi^{2}-8\right)^{2}}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+h\left[X\right] & = & 1-\log2\\
+ & \approx & 0.30685281944005469058\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+M\left(t\right) & = & \int_{-\frac{\pi}{4}}^{\frac{\pi}{4}}\cos\left(2x\right)e^{xt}dx\\
+ & = & \frac{4\cosh\left(\frac{\pi t}{4}\right)}{t^{2}+4}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+l_{\mathbf{x}}\left(\cdot\right)=-N\overline{\log\left[\cos\left(2\mathbf{x}\right)\right]}\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Arcsine
+\end_layout
+
+\begin_layout Standard
+Defined over
+\begin_inset Formula $x\in\left(0,1\right)$
+\end_inset
+
+.
+ To get the JKB definition put
+\begin_inset Formula $x=\frac{u+1}{2}.$
+\end_inset
+
+ i.e.
+
+\begin_inset Formula $L=-1$
+\end_inset
+
+ and
+\begin_inset Formula $S=2.$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{1}{\pi\sqrt{x\left(1-x\right)}}\\
+F\left(x\right) & = & \frac{2}{\pi}\arcsin\left(\sqrt{x}\right)\\
+G\left(q\right) & = & \sin^{2}\left(\frac{\pi}{2}q\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=E^{t/2}I_{0}\left(\frac{t}{2}\right)\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu_{n}^{\prime} & = & \frac{1}{\pi}\int_{0}^{1}dx\, x^{n-1/2}\left(1-x\right)^{-1/2}\\
+ & = & \frac{1}{\pi}B\left(\frac{1}{2},n+\frac{1}{2}\right)=\frac{\left(2n-1\right)!!}{2^{n}n!}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{1}{2}\\
+\mu_{2} & = & \frac{1}{8}\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & -\frac{3}{2}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]\approx-0.24156447527049044468\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+l_{\mathbf{x}}\left(\cdot\right)=N\log\pi+\frac{N}{2}\overline{\log\mathbf{x}}+\frac{N}{2}\overline{\log\left(1-\mathbf{x}\right)}\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Beta
+\end_layout
+
+\begin_layout Standard
+Two shape parameters
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+a,b>0\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;a,b\right) & = & \frac{\Gamma\left(a+b\right)}{\Gamma\left(a\right)\Gamma\left(b\right)}x^{a-1}\left(1-x\right)^{b-1}I_{\left(0,1\right)}\left(x\right)\\
+F\left(x;a,b\right) & = & \int_{0}^{x}f\left(y;a,b\right)dy=I\left(x,a,b\right)\\
+G\left(\alpha;a,b\right) & = & I^{-1}\left(\alpha;a,b\right)\\
+M\left(t\right) & = & \frac{\Gamma\left(a\right)\Gamma\left(b\right)}{\Gamma\left(a+b\right)}\,_{1}F_{1}\left(a;a+b;t\right)\\
+\mu & = & \frac{a}{a+b}\\
+\mu_{2} & = & \frac{ab\left(a+b+1\right)}{\left(a+b\right)^{2}}\\
+\gamma_{1} & = & 2\frac{b-a}{a+b+2}\sqrt{\frac{a+b+1}{ab}}\\
+\gamma_{2} & = & \frac{6\left(a^{3}+a^{2}\left(1-2b\right)+b^{2}\left(b+1\right)-2ab\left(b+2\right)\right)}{ab\left(a+b+2\right)\left(a+b+3\right)}\\
+m_{d} & = & \frac{\left(a-1\right)}{\left(a+b-2\right)}\, a+b\neq2\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula $f\left(x;a,1\right)$
+\end_inset
+
+ is also called the Power-function distribution.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+l_{\mathbf{x}}\left(a,b\right)=-N\log\Gamma\left(a+b\right)+N\log\Gamma\left(a\right)+N\log\Gamma\left(b\right)-N\left(a-1\right)\overline{\log\mathbf{x}}-N\left(b-1\right)\overline{\log\left(1-\mathbf{x}\right)}\]
+
+\end_inset
+
+ All of the
+\begin_inset Formula $x_{i}\in\left[0,1\right]$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Beta Prime
+\end_layout
+
+\begin_layout Standard
+Defined over
+\begin_inset Formula $00.$
+\end_inset
+
+ (Note the CDF evaluation uses Eq.
+ 3.194.1 on pg.
+ 313 of Gradshteyn & Ryzhik (sixth edition).
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\alpha,\beta\right) & = & \frac{\Gamma\left(\alpha+\beta\right)}{\Gamma\left(\alpha\right)\Gamma\left(\beta\right)}x^{\alpha-1}\left(1+x\right)^{-\alpha-\beta}\\
+F\left(x;\alpha,\beta\right) & = & \frac{\Gamma\left(\alpha+\beta\right)}{\alpha\Gamma\left(\alpha\right)\Gamma\left(\beta\right)}x^{\alpha}\,_{2}F_{1}\left(\alpha+\beta,\alpha;1+\alpha;-x\right)\\
+G\left(q;\alpha,\beta\right) & = & F^{-1}\left(x;\alpha,\beta\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\left\{ \begin{array}{ccc}
+\frac{\Gamma\left(n+\alpha\right)\Gamma\left(\beta-n\right)}{\Gamma\left(\alpha\right)\Gamma\left(\beta\right)}=\frac{\left(\alpha\right)_{n}}{\left(\beta-n\right)_{n}} & & \beta>n\\
+\infty & & \textrm{otherwise}\end{array}\right.\]
+
+\end_inset
+
+ Therefore,
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{\alpha}{\beta-1}\quad\beta>1\\
+\mu_{2} & = & \frac{\alpha\left(\alpha+1\right)}{\left(\beta-2\right)\left(\beta-1\right)}-\frac{\alpha^{2}}{\left(\beta-1\right)^{2}}\quad\beta>2\\
+\gamma_{1} & = & \frac{\frac{\alpha\left(\alpha+1\right)\left(\alpha+2\right)}{\left(\beta-3\right)\left(\beta-2\right)\left(\beta-1\right)}-3\mu\mu_{2}-\mu^{3}}{\mu_{2}^{3/2}}\quad\beta>3\\
+\gamma_{2} & = & \frac{\mu_{4}}{\mu_{2}^{2}}-3\\
+\mu_{4} & = & \frac{\alpha\left(\alpha+1\right)\left(\alpha+2\right)\left(\alpha+3\right)}{\left(\beta-4\right)\left(\beta-3\right)\left(\beta-2\right)\left(\beta-1\right)}-4\mu\mu_{3}-6\mu^{2}\mu_{2}-\mu^{4}\quad\beta>4\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Bradford
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+c & > & 0\\
+k & = & \log\left(1+c\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \frac{c}{k\left(1+cx\right)}I_{\left(0,1\right)}\left(x\right)\\
+F\left(x;c\right) & = & \frac{\log\left(1+cx\right)}{k}\\
+G\left(\alpha\; c\right) & = & \frac{\left(1+c\right)^{\alpha}-1}{c}\\
+M\left(t\right) & = & \frac{1}{k}e^{-t/c}\left[\textrm{Ei}\left(t+\frac{t}{c}\right)-\textrm{Ei}\left(\frac{t}{c}\right)\right]\\
+\mu & = & \frac{c-k}{ck}\\
+\mu_{2} & = & \frac{\left(c+2\right)k-2c}{2ck^{2}}\\
+\gamma_{1} & = & \frac{\sqrt{2}\left(12c^{2}-9kc\left(c+2\right)+2k^{2}\left(c\left(c+3\right)+3\right)\right)}{\sqrt{c\left(c\left(k-2\right)+2k\right)}\left(3c\left(k-2\right)+6k\right)}\\
+\gamma_{2} & = & \frac{c^{3}\left(k-3\right)\left(k\left(3k-16\right)+24\right)+12kc^{2}\left(k-4\right)\left(k-3\right)+6ck^{2}\left(3k-14\right)+12k^{3}}{3c\left(c\left(k-2\right)+2k\right)^{2}}\\
+m_{d} & = & 0\\
+m_{n} & = & \sqrt{1+c}-1\end{eqnarray*}
+
+\end_inset
+
+ where
+\begin_inset Formula $\textrm{Ei}\left(\textrm{z}\right)$
+\end_inset
+
+ is the exponential integral function.
+ Also
+\begin_inset Formula \[
+h\left[X\right]=\frac{1}{2}\log\left(1+c\right)-\log\left(\frac{c}{\log\left(1+c\right)}\right)\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Burr
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+c & > & 0\\
+d & > & 0\\
+k & = & \Gamma\left(d\right)\Gamma\left(1-\frac{2}{c}\right)\Gamma\left(\frac{2}{c}+d\right)-\Gamma^{2}\left(1-\frac{1}{c}\right)\Gamma^{2}\left(\frac{1}{c}+d\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c,d\right) & = & \frac{cd}{x^{c+1}\left(1+x^{-c}\right)^{d+1}}I_{\left(0,\infty\right)}\left(x\right)\\
+F\left(x;c,d\right) & = & \left(1+x^{-c}\right)^{-d}\\
+G\left(\alpha;c,d\right) & = & \left(\alpha^{-1/d}-1\right)^{-1/c}\\
+\mu & = & \frac{\Gamma\left(1-\frac{1}{c}\right)\Gamma\left(\frac{1}{c}+d\right)}{\Gamma\left(d\right)}\\
+\mu_{2} & = & \frac{k}{\Gamma^{2}\left(d\right)}\\
+\gamma_{1} & = & \frac{1}{\sqrt{k^{3}}}\left[2\Gamma^{3}\left(1-\frac{1}{c}\right)\Gamma^{3}\left(\frac{1}{c}+d\right)+\Gamma^{2}\left(d\right)\Gamma\left(1-\frac{3}{c}\right)\Gamma\left(\frac{3}{c}+d\right)\right.\\
+ & & \left.-3\Gamma\left(d\right)\Gamma\left(1-\frac{2}{c}\right)\Gamma\left(1-\frac{1}{c}\right)\Gamma\left(\frac{1}{c}+d\right)\Gamma\left(\frac{2}{c}+d\right)\right]\\
+\gamma_{2} & = & -3+\frac{1}{k^{2}}\left[6\Gamma\left(d\right)\Gamma\left(1-\frac{2}{c}\right)\Gamma^{2}\left(1-\frac{1}{c}\right)\Gamma^{2}\left(\frac{1}{c}+d\right)\Gamma\left(\frac{2}{c}+d\right)\right.\\
+ & & -3\Gamma^{4}\left(1-\frac{1}{c}\right)\Gamma^{4}\left(\frac{1}{c}+d\right)+\Gamma^{3}\left(d\right)\Gamma\left(1-\frac{4}{c}\right)\Gamma\left(\frac{4}{c}+d\right)\\
+ & & \left.-4\Gamma^{2}\left(d\right)\Gamma\left(1-\frac{3}{c}\right)\Gamma\left(1-\frac{1}{c}\right)\Gamma\left(\frac{1}{c}+d\right)\Gamma\left(\frac{3}{c}+d\right)\right]\\
+m_{d} & = & \left(\frac{cd-1}{c+1}\right)^{1/c}\,\textrm{if }cd>1\,\textrm{otherwise }0\\
+m_{n} & = & \left(2^{1/d}-1\right)^{-1/c}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Cauchy
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{1}{\pi\left(1+x^{2}\right)}\\
+F\left(x\right) & = & \frac{1}{2}+\frac{1}{\pi}\tan^{-1}x\\
+G\left(\alpha\right) & = & \tan\left(\pi\alpha-\frac{\pi}{2}\right)\\
+m_{d} & = & 0\\
+m_{n} & = & 0\end{eqnarray*}
+
+\end_inset
+
+No finite moments.
+ This is the t distribution with one degree of freedom.
+
+\begin_inset Formula \begin{eqnarray*}
+h\left[X\right] & = & \log\left(4\pi\right)\\
+ & \approx & 2.5310242469692907930.\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Chi
+\end_layout
+
+\begin_layout Standard
+Generated by taking the (positive) square-root of chi-squared variates.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\nu\right) & = & \frac{x^{\nu-1}e^{-x^{2}/2}}{2^{\nu/2-1}\Gamma\left(\frac{\nu}{2}\right)}I_{\left(0,\infty\right)}\left(x\right)\\
+F\left(x;\nu\right) & = & \Gamma\left(\frac{\nu}{2},\frac{x^{2}}{2}\right)\\
+G\left(\alpha;\nu\right) & = & \sqrt{2\Gamma^{-1}\left(\frac{\nu}{2},\alpha\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\Gamma\left(\frac{v}{2}\right)\,_{1}F_{1}\left(\frac{v}{2};\frac{1}{2};\frac{t^{2}}{2}\right)+\frac{t}{\sqrt{2}}\Gamma\left(\frac{1+\nu}{2}\right)\,_{1}F_{1}\left(\frac{1+\nu}{2};\frac{3}{2};\frac{t^{2}}{2}\right)\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{\sqrt{2}\Gamma\left(\frac{\nu+1}{2}\right)}{\Gamma\left(\frac{\nu}{2}\right)}\\
+\mu_{2} & = & \nu-\mu^{2}\\
+\gamma_{1} & = & \frac{2\mu^{3}+\mu\left(1-2\nu\right)}{\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{2\nu\left(1-\nu\right)-6\mu^{4}+4\mu^{2}\left(2\nu-1\right)}{\mu_{2}^{2}}\\
+m_{d} & = & \sqrt{\nu-1}\quad\nu\geq1\\
+m_{n} & = & \sqrt{2\Gamma^{-1}\left(\frac{\nu}{2},\frac{1}{2}\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Chi-squared
+\end_layout
+
+\begin_layout Standard
+This is the gamma distribution with
+\begin_inset Formula $L=0.0$
+\end_inset
+
+ and
+\begin_inset Formula $S=2.0$
+\end_inset
+
+ and
+\begin_inset Formula $\alpha=\nu/2$
+\end_inset
+
+ where
+\begin_inset Formula $\nu$
+\end_inset
+
+ is called the degrees of freedom.
+ If
+\begin_inset Formula $Z_{1}\ldots Z_{\nu}$
+\end_inset
+
+ are all standard normal distributions, then
+\begin_inset Formula $W=\sum_{k}Z_{k}^{2}$
+\end_inset
+
+ has (standard) chi-square distribution with
+\begin_inset Formula $\nu$
+\end_inset
+
+ degrees of freedom.
+
+\end_layout
+
+\begin_layout Standard
+The standard form (most often used in standard form only) is
+\begin_inset Formula $x>0$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\alpha\right) & = & \frac{1}{2\Gamma\left(\frac{\nu}{2}\right)}\left(\frac{x}{2}\right)^{\nu/2-1}e^{-x/2}\\
+F\left(x;\alpha\right) & = & \Gamma\left(\frac{\nu}{2},\frac{x}{2}\right)\\
+G\left(q;\alpha\right) & = & 2\Gamma^{-1}\left(\frac{\nu}{2},q\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\frac{\Gamma\left(\frac{\nu}{2}\right)}{\left(\frac{1}{2}-t\right)^{\nu/2}}\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \nu\\
+\mu_{2} & = & 2\nu\\
+\gamma_{1} & = & \frac{2\sqrt{2}}{\sqrt{\nu}}\\
+\gamma_{2} & = & \frac{12}{\nu}\\
+m_{d} & = & \frac{\nu}{2}-1\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Cosine
+\end_layout
+
+\begin_layout Standard
+Approximation to the normal distribution.
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{1}{2\pi}\left[1+\cos x\right]I_{\left[-\pi,\pi\right]}\left(x\right)\\
+F\left(x\right) & = & \frac{1}{2\pi}\left[\pi+x+\sin x\right]I_{\left[-\pi,\pi\right]}\left(x\right)+I_{\left(\pi,\infty\right)}\left(x\right)\\
+G\left(\alpha\right) & = & F^{-1}\left(\alpha\right)\\
+M\left(t\right) & = & \frac{\sinh\left(\pi t\right)}{\pi t\left(1+t^{2}\right)}\\
+\mu=m_{d}=m_{n} & = & 0\\
+\mu_{2} & = & \frac{\pi^{2}}{3}-2\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & \frac{-6\left(\pi^{4}-90\right)}{5\left(\pi^{2}-6\right)^{2}}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+h\left[X\right] & = & \log\left(4\pi\right)-1\\
+ & \approx & 1.5310242469692907930.\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Double Gamma
+\end_layout
+
+\begin_layout Standard
+The double gamma is the signed version of the Gamma distribution.
+ For
+\begin_inset Formula $\alpha>0:$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\alpha\right) & = & \frac{1}{2\Gamma\left(\alpha\right)}\left|x\right|^{\alpha-1}e^{-\left|x\right|}\\
+F\left(x;\alpha\right) & = & \left\{ \begin{array}{ccc}
+\frac{1}{2}-\frac{1}{2}\Gamma\left(\alpha,\left|x\right|\right) & & x\leq0\\
+\frac{1}{2}+\frac{1}{2}\Gamma\left(\alpha,\left|x\right|\right) & & x>0\end{array}\right.\\
+G\left(q;\alpha\right) & = & \left\{ \begin{array}{ccc}
+-\Gamma^{-1}\left(\alpha,\left|2q-1\right|\right) & & q\leq\frac{1}{2}\\
+\Gamma^{-1}\left(\alpha,\left|2q-1\right|\right) & & q>\frac{1}{2}\end{array}\right.\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+M\left(t\right)=\frac{1}{2\left(1-t\right)^{a}}+\frac{1}{2\left(1+t\right)^{a}}\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu=m_{n} & = & 0\\
+\mu_{2} & = & \alpha\left(\alpha+1\right)\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & \frac{\left(\alpha+2\right)\left(\alpha+3\right)}{\alpha\left(\alpha+1\right)}-3\\
+m_{d} & = & \textrm{NA}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Doubly Non-central F*
+\end_layout
+
+\begin_layout Section
+Doubly Non-central t*
+\end_layout
+
+\begin_layout Section
+Double Weibull
+\end_layout
+
+\begin_layout Standard
+This is a signed form of the Weibull distribution.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \frac{c}{2}\left|x\right|^{c-1}\exp\left(-\left|x\right|^{c}\right)\\
+F\left(x;c\right) & = & \left\{ \begin{array}{ccc}
+\frac{1}{2}\exp\left(-\left|x\right|^{c}\right) & & x\leq0\\
+1-\frac{1}{2}\exp\left(-\left|x\right|^{c}\right) & & x>0\end{array}\right.\\
+G\left(q;c\right) & = & \left\{ \begin{array}{ccc}
+-\log^{1/c}\left(\frac{1}{2q}\right) & & q\leq\frac{1}{2}\\
+\log^{1/c}\left(\frac{1}{2q-1}\right) & & q>\frac{1}{2}\end{array}\right.\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\mu_{n}=\begin{cases}
+\Gamma\left(1+\frac{n}{c}\right) & n\textrm{ even}\\
+0 & n\textrm{ odd}\end{cases}\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+m_{d}=\mu & = & 0\\
+\mu_{2} & = & \Gamma\left(\frac{c+2}{c}\right)\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & \frac{\Gamma\left(1+\frac{4}{c}\right)}{\Gamma^{2}\left(1+\frac{2}{c}\right)}\\
+m_{d} & = & \textrm{NA bimodal}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Erlang
+\end_layout
+
+\begin_layout Standard
+This is just the Gamma distribution with shape parameter
+\begin_inset Formula $\alpha=n$
+\end_inset
+
+ an integer.
+
+\end_layout
+
+\begin_layout Section
+Exponential
+\end_layout
+
+\begin_layout Standard
+This is a special case of the Gamma (and Erlang) distributions with shape
+ parameter
+\begin_inset Formula $\left(\alpha=1\right)$
+\end_inset
+
+ and the same location and scale parameters.
+ The standard form is therefore (
+\begin_inset Formula $x\geq0$
+\end_inset
+
+)
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & e^{-x}\\
+F\left(x\right) & = & \Gamma\left(1,x\right)=1-e^{-x}\\
+G\left(q\right) & = & -\log\left(1-q\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+\mu_{n}^{\prime}=n!\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+M\left(t\right)=\frac{1}{1-t}\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & 1\\
+\mu_{2} & = & 1\\
+\gamma_{1} & = & 2\\
+\gamma_{2} & = & 6\\
+m_{d} & = & 0\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=1.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Exponentiated Weibull
+\end_layout
+
+\begin_layout Standard
+Two positive shape parameters
+\begin_inset Formula $a$
+\end_inset
+
+ and
+\begin_inset Formula $c$
+\end_inset
+
+ and
+\begin_inset Formula $x\in\left(0,\infty\right)$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;a,c\right) & = & ac\left[1-\exp\left(-x^{c}\right)\right]^{a-1}\exp\left(-x^{c}\right)x^{c-1}\\
+F\left(x;a,c\right) & = & \left[1-\exp\left(-x^{c}\right)\right]^{a}\\
+G\left(q;a,c\right) & = & \left[-\log\left(1-q^{1/a}\right)\right]^{1/c}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Exponential Power
+\end_layout
+
+\begin_layout Standard
+One positive shape parameter
+\begin_inset Formula $b$
+\end_inset
+
+.
+ Defined for
+\begin_inset Formula $x\geq0.$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;b\right) & = & ebx^{b-1}\exp\left[x^{b}-e^{x^{b}}\right]\\
+F\left(x;b\right) & = & 1-\exp\left[1-e^{x^{b}}\right]\\
+G\left(q;b\right) & = & \log^{1/b}\left[1-\log\left(1-q\right)\right]\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Fatigue Life (Birnbaum-Sanders)
+\end_layout
+
+\begin_layout Standard
+This distribution's pdf is the average of the inverse-Gaussian
+\begin_inset Formula $\left(\mu=1\right)$
+\end_inset
+
+ and reciprocal inverse-Gaussian pdf
+\begin_inset Formula $\left(\mu=1\right)$
+\end_inset
+
+.
+ We follow the notation of JKB here with
+\begin_inset Formula $\beta=S.$
+\end_inset
+
+ for
+\begin_inset Formula $x>0$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \frac{x+1}{2c\sqrt{2\pi x^{3}}}\exp\left(-\frac{\left(x-1\right)^{2}}{2xc^{2}}\right)\\
+F\left(x;c\right) & = & \Phi\left(\frac{1}{c}\left(\sqrt{x}-\frac{1}{\sqrt{x}}\right)\right)\\
+G\left(q;c\right) & = & \frac{1}{4}\left[c\Phi^{-1}\left(q\right)+\sqrt{c^{2}\left(\Phi^{-1}\left(q\right)\right)^{2}+4}\right]^{2}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=c\sqrt{2\pi}\exp\left[\frac{1}{c^{2}}\left(1-\sqrt{1-2c^{2}t}\right)\right]\left(1+\frac{1}{\sqrt{1-2c^{2}t}}\right)\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{c^{2}}{2}+1\\
+\mu_{2} & = & c^{2}\left(\frac{5}{4}c^{2}+1\right)\\
+\gamma_{1} & = & \frac{4c\sqrt{11c^{2}+6}}{\left(5c^{2}+4\right)^{3/2}}\\
+\gamma_{2} & = & \frac{6c^{2}\left(93c^{2}+41\right)}{\left(5c^{2}+4\right)^{2}}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Fisk (Log Logistic)
+\end_layout
+
+\begin_layout Standard
+Special case of the Burr distribution with
+\begin_inset Formula $d=1$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+c & > & 0\\
+k & = & \Gamma\left(1-\frac{2}{c}\right)\Gamma\left(\frac{2}{c}+1\right)-\Gamma^{2}\left(1-\frac{1}{c}\right)\Gamma^{2}\left(\frac{1}{c}+1\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c,d\right) & = & \frac{cx^{c-1}}{\left(1+x^{c}\right)^{2}}I_{\left(0,\infty\right)}\left(x\right)\\
+F\left(x;c,d\right) & = & \left(1+x^{-c}\right)^{-1}\\
+G\left(\alpha;c,d\right) & = & \left(\alpha^{-1}-1\right)^{-1/c}\\
+\mu & = & \Gamma\left(1-\frac{1}{c}\right)\Gamma\left(\frac{1}{c}+1\right)\\
+\mu_{2} & = & k\\
+\gamma_{1} & = & \frac{1}{\sqrt{k^{3}}}\left[2\Gamma^{3}\left(1-\frac{1}{c}\right)\Gamma^{3}\left(\frac{1}{c}+1\right)+\Gamma\left(1-\frac{3}{c}\right)\Gamma\left(\frac{3}{c}+1\right)\right.\\
+ & & \left.-3\Gamma\left(1-\frac{2}{c}\right)\Gamma\left(1-\frac{1}{c}\right)\Gamma\left(\frac{1}{c}+1\right)\Gamma\left(\frac{2}{c}+1\right)\right]\\
+\gamma_{2} & = & -3+\frac{1}{k^{2}}\left[6\Gamma\left(1-\frac{2}{c}\right)\Gamma^{2}\left(1-\frac{1}{c}\right)\Gamma^{2}\left(\frac{1}{c}+1\right)\Gamma\left(\frac{2}{c}+1\right)\right.\\
+ & & -3\Gamma^{4}\left(1-\frac{1}{c}\right)\Gamma^{4}\left(\frac{1}{c}+1\right)+\Gamma\left(1-\frac{4}{c}\right)\Gamma\left(\frac{4}{c}+1\right)\\
+ & & \left.-4\Gamma\left(1-\frac{3}{c}\right)\Gamma\left(1-\frac{1}{c}\right)\Gamma\left(\frac{1}{c}+1\right)\Gamma\left(\frac{3}{c}+1\right)\right]\\
+m_{d} & = & \left(\frac{c-1}{c+1}\right)^{1/c}\,\textrm{if }c>1\,\textrm{otherwise }0\\
+m_{n} & = & 1\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=2-\log c.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Folded Cauchy
+\end_layout
+
+\begin_layout Standard
+This formula can be expressed in terms of the standard formulas for the
+ Cauchy distribution (call the cdf
+\begin_inset Formula $C\left(x\right)$
+\end_inset
+
+ and the pdf
+\begin_inset Formula $d\left(x\right)$
+\end_inset
+
+).
+ if
+\begin_inset Formula $Y$
+\end_inset
+
+ is cauchy then
+\begin_inset Formula $\left|Y\right|$
+\end_inset
+
+ is folded cauchy.
+ Note that
+\begin_inset Formula $x\geq0.$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \frac{1}{\pi\left(1+\left(x-c\right)^{2}\right)}+\frac{1}{\pi\left(1+\left(x+c\right)^{2}\right)}\\
+F\left(x;c\right) & = & \frac{1}{\pi}\tan^{-1}\left(x-c\right)+\frac{1}{\pi}\tan^{-1}\left(x+c\right)\\
+G\left(q;c\right) & = & F^{-1}\left(x;c\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+No moments
+\end_layout
+
+\begin_layout Section
+Folded Normal
+\end_layout
+
+\begin_layout Standard
+If
+\begin_inset Formula $Z$
+\end_inset
+
+ is Normal with mean
+\begin_inset Formula $L$
+\end_inset
+
+ and
+\begin_inset Formula $\sigma=S$
+\end_inset
+
+, then
+\begin_inset Formula $\left|Z\right|$
+\end_inset
+
+ is a folded normal with shape parameter
+\begin_inset Formula $c=\left|L\right|/S$
+\end_inset
+
+, location parameter
+\begin_inset Formula $0$
+\end_inset
+
+ and scale parameter
+\begin_inset Formula $S$
+\end_inset
+
+.
+ This is a special case of the non-central chi distribution with one-degree
+ of freedom and non-centrality parameter
+\begin_inset Formula $c^{2}.$
+\end_inset
+
+ Note that
+\begin_inset Formula $c\geq0$
+\end_inset
+
+.
+ The standard form of the folded normal is
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \sqrt{\frac{2}{\pi}}\cosh\left(cx\right)\exp\left(-\frac{x^{2}+c^{2}}{2}\right)\\
+F\left(x;c\right) & = & \Phi\left(x-c\right)-\Phi\left(-x-c\right)=\Phi\left(x-c\right)+\Phi\left(x+c\right)-1\\
+G\left(\alpha;c\right) & = & F^{-1}\left(x;c\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\exp\left[\frac{t}{2}\left(t-2c\right)\right]\left(1+e^{2ct}\right)\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+k & = & \textrm{erf}\left(\frac{c}{\sqrt{2}}\right)\\
+p & = & \exp\left(-\frac{c^{2}}{2}\right)\\
+\mu & = & \sqrt{\frac{2}{\pi}}p+ck\\
+\mu_{2} & = & c^{2}+1-\mu^{2}\\
+\gamma_{1} & = & \frac{\sqrt{\frac{2}{\pi}}p^{3}\left(4-\frac{\pi}{p^{2}}\left(2c^{2}+1\right)\right)+2ck\left(6p^{2}+3cpk\sqrt{2\pi}+\pi c\left(k^{2}-1\right)\right)}{\pi\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{c^{4}+6c^{2}+3+6\left(c^{2}+1\right)\mu^{2}-3\mu^{4}-4p\mu\left(\sqrt{\frac{2}{\pi}}\left(c^{2}+2\right)+\frac{ck}{p}\left(c^{2}+3\right)\right)}{\mu_{2}^{2}}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Fratio (or F)
+\end_layout
+
+\begin_layout Standard
+Defined for
+\begin_inset Formula $x>0$
+\end_inset
+
+.
+ The distribution of
+\begin_inset Formula $\left(X_{1}/X_{2}\right)\left(\nu_{2}/\nu_{1}\right)$
+\end_inset
+
+ if
+\begin_inset Formula $X_{1}$
+\end_inset
+
+ is chi-squared with
+\begin_inset Formula $v_{1}$
+\end_inset
+
+ degrees of freedom and
+\begin_inset Formula $X_{2}$
+\end_inset
+
+ is chi-squared with
+\begin_inset Formula $v_{2}$
+\end_inset
+
+ degrees of freedom.
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\nu_{1},\nu_{2}\right) & = & \frac{\nu_{2}^{\nu_{2}/2}\nu_{1}^{\nu_{1}/2}x^{\nu_{1}/2-1}}{\left(\nu_{2}+\nu_{1}x\right)^{\left(\nu_{1}+\nu_{2}\right)/2}B\left(\frac{\nu_{1}}{2},\frac{\nu_{2}}{2}\right)}\\
+F\left(x;v_{1},v_{2}\right) & = & I\left(\frac{\nu_{1}}{2},\frac{\nu_{2}}{2},\frac{\nu_{2}x}{\nu_{2}+\nu_{1}x}\right)\\
+G\left(q;\nu_{1},\nu_{2}\right) & = & \left[\frac{\nu_{2}}{I^{-1}\left(\nu_{1}/2,\nu_{2}/2,q\right)}-\frac{\nu_{1}}{\nu_{2}}\right]^{-1}.\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{\nu_{2}}{\nu_{2}-2}\quad\nu_{2}>2\\
+\mu_{2} & = & \frac{2\nu_{2}^{2}\left(\nu_{1}+\nu_{2}-2\right)}{\nu_{1}\left(\nu_{2}-2\right)^{2}\left(\nu_{2}-4\right)}\quad v_{2}>4\\
+\gamma_{1} & = & \frac{2\left(2\nu_{1}+\nu_{2}-2\right)}{\nu_{2}-6}\sqrt{\frac{2\left(\nu_{2}-4\right)}{\nu_{1}\left(\nu_{1}+\nu_{2}-2\right)}}\quad\nu_{2}>6\\
+\gamma_{2} & = & \frac{3\left[8+\left(\nu_{2}-6\right)\gamma_{1}^{2}\right]}{2\nu-16}\quad\nu_{2}>8\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Fr?chet (ExtremeLB, Extreme Value II, Weibull minimum)
+\end_layout
+
+\begin_layout Standard
+A type of extreme-value distribution with a lower bound.
+ Defined for
+\begin_inset Formula $x>0$
+\end_inset
+
+ and
+\begin_inset Formula $c>0$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & cx^{c-1}\exp\left(-x^{c}\right)\\
+F\left(x;c\right) & = & 1-\exp\left(-x^{c}\right)\\
+G\left(q;c\right) & = & \left[-\log\left(1-q\right)\right]^{1/c}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\Gamma\left(1+\frac{n}{c}\right)\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \Gamma\left(1+\frac{1}{c}\right)\\
+\mu_{2} & = & \Gamma\left(1+\frac{2}{c}\right)-\Gamma^{2}\left(1-\frac{1}{c}\right)\\
+\gamma_{1} & = & \frac{\Gamma\left(1+\frac{3}{c}\right)-3\Gamma\left(1+\frac{2}{c}\right)\Gamma\left(1+\frac{1}{c}\right)+2\Gamma^{3}\left(1+\frac{1}{c}\right)}{\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{\Gamma\left(1+\frac{4}{c}\right)-4\Gamma\left(1+\frac{1}{c}\right)\Gamma\left(1+\frac{3}{c}\right)+6\Gamma^{2}\left(1+\frac{1}{c}\right)\Gamma\left(1+\frac{2}{c}\right)-\Gamma^{4}\left(1+\frac{1}{c}\right)}{\mu_{2}^{2}}-3\\
+m_{d} & = & \left(\frac{c}{1+c}\right)^{1/c}\\
+m_{n} & = & G\left(\frac{1}{2};c\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=-\frac{\gamma}{c}-\log\left(c\right)+\gamma+1\]
+
+\end_inset
+
+ where
+\begin_inset Formula $\gamma$
+\end_inset
+
+ is Euler's constant and equal to
+\begin_inset Formula \[
+\gamma\approx0.57721566490153286061.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Fr?chet (left-skewed, Extreme Value Type III, Weibull maximum)
+\end_layout
+
+\begin_layout Standard
+Defined for
+\begin_inset Formula $x<0$
+\end_inset
+
+ and
+\begin_inset Formula $c>0$
+\end_inset
+
+.
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & c\left(-x\right)^{c-1}\exp\left(-\left(-x\right)^{c}\right)\\
+F\left(x;c\right) & = & \exp\left(-\left(-x\right)^{c}\right)\\
+G\left(q;c\right) & = & -\left(-\log q\right)^{1/c}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The mean is the negative of the right-skewed Frechet distribution given
+ above, and the other statistical parameters can be computed from
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\left(-1\right)^{n}\Gamma\left(1+\frac{n}{c}\right).\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=-\frac{\gamma}{c}-\log\left(c\right)+\gamma+1\]
+
+\end_inset
+
+ where
+\begin_inset Formula $\gamma$
+\end_inset
+
+ is Euler's constant and equal to
+\begin_inset Formula \[
+\gamma\approx0.57721566490153286061.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Gamma
+\end_layout
+
+\begin_layout Standard
+The standard form for the gamma distribution is
+\begin_inset Formula $\left(\alpha>0\right)$
+\end_inset
+
+ valid for
+\begin_inset Formula $x\geq0$
+\end_inset
+
+.
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\alpha\right) & = & \frac{1}{\Gamma\left(\alpha\right)}x^{\alpha-1}e^{-x}\\
+F\left(x;\alpha\right) & = & \Gamma\left(\alpha,x\right)\\
+G\left(q;\alpha\right) & = & \Gamma^{-1}\left(\alpha,q\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\frac{1}{\left(1-t\right)^{\alpha}}\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \alpha\\
+\mu_{2} & = & \alpha\\
+\gamma_{1} & = & \frac{2}{\sqrt{\alpha}}\\
+\gamma_{2} & = & \frac{6}{\alpha}\\
+m_{d} & = & \alpha-1\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=\Psi\left(a\right)\left[1-a\right]+a+\log\Gamma\left(a\right)\]
+
+\end_inset
+
+ where
+\begin_inset Formula \[
+\Psi\left(a\right)=\frac{\Gamma^{\prime}\left(a\right)}{\Gamma\left(a\right)}.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Generalized Logistic
+\end_layout
+
+\begin_layout Standard
+Has been used in the analysis of extreme values.
+ Has one shape parameter
+\begin_inset Formula $c>0.$
+\end_inset
+
+ And
+\begin_inset Formula $x>0$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \frac{c\exp\left(-x\right)}{\left[1+\exp\left(-x\right)\right]^{c+1}}\\
+F\left(x;c\right) & = & \frac{1}{\left[1+\exp\left(-x\right)\right]^{c}}\\
+G\left(q;c\right) & = & -\log\left(q^{-1/c}-1\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+M\left(t\right)=\frac{c}{1-t}\,_{2}F_{1}\left(1+c,\,1-t\,;\,2-t\,;-1\right)\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \gamma+\psi_{0}\left(c\right)\\
+\mu_{2} & = & \frac{\pi^{2}}{6}+\psi_{1}\left(c\right)\\
+\gamma_{1} & = & \frac{\psi_{2}\left(c\right)+2\zeta\left(3\right)}{\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{\left(\frac{\pi^{4}}{15}+\psi_{3}\left(c\right)\right)}{\mu_{2}^{2}}\\
+m_{d} & = & \log c\\
+m_{n} & = & -\log\left(2^{1/c}-1\right)\end{eqnarray*}
+
+\end_inset
+
+ Note that the polygamma function is
+\begin_inset Formula \begin{eqnarray*}
+\psi_{n}\left(z\right) & = & \frac{d^{n+1}}{dz^{n+1}}\log\Gamma\left(z\right)\\
+ & = & \left(-1\right)^{n+1}n!\sum_{k=0}^{\infty}\frac{1}{\left(z+k\right)^{n+1}}\\
+ & = & \left(-1\right)^{n+1}n!\zeta\left(n+1,z\right)\end{eqnarray*}
+
+\end_inset
+
+ where
+\begin_inset Formula $\zeta\left(k,x\right)$
+\end_inset
+
+ is a generalization of the Riemann zeta function called the Hurwitz zeta
+ function Note that
+\begin_inset Formula $\zeta\left(n\right)\equiv\zeta\left(n,1\right)$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Generalized Pareto
+\end_layout
+
+\begin_layout Standard
+Shape parameter
+\begin_inset Formula $c\neq0$
+\end_inset
+
+ and defined for
+\begin_inset Formula $x\geq0$
+\end_inset
+
+ for all
+\begin_inset Formula $c$
+\end_inset
+
+ and
+\begin_inset Formula $x<\frac{1}{\left|c\right|}$
+\end_inset
+
+ if
+\begin_inset Formula $c$
+\end_inset
+
+ is negative.
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \left(1+cx\right)^{-1-\frac{1}{c}}\\
+F\left(x;c\right) & = & 1-\frac{1}{\left(1+cx\right)^{1/c}}\\
+G\left(q;c\right) & = & \frac{1}{c}\left[\left(\frac{1}{1-q}\right)^{c}-1\right]\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+M\left(t\right)=\left\{ \begin{array}{cc}
+\left(-\frac{t}{c}\right)^{\frac{1}{c}}e^{-\frac{t}{c}}\left[\Gamma\left(1-\frac{1}{c}\right)+\Gamma\left(-\frac{1}{c},-\frac{t}{c}\right)-\pi\csc\left(\frac{\pi}{c}\right)/\Gamma\left(\frac{1}{c}\right)\right] & c>0\\
+\left(\frac{\left|c\right|}{t}\right)^{1/\left|c\right|}\Gamma\left[\frac{1}{\left|c\right|},\frac{t}{\left|c\right|}\right] & c<0\end{array}\right.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\frac{\left(-1\right)^{n}}{c^{n}}\sum_{k=0}^{n}\left(\begin{array}{c}
+n\\
+k\end{array}\right)\frac{\left(-1\right)^{k}}{1-ck}\quad cn<1\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu_{1}^{\prime} & = & \frac{1}{1-c}\quad c<1\\
+\mu_{2}^{\prime} & = & \frac{2}{\left(1-2c\right)\left(1-c\right)}\quad c<\frac{1}{2}\\
+\mu_{3}^{\prime} & = & \frac{6}{\left(1-c\right)\left(1-2c\right)\left(1-3c\right)}\quad c<\frac{1}{3}\\
+\mu_{4}^{\prime} & = & \frac{24}{\left(1-c\right)\left(1-2c\right)\left(1-3c\right)\left(1-4c\right)}\quad c<\frac{1}{4}\end{eqnarray*}
+
+\end_inset
+
+ Thus,
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \mu_{1}^{\prime}\\
+\mu_{2} & = & \mu_{2}^{\prime}-\mu^{2}\\
+\gamma_{1} & = & \frac{\mu_{3}^{\prime}-3\mu\mu_{2}-\mu^{3}}{\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{\mu_{4}^{\prime}-4\mu\mu_{3}-6\mu^{2}\mu_{2}-\mu^{4}}{\mu_{2}^{2}}-3\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=1+c\quad c>0\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Generalized Exponential
+\end_layout
+
+\begin_layout Standard
+Three positive shape parameters for
+\begin_inset Formula $x\geq0.$
+\end_inset
+
+ Note that
+\begin_inset Formula $a,b,$
+\end_inset
+
+ and
+\begin_inset Formula $c$
+\end_inset
+
+ are all
+\begin_inset Formula $>0.$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;a,b,c\right) & = & \left(a+b\left(1-e^{-cx}\right)\right)\exp\left[ax-bx+\frac{b}{c}\left(1-e^{-cx}\right)\right]\\
+F\left(x;a,b,c\right) & = & 1-\exp\left[ax-bx+\frac{b}{c}\left(1-e^{-cx}\right)\right]\\
+G\left(q;a,b,c\right) & = & F^{-1}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Generalized Extreme Value
+\end_layout
+
+\begin_layout Standard
+Extreme value distributions with shape parameter
+\begin_inset Formula $c$
+\end_inset
+
+.
+
+\end_layout
+
+\begin_layout Standard
+For
+\begin_inset Formula $c>0$
+\end_inset
+
+ defined on
+\begin_inset Formula $-\infty-1\]
+
+\end_inset
+
+ So,
+\begin_inset Formula \begin{eqnarray*}
+\mu_{1}^{\prime} & = & \frac{1}{c}\left(1-\Gamma\left(1+c\right)\right)\quad c>-1\\
+\mu_{2}^{\prime} & = & \frac{1}{c^{2}}\left(1-2\Gamma\left(1+c\right)+\Gamma\left(1+2c\right)\right)\quad c>-\frac{1}{2}\\
+\mu_{3}^{\prime} & = & \frac{1}{c^{3}}\left(1-3\Gamma\left(1+c\right)+3\Gamma\left(1+2c\right)-\Gamma\left(1+3c\right)\right)\quad c>-\frac{1}{3}\\
+\mu_{4}^{\prime} & = & \frac{1}{c^{4}}\left(1-4\Gamma\left(1+c\right)+6\Gamma\left(1+2c\right)-4\Gamma\left(1+3c\right)+\Gamma\left(1+4c\right)\right)\quad c>-\frac{1}{4}\end{eqnarray*}
+
+\end_inset
+
+ For
+\begin_inset Formula $c<0$
+\end_inset
+
+ defined on
+\begin_inset Formula $\frac{1}{c}\leq x<\infty.$
+\end_inset
+
+ For
+\begin_inset Formula $c=0$
+\end_inset
+
+ defined over all space
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;0\right) & = & \exp\left[-e^{-x}\right]e^{-x}\\
+F\left(x;0\right) & = & \exp\left[-e^{-x}\right]\\
+G\left(q;0\right) & = & -\log\left(-\log q\right)\end{eqnarray*}
+
+\end_inset
+
+ This is just the (left-skewed) Gumbel distribution for c=0.
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \gamma=-\psi_{0}\left(1\right)\\
+\mu_{2} & = & \frac{\pi^{2}}{6}\\
+\gamma_{1} & = & \frac{12\sqrt{6}}{\pi^{3}}\zeta\left(3\right)\\
+\gamma_{2} & = & \frac{12}{5}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Generalized Gamma
+\end_layout
+
+\begin_layout Standard
+A general probability form that reduces to many common distributions:
+\begin_inset Formula $x>0$
+\end_inset
+
+
+\begin_inset Formula $a>0$
+\end_inset
+
+ and
+\begin_inset Formula $c\neq0.$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;a,c\right) & = & \frac{\left|c\right|x^{ca-1}}{\Gamma\left(a\right)}\exp\left(-x^{c}\right)\\
+F\left(x;a,c\right) & = & \begin{array}{cc}
+\frac{\Gamma\left(a,x^{c}\right)}{\Gamma\left(a\right)} & c>0\\
+1-\frac{\Gamma\left(a,x^{c}\right)}{\Gamma\left(a\right)} & c<0\end{array}\\
+G\left(q;a,c\right) & = & \left\{ \Gamma^{-1}\left[a,\Gamma\left(a\right)q\right]\right\} ^{1/c}\quad c>0\\
+ & & \left\{ \Gamma^{-1}\left[a,\Gamma\left(a\right)\left(1-q\right)\right]\right\} ^{1/c}\quad c<0\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\frac{\Gamma\left(a+\frac{n}{c}\right)}{\Gamma\left(a\right)}\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{\Gamma\left(a+\frac{1}{c}\right)}{\Gamma\left(a\right)}\\
+\mu_{2} & = & \frac{\Gamma\left(a+\frac{2}{c}\right)}{\Gamma\left(a\right)}-\mu^{2}\\
+\gamma_{1} & = & \frac{\Gamma\left(a+\frac{3}{c}\right)/\Gamma\left(a\right)-3\mu\mu_{2}-\mu^{3}}{\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{\Gamma\left(a+\frac{4}{c}\right)/\Gamma\left(a\right)-4\mu\mu_{3}-6\mu^{2}\mu_{2}-\mu^{4}}{\mu_{2}^{2}}-3\\
+m_{d} & = & \left(\frac{ac-1}{c}\right)^{1/c}.\end{eqnarray*}
+
+\end_inset
+
+ Special cases are Weibull
+\begin_inset Formula $\left(a=1\right)$
+\end_inset
+
+, half-normal
+\begin_inset Formula $\left(a=1/2,c=2\right)$
+\end_inset
+
+ and ordinary gamma distributions
+\begin_inset Formula $c=1.$
+\end_inset
+
+ If
+\begin_inset Formula $c=-1$
+\end_inset
+
+ then it is the inverted gamma distribution.
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=a-a\Psi\left(a\right)+\frac{1}{c}\Psi\left(a\right)+\log\Gamma\left(a\right)-\log\left|c\right|.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Generalized Half-Logistic
+\end_layout
+
+\begin_layout Standard
+For
+\begin_inset Formula $x\in\left[0,1/c\right]$
+\end_inset
+
+ and
+\begin_inset Formula $c>0$
+\end_inset
+
+ we have
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \frac{2\left(1-cx\right)^{\frac{1}{c}-1}}{\left(1+\left(1-cx\right)^{1/c}\right)^{2}}\\
+F\left(x;c\right) & = & \frac{1-\left(1-cx\right)^{1/c}}{1+\left(1-cx\right)^{1/c}}\\
+G\left(q;c\right) & = & \frac{1}{c}\left[1-\left(\frac{1-q}{1+q}\right)^{c}\right]\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+h\left[X\right] & = & 2-\left(2c+1\right)\log2.\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Gilbrat
+\end_layout
+
+\begin_layout Standard
+Special case of the log-normal with
+\begin_inset Formula $\sigma=1$
+\end_inset
+
+ and
+\begin_inset Formula $S=1.0$
+\end_inset
+
+ (typically also
+\begin_inset Formula $L=0.0$
+\end_inset
+
+)
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\sigma\right) & = & \frac{1}{x\sqrt{2\pi}}\exp\left[-\frac{1}{2}\left(\log x\right)^{2}\right]\\
+F\left(x;\sigma\right) & = & \Phi\left(\log x\right)=\frac{1}{2}\left[1+\textrm{erf}\left(\frac{\log x}{\sqrt{2}}\right)\right]\\
+G\left(q;\sigma\right) & = & \exp\left\{ \Phi^{-1}\left(q\right)\right\} \end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \sqrt{e}\\
+\mu_{2} & = & e\left[e-1\right]\\
+\gamma_{1} & = & \sqrt{e-1}\left(2+e\right)\\
+\gamma_{2} & = & e^{4}+2e^{3}+3e^{2}-6\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+h\left[X\right] & = & \log\left(\sqrt{2\pi e}\right)\\
+ & \approx & 1.4189385332046727418\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Gompertz (Truncated Gumbel)
+\end_layout
+
+\begin_layout Standard
+For
+\begin_inset Formula $x\geq0$
+\end_inset
+
+ and
+\begin_inset Formula $c>0$
+\end_inset
+
+.
+ In JKB the two shape parameters
+\begin_inset Formula $b,a$
+\end_inset
+
+ are reduced to the single shape-parameter
+\begin_inset Formula $c=b/a$
+\end_inset
+
+.
+ As
+\begin_inset Formula $a$
+\end_inset
+
+ is just a scale parameter when
+\begin_inset Formula $a\neq0$
+\end_inset
+
+.
+ If
+\begin_inset Formula $a=0,$
+\end_inset
+
+ the distribution reduces to the exponential distribution scaled by
+\begin_inset Formula $1/b.$
+\end_inset
+
+ Thus, the standard form is given as
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & ce^{x}\exp\left[-c\left(e^{x}-1\right)\right]\\
+F\left(x;c\right) & = & 1-\exp\left[-c\left(e^{x}-1\right)\right]\\
+G\left(q;c\right) & = & \log\left[1-\frac{1}{c}\log\left(1-q\right)\right]\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=1-\log\left(c\right)-e^{c}\textrm{Ei}\left(1,c\right),\]
+
+\end_inset
+
+where
+\begin_inset Formula \[
+\textrm{Ei}\left(n,x\right)=\int_{1}^{\infty}t^{-n}\exp\left(-xt\right)dt\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Gumbel (LogWeibull, Fisher-Tippetts, Type I Extreme Value)
+\end_layout
+
+\begin_layout Standard
+One of a clase of extreme value distributions (right-skewed).
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \exp\left(-\left(x+e^{-x}\right)\right)\\
+F\left(x\right) & = & \exp\left(-e^{-x}\right)\\
+G\left(q\right) & = & -\log\left(-\log\left(q\right)\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\Gamma\left(1-t\right)\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \gamma=-\psi_{0}\left(1\right)\\
+\mu_{2} & = & \frac{\pi^{2}}{6}\\
+\gamma_{1} & = & \frac{12\sqrt{6}}{\pi^{3}}\zeta\left(3\right)\\
+\gamma_{2} & = & \frac{12}{5}\\
+m_{d} & = & 0\\
+m_{n} & = & -\log\left(\log2\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]\approx1.0608407169541684911\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Gumbel Left-skewed (for minimum order statistic)
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \exp\left(x-e^{x}\right)\\
+F\left(x\right) & = & 1-\exp\left(-e^{x}\right)\\
+G\left(q\right) & = & \log\left(-\log\left(1-q\right)\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\Gamma\left(1+t\right)\]
+
+\end_inset
+
+ Note, that
+\begin_inset Formula $\mu$
+\end_inset
+
+ is negative the mean for the right-skewed distribution.
+ Similar for median and mode.
+ All other moments are the same.
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]\approx1.0608407169541684911.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+HalfCauchy
+\end_layout
+
+\begin_layout Standard
+If
+\begin_inset Formula $Z$
+\end_inset
+
+ is Hyperbolic Secant distributed then
+\begin_inset Formula $e^{Z}$
+\end_inset
+
+ is Half-Cauchy distributed.
+ Also, if
+\begin_inset Formula $W$
+\end_inset
+
+ is (standard) Cauchy distributed, then
+\begin_inset Formula $\left|W\right|$
+\end_inset
+
+ is Half-Cauchy distributed.
+ Special case of the Folded Cauchy distribution with
+\begin_inset Formula $c=0.$
+\end_inset
+
+ The standard form is
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{2}{\pi\left(1+x^{2}\right)}I_{[0,\infty)}\left(x\right)\\
+F\left(x\right) & = & \frac{2}{\pi}\arctan\left(x\right)I_{\left[0,\infty\right]}\left(x\right)\\
+G\left(q\right) & = & \tan\left(\frac{\pi}{2}q\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\cos t+\frac{2}{\pi}\left[\textrm{Si}\left(t\right)\cos t-\textrm{Ci}\left(\textrm{-}t\right)\sin t\right]\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+m_{d} & = & 0\\
+m_{n} & = & \tan\left(\frac{\pi}{4}\right)\end{eqnarray*}
+
+\end_inset
+
+ No moments, as the integrals diverge.
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+h\left[X\right] & = & \log\left(2\pi\right)\\
+ & \approx & 1.8378770664093454836.\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+HalfNormal
+\end_layout
+
+\begin_layout Standard
+This is a special case of the chi distribution with
+\begin_inset Formula $L=a$
+\end_inset
+
+ and
+\begin_inset Formula $S=b$
+\end_inset
+
+ and
+\begin_inset Formula $\nu=1.$
+\end_inset
+
+ This is also a special case of the folded normal with shape parameter
+\begin_inset Formula $c=0$
+\end_inset
+
+ and
+\begin_inset Formula $S=S.$
+\end_inset
+
+ If
+\begin_inset Formula $Z$
+\end_inset
+
+ is (standard) normally distributed then,
+\begin_inset Formula $\left|Z\right|$
+\end_inset
+
+ is half-normal.
+ The standard form is
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \sqrt{\frac{2}{\pi}}e^{-x^{2}/2}I_{\left(0,\infty\right)}\left(x\right)\\
+F\left(x\right) & = & 2\Phi\left(x\right)-1\\
+G\left(q\right) & = & \Phi^{-1}\left(\frac{1+q}{2}\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\sqrt{2\pi}e^{t^{2}/2}\Phi\left(t\right)\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \sqrt{\frac{2}{\pi}}\\
+\mu_{2} & = & 1-\frac{2}{\pi}\\
+\gamma_{1} & = & \frac{\sqrt{2}\left(4-\pi\right)}{\left(\pi-2\right)^{3/2}}\\
+\gamma_{2} & = & \frac{8\left(\pi-3\right)}{\left(\pi-2\right)^{2}}\\
+m_{d} & = & 0\\
+m_{n} & = & \Phi^{-1}\left(\frac{3}{4}\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+h\left[X\right] & = & \log\left(\sqrt{\frac{\pi e}{2}}\right)\\
+ & \approx & 0.72579135264472743239.\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Half-Logistic
+\end_layout
+
+\begin_layout Standard
+In the limit as
+\begin_inset Formula $c\rightarrow\infty$
+\end_inset
+
+ for the generalized half-logistic we have the half-logistic defined over
+
+\begin_inset Formula $x\geq0.$
+\end_inset
+
+ Also, the distribution of
+\begin_inset Formula $\left|X\right|$
+\end_inset
+
+ where
+\begin_inset Formula $X$
+\end_inset
+
+ has logistic distribtution.
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{2e^{-x}}{\left(1+e^{-x}\right)^{2}}=\frac{1}{2}\textrm{sech}^{2}\left(\frac{x}{2}\right)\\
+F\left(x\right) & = & \frac{1-e^{-x}}{1+e^{-x}}=\tanh\left(\frac{x}{2}\right)\\
+G\left(q\right) & = & \log\left(\frac{1+q}{1-q}\right)=2\textrm{arctanh}\left(q\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+M\left(t\right)=1-t\psi_{0}\left(\frac{1}{2}-\frac{t}{2}\right)+t\psi_{0}\left(1-\frac{t}{2}\right)\]
+
+\end_inset
+
+
+\begin_inset Formula \[
+\mu_{n}^{\prime}=2\left(1-2^{1-n}\right)n!\zeta\left(n\right)\quad n\neq1\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu_{1}^{\prime} & = & 2\log\left(2\right)\\
+\mu_{2}^{\prime} & = & 2\zeta\left(2\right)=\frac{\pi^{2}}{3}\\
+\mu_{3}^{\prime} & = & 9\zeta\left(3\right)\\
+\mu_{4}^{\prime} & = & 42\zeta\left(4\right)=\frac{7\pi^{4}}{15}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+h\left[X\right] & = & 2-\log\left(2\right)\\
+ & \approx & 1.3068528194400546906.\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Hyperbolic Secant
+\end_layout
+
+\begin_layout Standard
+Related to the logistic distribution and used in lifetime analysis.
+ Standard form is (defined over all
+\begin_inset Formula $x$
+\end_inset
+
+)
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{1}{\pi}\textrm{sech}\left(x\right)\\
+F\left(x\right) & = & \frac{2}{\pi}\arctan\left(e^{x}\right)\\
+G\left(q\right) & = & \log\left(\tan\left(\frac{\pi}{2}q\right)\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\sec\left(\frac{\pi}{2}t\right)\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu_{n}^{\prime} & = & \frac{1+\left(-1\right)^{n}}{2\pi2^{2n}}n!\left[\zeta\left(n+1,\frac{1}{4}\right)-\zeta\left(n+1,\frac{3}{4}\right)\right]\\
+ & = & \left\{ \begin{array}{cc}
+0 & n\textrm{ odd}\\
+C_{n/2}\frac{\pi^{n}}{2^{n}} & n\textrm{ even}\end{array}\right.\end{eqnarray*}
+
+\end_inset
+
+ where
+\begin_inset Formula $C_{m}$
+\end_inset
+
+ is an integer given by
+\begin_inset Formula \begin{eqnarray*}
+C_{m} & = & \frac{\left(2m\right)!\left[\zeta\left(2m+1,\frac{1}{4}\right)-\zeta\left(2m+1,\frac{3}{4}\right)\right]}{\pi^{2m+1}2^{2m}}\\
+ & = & 4\left(-1\right)^{m-1}\frac{16^{m}}{2m+1}B_{2m+1}\left(\frac{1}{4}\right)\end{eqnarray*}
+
+\end_inset
+
+where
+\begin_inset Formula $B_{2m+1}\left(\frac{1}{4}\right)$
+\end_inset
+
+ is the Bernoulli polynomial of order
+\begin_inset Formula $2m+1$
+\end_inset
+
+ evaluated at
+\begin_inset Formula $1/4.$
+\end_inset
+
+ Thus
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\left\{ \begin{array}{cc}
+0 & n\textrm{ odd}\\
+4\left(-1\right)^{n/2-1}\frac{\left(2\pi\right)^{n}}{n+1}B_{n+1}\left(\frac{1}{4}\right) & n\textrm{ even}\end{array}\right.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+m_{d}=m_{n}=\mu & = & 0\\
+\mu_{2} & = & \frac{\pi^{2}}{4}\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & 2\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=\log\left(2\pi\right).\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Gauss Hypergeometric
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula $x\in\left[0,1\right]$
+\end_inset
+
+,
+\begin_inset Formula $\alpha>0,\,\beta>0$
+\end_inset
+
+
+\begin_inset Formula \[
+C^{-1}=B\left(\alpha,\beta\right)\,_{2}F_{1}\left(\gamma,\alpha;\alpha+\beta;-z\right)\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\alpha,\beta,\gamma,z\right) & = & Cx^{\alpha-1}\frac{\left(1-x\right)^{\beta-1}}{\left(1+zx\right)^{\gamma}}\\
+\mu_{n}^{\prime} & = & \frac{B\left(n+\alpha,\beta\right)}{B\left(\alpha,\beta\right)}\frac{\,_{2}F_{1}\left(\gamma,\alpha+n;\alpha+\beta+n;-z\right)}{\,_{2}F_{1}\left(\gamma,\alpha;\alpha+\beta;-z\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Inverted Gamma
+\end_layout
+
+\begin_layout Standard
+Special case of the generalized Gamma distribution with
+\begin_inset Formula $c=-1$
+\end_inset
+
+ and
+\begin_inset Formula $a>0$
+\end_inset
+
+,
+\begin_inset Formula $x>0$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;a\right) & = & \frac{x^{-a-1}}{\Gamma\left(a\right)}\exp\left(-\frac{1}{x}\right)\\
+F\left(x;a\right) & = & \frac{\Gamma\left(a,\frac{1}{x}\right)}{\Gamma\left(a\right)}\\
+G\left(q;a\right) & = & \left\{ \Gamma^{-1}\left[a,\Gamma\left(a\right)q\right]\right\} ^{-1}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\frac{\Gamma\left(a-n\right)}{\Gamma\left(a\right)}\quad a>n\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{1}{a-1}\quad a>1\\
+\mu_{2} & = & \frac{1}{\left(a-2\right)\left(a-1\right)}-\mu^{2}\quad a>2\\
+\gamma_{1} & = & \frac{\frac{1}{\left(a-3\right)\left(a-2\right)\left(a-1\right)}-3\mu\mu_{2}-\mu^{3}}{\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{\frac{1}{\left(a-4\right)\left(a-3\right)\left(a-2\right)\left(a-1\right)}-4\mu\mu_{3}-6\mu^{2}\mu_{2}-\mu^{4}}{\mu_{2}^{2}}-3\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+m_{d}=\frac{1}{a+1}\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=a-\left(a+1\right)\Psi\left(a\right)+\log\Gamma\left(a\right).\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Inverse Normal (Inverse Gaussian)
+\end_layout
+
+\begin_layout Standard
+The standard form involves the shape parameter
+\begin_inset Formula $\mu$
+\end_inset
+
+ (in most definitions,
+\begin_inset Formula $L=0.0$
+\end_inset
+
+ is used).
+ (In terms of the regress documentation
+\begin_inset Formula $\mu=A/B$
+\end_inset
+
+) and
+\begin_inset Formula $B=S$
+\end_inset
+
+ and
+\begin_inset Formula $L$
+\end_inset
+
+ is not a parameter in that distribution.
+ A standard form is
+\begin_inset Formula $x>0$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\mu\right) & = & \frac{1}{\sqrt{2\pi x^{3}}}\exp\left(-\frac{\left(x-\mu\right)^{2}}{2x\mu^{2}}\right).\\
+F\left(x;\mu\right) & = & \Phi\left(\frac{1}{\sqrt{x}}\frac{x-\mu}{\mu}\right)+\exp\left(\frac{2}{\mu}\right)\Phi\left(-\frac{1}{\sqrt{x}}\frac{x+\mu}{\mu}\right)\\
+G\left(q;\mu\right) & = & F^{-1}\left(q;\mu\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \mu\\
+\mu_{2} & = & \mu^{3}\\
+\gamma_{1} & = & 3\sqrt{\mu}\\
+\gamma_{2} & = & 15\mu\\
+m_{d} & = & \frac{\mu}{2}\left(\sqrt{9\mu^{2}+4}-3\mu\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+This is related to the canonical form or JKB
+\begin_inset Quotes eld
+\end_inset
+
+two-parameter
+\begin_inset Quotes erd
+\end_inset
+
+ inverse Gaussian when written in it's full form with scale parameter
+\begin_inset Formula $S$
+\end_inset
+
+ and location parameter
+\begin_inset Formula $L$
+\end_inset
+
+ by taking
+\begin_inset Formula $L=0$
+\end_inset
+
+ and
+\begin_inset Formula $S\equiv\lambda,$
+\end_inset
+
+ then
+\begin_inset Formula $\mu S$
+\end_inset
+
+ is equal to
+\begin_inset Formula $\mu_{2}$
+\end_inset
+
+ where
+\begin_inset Formula $\mu_{2}$
+\end_inset
+
+ is the parameter used by JKB.
+ We prefer this form because of it's consistent use of the scale parameter.
+ Notice that in JKB the skew
+\begin_inset Formula $\left(\sqrt{\beta_{1}}\right)$
+\end_inset
+
+ and the kurtosis (
+\begin_inset Formula $\beta_{2}-3$
+\end_inset
+
+) are both functions only of
+\begin_inset Formula $\mu_{2}/\lambda=\mu S/S=\mu$
+\end_inset
+
+ as shown here, while the variance and mean of the standard form here are
+ transformed appropriately.
+
+\end_layout
+
+\begin_layout Section
+Inverted Weibull
+\end_layout
+
+\begin_layout Standard
+Shape parameter
+\begin_inset Formula $c>0$
+\end_inset
+
+ and
+\begin_inset Formula $x>0$
+\end_inset
+
+.
+ Then
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & cx^{-c-1}\exp\left(-x^{-c}\right)\\
+F\left(x;c\right) & = & \exp\left(-x^{-c}\right)\\
+G\left(q;c\right) & = & \left(-\log q\right)^{-1/c}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=1+\gamma+\frac{\gamma}{c}-\log\left(c\right)\]
+
+\end_inset
+
+ where
+\begin_inset Formula $\gamma$
+\end_inset
+
+ is Euler's constant.
+\end_layout
+
+\begin_layout Section
+Johnson SB
+\end_layout
+
+\begin_layout Standard
+Defined for
+\begin_inset Formula $x\in\left(0,1\right)$
+\end_inset
+
+ with two shape parameters
+\begin_inset Formula $a$
+\end_inset
+
+ and
+\begin_inset Formula $b>0.$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;a,b\right) & = & \frac{b}{x\left(1-x\right)}\phi\left(a+b\log\frac{x}{1-x}\right)\\
+F\left(x;a,b\right) & = & \Phi\left(a+b\log\frac{x}{1-x}\right)\\
+G\left(q;a,b\right) & = & \frac{1}{1+\exp\left[-\frac{1}{b}\left(\Phi^{-1}\left(q\right)-a\right)\right]}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Johnson SU
+\end_layout
+
+\begin_layout Standard
+Defined for all
+\begin_inset Formula $x$
+\end_inset
+
+ with two shape parameters
+\begin_inset Formula $a$
+\end_inset
+
+ and
+\begin_inset Formula $b>0$
+\end_inset
+
+.
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;a,b\right) & = & \frac{b}{\sqrt{x^{2}+1}}\phi\left(a+b\log\left(x+\sqrt{x^{2}+1}\right)\right)\\
+F\left(x;a,b\right) & = & \Phi\left(a+b\log\left(x+\sqrt{x^{2}+1}\right)\right)\\
+G\left(q;a,b\right) & = & \sinh\left[\frac{\Phi^{-1}\left(q\right)-a}{b}\right]\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+KSone
+\end_layout
+
+\begin_layout Section
+KStwo
+\end_layout
+
+\begin_layout Section
+Laplace (Double Exponential, Bilateral Expoooonential)
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{1}{2}e^{-\left|x\right|}\\
+F\left(x\right) & = & \left\{ \begin{array}{ccc}
+\frac{1}{2}e^{x} & & x\leq0\\
+1-\frac{1}{2}e^{-x} & & x>0\end{array}\right.\\
+G\left(q\right) & = & \left\{ \begin{array}{ccc}
+\log\left(2q\right) & & q\leq\frac{1}{2}\\
+-\log\left(2-2q\right) & & q>\frac{1}{2}\end{array}\right.\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+m_{d}=m_{n}=\mu & = & 0\\
+\mu_{2} & = & 2\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & 3\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The ML estimator of the location parameter is
+\begin_inset Formula \[
+\hat{L}=\textrm{median}\left(X_{i}\right)\]
+
+\end_inset
+
+ where
+\begin_inset Formula $X_{i}$
+\end_inset
+
+ is a sequence of
+\begin_inset Formula $N$
+\end_inset
+
+ mutually independent Laplace RV's and the median is some number between
+ the
+\begin_inset Formula $\frac{1}{2}N\textrm{th}$
+\end_inset
+
+ and the
+\begin_inset Formula $(N/2+1)\textrm{th}$
+\end_inset
+
+ order statistic (
+\emph on
+e.g.
+
+\emph default
+ take the average of these two) when
+\begin_inset Formula $N$
+\end_inset
+
+ is even.
+ Also,
+\begin_inset Formula \[
+\hat{S}=\frac{1}{N}\sum_{j=1}^{N}\left|X_{j}-\hat{L}\right|.\]
+
+\end_inset
+
+ Replace
+\begin_inset Formula $\hat{L}$
+\end_inset
+
+ with
+\begin_inset Formula $L$
+\end_inset
+
+ if it is known.
+ If
+\begin_inset Formula $L$
+\end_inset
+
+ is known then this estimator is distributed as
+\begin_inset Formula $\left(2N\right)^{-1}S\cdot\chi_{2N}^{2}$
+\end_inset
+
+.
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+h\left[X\right] & = & \log\left(2e\right)\\
+ & \approx & 1.6931471805599453094.\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Left-skewed L?vy
+\end_layout
+
+\begin_layout Standard
+Special case of L?vy-stable distribution with
+\begin_inset Formula $\alpha=\frac{1}{2}$
+\end_inset
+
+ and
+\begin_inset Formula $\beta=-1$
+\end_inset
+
+ the support is
+\begin_inset Formula $x<0$
+\end_inset
+
+.
+ In standard form
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{1}{\left|x\right|\sqrt{2\pi\left|x\right|}}\exp\left(-\frac{1}{2\left|x\right|}\right)\\
+F\left(x\right) & = & 2\Phi\left(\frac{1}{\sqrt{\left|x\right|}}\right)-1\\
+G\left(q\right) & = & -\left[\Phi^{-1}\left(\frac{q+1}{2}\right)\right]^{-2}.\end{eqnarray*}
+
+\end_inset
+
+No moments.
+\end_layout
+
+\begin_layout Section
+L?vy
+\end_layout
+
+\begin_layout Standard
+A special case of L?vy-stable distributions with
+\begin_inset Formula $\alpha=\frac{1}{2}$
+\end_inset
+
+ and
+\begin_inset Formula $\beta=1$
+\end_inset
+
+.
+ In standard form it is defined for
+\begin_inset Formula $x>0$
+\end_inset
+
+ as
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{1}{x\sqrt{2\pi x}}\exp\left(-\frac{1}{2x}\right)\\
+F\left(x\right) & = & 2\left[1-\Phi\left(\frac{1}{\sqrt{x}}\right)\right]\\
+G\left(q\right) & = & \left[\Phi^{-1}\left(1-\frac{q}{2}\right)\right]^{-2}.\end{eqnarray*}
+
+\end_inset
+
+ It has no finite moments.
+\end_layout
+
+\begin_layout Section
+Logistic (Sech-squared)
+\end_layout
+
+\begin_layout Standard
+A special case of the Generalized Logistic distribution with
+\begin_inset Formula $c=1.$
+\end_inset
+
+ Defined for
+\begin_inset Formula $x>0$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{\exp\left(-x\right)}{\left[1+\exp\left(-x\right)\right]^{2}}\\
+F\left(x\right) & = & \frac{1}{1+\exp\left(-x\right)}\\
+G\left(q\right) & = & -\log\left(1/q-1\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \gamma+\psi_{0}\left(1\right)=0\\
+\mu_{2} & = & \frac{\pi^{2}}{6}+\psi_{1}\left(1\right)=\frac{\pi^{2}}{3}\\
+\gamma_{1} & = & \frac{\psi_{2}\left(c\right)+2\zeta\left(3\right)}{\mu_{2}^{3/2}}=0\\
+\gamma_{2} & = & \frac{\left(\frac{\pi^{4}}{15}+\psi_{3}\left(c\right)\right)}{\mu_{2}^{2}}=\frac{6}{5}\\
+m_{d} & = & \log1=0\\
+m_{n} & = & -\log\left(2-1\right)=0\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=1.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Log Double Exponential (Log-Laplace)
+\end_layout
+
+\begin_layout Standard
+Defined over
+\begin_inset Formula $x>0$
+\end_inset
+
+ with
+\begin_inset Formula $c>0$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \left\{ \begin{array}{ccc}
+\frac{c}{2}x^{c-1} & & 00$
+\end_inset
+
+ (Defined for all
+\begin_inset Formula $x$
+\end_inset
+
+)
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \frac{\exp\left(cx-e^{x}\right)}{\Gamma\left(c\right)}\\
+F\left(x;c\right) & = & \frac{\Gamma\left(c,e^{x}\right)}{\Gamma\left(c\right)}\\
+G\left(q;c\right) & = & \log\left[\Gamma^{-1}\left[c,q\Gamma\left(c\right)\right]\right]\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\int_{0}^{\infty}\left[\log y\right]^{n}y^{c-1}\exp\left(-y\right)dy.\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \mu_{1}^{\prime}\\
+\mu_{2} & = & \mu_{2}^{\prime}-\mu^{2}\\
+\gamma_{1} & = & \frac{\mu_{3}^{\prime}-3\mu\mu_{2}-\mu^{3}}{\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{\mu_{4}^{\prime}-4\mu\mu_{3}-6\mu^{2}\mu_{2}-\mu^{4}}{\mu_{2}^{2}}-3\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Log Normal (Cobb-Douglass)
+\end_layout
+
+\begin_layout Standard
+Has one shape parameter
+\begin_inset Formula $\sigma$
+\end_inset
+
+>0.
+ (Notice that the
+\begin_inset Quotes eld
+\end_inset
+
+Regress
+\begin_inset Quotes erd
+\end_inset
+
+
+\begin_inset Formula $A=\log S$
+\end_inset
+
+ where
+\begin_inset Formula $S$
+\end_inset
+
+ is the scale parameter and
+\begin_inset Formula $A$
+\end_inset
+
+ is the mean of the underlying normal distribution).
+ The standard form is
+\begin_inset Formula $x>0$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\sigma\right) & = & \frac{1}{\sigma x\sqrt{2\pi}}\exp\left[-\frac{1}{2}\left(\frac{\log x}{\sigma}\right)^{2}\right]\\
+F\left(x;\sigma\right) & = & \Phi\left(\frac{\log x}{\sigma}\right)\\
+G\left(q;\sigma\right) & = & \exp\left\{ \sigma\Phi^{-1}\left(q\right)\right\} \end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \exp\left(\sigma^{2}/2\right)\\
+\mu_{2} & = & \exp\left(\sigma^{2}\right)\left[\exp\left(\sigma^{2}\right)-1\right]\\
+\gamma_{1} & = & \sqrt{p-1}\left(2+p\right)\\
+\gamma_{2} & = & p^{4}+2p^{3}+3p^{2}-6\quad\quad p=e^{\sigma^{2}}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Notice that using JKB notation we have
+\begin_inset Formula $\theta=L,$
+\end_inset
+
+
+\begin_inset Formula $\zeta=\log S$
+\end_inset
+
+ and we have given the so-called antilognormal form of the distribution.
+ This is more consistent with the location, scale parameter description
+ of general probability distributions.
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=\frac{1}{2}\left[1+\log\left(2\pi\right)+2\log\left(\sigma\right)\right].\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Also, note that if
+\begin_inset Formula $X$
+\end_inset
+
+ is a log-normally distributed random-variable with
+\begin_inset Formula $L=0$
+\end_inset
+
+ and
+\begin_inset Formula $S$
+\end_inset
+
+ and shape parameter
+\begin_inset Formula $\sigma.$
+\end_inset
+
+ Then,
+\begin_inset Formula $\log X$
+\end_inset
+
+ is normally distributed with variance
+\begin_inset Formula $\sigma^{2}$
+\end_inset
+
+ and mean
+\begin_inset Formula $\log S.$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Nakagami
+\end_layout
+
+\begin_layout Standard
+Generalization of the chi distribution.
+ Shape parameter is
+\begin_inset Formula $\nu>0.$
+\end_inset
+
+ Defined for
+\begin_inset Formula $x>0.$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\nu\right) & = & \frac{2\nu^{\nu}}{\Gamma\left(\nu\right)}x^{2\nu-1}\exp\left(-\nu x^{2}\right)\\
+F\left(x;\nu\right) & = & \Gamma\left(\nu,\nu x^{2}\right)\\
+G\left(q;\nu\right) & = & \sqrt{\frac{1}{\nu}\Gamma^{-1}\left(v,q\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{\Gamma\left(\nu+\frac{1}{2}\right)}{\sqrt{\nu}\Gamma\left(\nu\right)}\\
+\mu_{2} & = & \left[1-\mu^{2}\right]\\
+\gamma_{1} & = & \frac{\mu\left(1-4v\mu_{2}\right)}{2\nu\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{-6\mu^{4}\nu+\left(8\nu-2\right)\mu^{2}-2\nu+1}{\nu\mu_{2}^{2}}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Noncentral beta*
+\end_layout
+
+\begin_layout Standard
+Defined over
+\begin_inset Formula $x\in\left[0,1\right]$
+\end_inset
+
+ with
+\begin_inset Formula $a>0$
+\end_inset
+
+ and
+\begin_inset Formula $b>0$
+\end_inset
+
+ and
+\begin_inset Formula $c\geq0$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+F\left(x;a,b,c\right)=\sum_{j=0}^{\infty}\frac{e^{-c/2}\left(\frac{c}{2}\right)^{j}}{j!}I_{B}\left(a+j,b;0\right)\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Noncentral chi*
+\end_layout
+
+\begin_layout Section
+Noncentral chi-squared
+\end_layout
+
+\begin_layout Standard
+The distribution of
+\begin_inset Formula $\sum_{i=1}^{\nu}\left(Z_{i}+\delta_{i}\right)^{2}$
+\end_inset
+
+ where
+\begin_inset Formula $Z_{i}$
+\end_inset
+
+ are independent standard normal variables and
+\begin_inset Formula $\delta_{i}$
+\end_inset
+
+ are constants.
+
+\begin_inset Formula $\lambda=\sum_{i=1}^{\nu}\delta_{i}^{2}>0.$
+\end_inset
+
+ (In communications it is called the Marcum-Q function).
+ Can be thought of as a Generalized Rayleigh-Rice distribution.
+ For
+\begin_inset Formula $x>0$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\nu,\lambda\right) & = & e^{-\left(\lambda+x\right)/2}\frac{1}{2}\left(\frac{x}{\lambda}\right)^{\left(\nu-2\right)/4}I_{\left(\nu-2\right)/2}\left(\sqrt{\lambda x}\right)\\
+F\left(x;\nu,\lambda\right) & = & \sum_{j=0}^{\infty}\left\{ \frac{\left(\lambda/2\right)^{j}}{j!}e^{-\lambda/2}\right\} \textrm{Pr}\left[\chi_{\nu+2j}^{2}\leq x\right]\\
+G\left(q;\nu,\lambda\right) & = & F^{-1}\left(x;\nu,\lambda\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \nu+\lambda\\
+\mu_{2} & = & 2\left(\nu+2\lambda\right)\\
+\gamma_{1} & = & \frac{\sqrt{8}\left(\nu+3\lambda\right)}{\left(\nu+2\lambda\right)^{3/2}}\\
+\gamma_{2} & = & \frac{12\left(\nu+4\lambda\right)}{\left(\nu+2\lambda\right)^{2}}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Noncentral F
+\end_layout
+
+\begin_layout Standard
+Let
+\begin_inset Formula $\lambda>0$
+\end_inset
+
+ and
+\begin_inset Formula $\nu_{1}>0$
+\end_inset
+
+ and
+\begin_inset Formula $\nu_{2}>0.$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\lambda,\nu_{1},\nu_{2}\right) & = & \exp\left[\frac{\lambda}{2}+\frac{\left(\lambda\nu_{1}x\right)}{2\left(\nu_{1}x+\nu_{2}\right)}\right]\nu_{1}^{\nu_{1}/2}\nu_{2}^{\nu_{2}/2}x^{\nu_{1}/2-1}\\
+ & & \times\left(\nu_{2}+\nu_{1}x\right)^{-\left(\nu_{1}+\nu_{2}\right)/2}\frac{\Gamma\left(\frac{\nu_{1}}{2}\right)\Gamma\left(1+\frac{\nu_{2}}{2}\right)L_{\nu_{2}/2}^{\nu_{1}/2-1}\left(-\frac{\lambda\nu_{1}x}{2\left(\nu_{1}x+\nu_{2}\right)}\right)}{B\left(\frac{\nu_{1}}{2},\frac{\nu_{2}}{2}\right)\Gamma\left(\frac{\nu_{1}+\nu_{2}}{2}\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Noncentral t
+\end_layout
+
+\begin_layout Standard
+The distribution of the ratio
+\begin_inset Formula \[
+\frac{U+\lambda}{\chi_{\nu}/\sqrt{\nu}}\]
+
+\end_inset
+
+ where
+\begin_inset Formula $U$
+\end_inset
+
+ and
+\begin_inset Formula $\chi_{\nu}$
+\end_inset
+
+ are independent and distributed as a standard normal and chi with
+\begin_inset Formula $\nu$
+\end_inset
+
+ degrees of freedom.
+ Note
+\begin_inset Formula $\lambda>0$
+\end_inset
+
+ and
+\begin_inset Formula $\nu>0$
+\end_inset
+
+.
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\lambda,\nu\right) & = & \frac{\nu^{\nu/2}\Gamma\left(\nu+1\right)}{2^{\nu}e^{\lambda^{2}/2}\left(\nu+x^{2}\right)^{\nu/2}\Gamma\left(\nu/2\right)}\\
+ & & \times\left\{ \frac{\sqrt{2}\lambda x\,_{1}F_{1}\left(\frac{\nu}{2}+1;\frac{3}{2};\frac{\lambda^{2}x^{2}}{2\left(\nu+x^{2}\right)}\right)}{\left(\nu+x^{2}\right)\Gamma\left(\frac{\nu+1}{2}\right)}\right.\\
+ & & -\left.\frac{\,_{1}F_{1}\left(\frac{\nu+1}{2};\frac{1}{2};\frac{\lambda^{2}x^{2}}{2\left(\nu+x^{2}\right)}\right)}{\sqrt{\nu+x^{2}}\Gamma\left(\frac{\nu}{2}+1\right)}\right\} \\
+ & = & \frac{\Gamma\left(\nu+1\right)}{2^{\left(\nu-1\right)/2}\sqrt{\pi\nu}\Gamma\left(\nu/2\right)}\exp\left[-\frac{\nu\lambda^{2}}{\nu+x^{2}}\right]\\
+ & & \times\left(\frac{\nu}{\nu+x^{2}}\right)^{\left(\nu-1\right)/2}Hh_{\nu}\left(-\frac{\lambda x}{\sqrt{\nu+x^{2}}}\right)\\
+F\left(x;\lambda,\nu\right) & =\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Normal
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{e^{-x^{2}/2}}{\sqrt{2\pi}}\\
+F\left(x\right) & = & \Phi\left(x\right)=\frac{1}{2}+\frac{1}{2}\textrm{erf}\left(\frac{\textrm{x}}{\sqrt{2}}\right)\\
+G\left(q\right) & = & \Phi^{-1}\left(q\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Formula \begin{eqnarray*}
+m_{d}=m_{n}=\mu & = & 0\\
+\mu_{2} & = & 1\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & 0\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+h\left[X\right] & = & \log\left(\sqrt{2\pi e}\right)\\
+ & \approx & 1.4189385332046727418\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Maxwell
+\end_layout
+
+\begin_layout Standard
+This is a special case of the Chi distribution with
+\begin_inset Formula $L=0$
+\end_inset
+
+ and
+\begin_inset Formula $S=S=\frac{1}{\sqrt{a}}$
+\end_inset
+
+ and
+\begin_inset Formula $\nu=3.$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \sqrt{\frac{2}{\pi}}x^{2}e^{-x^{2}/2}I_{\left(0,\infty\right)}\left(x\right)\\
+F\left(x\right) & = & \Gamma\left(\frac{3}{2},\frac{x^{2}}{2}\right)\\
+G\left(\alpha\right) & = & \sqrt{2\Gamma^{-1}\left(\frac{3}{2},\alpha\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & 2\sqrt{\frac{2}{\pi}}\\
+\mu_{2} & = & 3-\frac{8}{\pi}\\
+\gamma_{1} & = & \sqrt{2}\frac{32-10\pi}{\left(3\pi-8\right)^{3/2}}\\
+\gamma_{2} & = & \frac{-12\pi^{2}+160\pi-384}{\left(3\pi-8\right)^{2}}\\
+m_{d} & = & \sqrt{2}\\
+m_{n} & = & \sqrt{2\Gamma^{-1}\left(\frac{3}{2},\frac{1}{2}\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=\log\left(\sqrt{\frac{2\pi}{e}}\right)+\gamma.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Mielke's Beta-Kappa
+\end_layout
+
+\begin_layout Standard
+A generalized F distribution.
+ Two shape parameters
+\begin_inset Formula $\kappa$
+\end_inset
+
+ and
+\begin_inset Formula $\theta$
+\end_inset
+
+, and
+\begin_inset Formula $x>0$
+\end_inset
+
+.
+ The
+\begin_inset Formula $\beta$
+\end_inset
+
+ in the DATAPLOT reference is a scale parameter.
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\kappa,\theta\right) & = & \frac{\kappa x^{\kappa-1}}{\left(1+x^{\theta}\right)^{1+\frac{\kappa}{\theta}}}\\
+F\left(x;\kappa,\theta\right) & = & \frac{x^{\kappa}}{\left(1+x^{\theta}\right)^{\kappa/\theta}}\\
+G\left(q;\kappa,\theta\right) & = & \left(\frac{q^{\theta/\kappa}}{1-q^{\theta/\kappa}}\right)^{1/\theta}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Pareto
+\end_layout
+
+\begin_layout Standard
+For
+\begin_inset Formula $x\geq1$
+\end_inset
+
+ and
+\begin_inset Formula $b>0$
+\end_inset
+
+.
+ Standard form is
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;b\right) & = & \frac{b}{x^{b+1}}\\
+F\left(x;b\right) & = & 1-\frac{1}{x^{b}}\\
+G\left(q;b\right) & = & \left(1-q\right)^{-1/b}\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{b}{b-1}\quad b>1\\
+\mu_{2} & = & \frac{b}{\left(b-2\right)\left(b-1\right)^{2}}\quad b>2\\
+\gamma_{1} & = & \frac{2\left(b+1\right)\sqrt{b-2}}{\left(b-3\right)\sqrt{b}}\quad b>3\\
+\gamma_{2} & = & \frac{6\left(b^{3}+b^{2}-6b-2\right)}{b\left(b^{2}-7b+12\right)}\quad b>4\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left(X\right)=\frac{1}{c}+1-\log\left(c\right)\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Pareto Second Kind (Lomax)
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula $c>0.$
+\end_inset
+
+ This is Pareto of the first kind with
+\begin_inset Formula $L=-1.0$
+\end_inset
+
+ so
+\begin_inset Formula $x\geq0$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \frac{c}{\left(1+x\right)^{c+1}}\\
+F\left(x;c\right) & = & 1-\frac{1}{\left(1+x\right)^{c}}\\
+G\left(q;c\right) & = & \left(1-q\right)^{-1/c}-1\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=\frac{1}{c}+1-\log\left(c\right).\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Power Log Normal
+\end_layout
+
+\begin_layout Standard
+A generalization of the log-normal distribution
+\begin_inset Formula $\sigma>0$
+\end_inset
+
+ and
+\begin_inset Formula $c>0$
+\end_inset
+
+ and
+\begin_inset Formula $x>0$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\sigma,c\right) & = & \frac{c}{x\sigma}\phi\left(\frac{\log x}{\sigma}\right)\left(\Phi\left(-\frac{\log x}{\sigma}\right)\right)^{c-1}\\
+F\left(x;\sigma,c\right) & = & 1-\left(\Phi\left(-\frac{\log x}{\sigma}\right)\right)^{c}\\
+G\left(q;\sigma,c\right) & = & \exp\left[-\sigma\Phi^{-1}\left[\left(1-q\right)^{1/c}\right]\right]\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\int_{0}^{1}\exp\left[-n\sigma\Phi^{-1}\left(y^{1/c}\right)\right]dy\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \mu_{1}^{\prime}\\
+\mu_{2} & = & \mu_{2}^{\prime}-\mu^{2}\\
+\gamma_{1} & = & \frac{\mu_{3}^{\prime}-3\mu\mu_{2}-\mu^{3}}{\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{\mu_{4}^{\prime}-4\mu\mu_{3}-6\mu^{2}\mu_{2}-\mu^{4}}{\mu_{2}^{2}}-3\end{eqnarray*}
+
+\end_inset
+
+ This distribution reduces to the log-normal distribution when
+\begin_inset Formula $c=1.$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Power Normal
+\end_layout
+
+\begin_layout Standard
+A generalization of the normal distribution,
+\begin_inset Formula $c>0$
+\end_inset
+
+ for
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & c\phi\left(x\right)\left(\Phi\left(-x\right)\right)^{c-1}\\
+F\left(x;c\right) & = & 1-\left(\Phi\left(-x\right)\right)^{c}\\
+G\left(q;c\right) & = & -\Phi^{-1}\left[\left(1-q\right)^{1/c}\right]\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\left(-1\right)^{n}\int_{0}^{1}\left[\Phi^{-1}\left(y^{1/c}\right)\right]^{n}dy\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \mu_{1}^{\prime}\\
+\mu_{2} & = & \mu_{2}^{\prime}-\mu^{2}\\
+\gamma_{1} & = & \frac{\mu_{3}^{\prime}-3\mu\mu_{2}-\mu^{3}}{\mu_{2}^{3/2}}\\
+\gamma_{2} & = & \frac{\mu_{4}^{\prime}-4\mu\mu_{3}-6\mu^{2}\mu_{2}-\mu^{4}}{\mu_{2}^{2}}-3\end{eqnarray*}
+
+\end_inset
+
+For
+\begin_inset Formula $c=1$
+\end_inset
+
+ this reduces to the normal distribution.
+
+\end_layout
+
+\begin_layout Section
+Power-function
+\end_layout
+
+\begin_layout Standard
+A special case of the beta distribution with
+\begin_inset Formula $b=1$
+\end_inset
+
+: defined for
+\begin_inset Formula $x\in\left[0,1\right]$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+a>0\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;a\right) & = & ax^{a-1}\\
+F\left(x;a\right) & = & x^{a}\\
+G\left(q;a\right) & = & q^{1/a}\\
+\mu & = & \frac{a}{a+1}\\
+\mu_{2} & = & \frac{a\left(a+2\right)}{\left(a+1\right)^{2}}\\
+\gamma_{1} & = & 2\left(1-a\right)\sqrt{\frac{a+2}{a\left(a+3\right)}}\\
+\gamma_{2} & = & \frac{6\left(a^{3}-a^{2}-6a+2\right)}{a\left(a+3\right)\left(a+4\right)}\\
+m_{d} & = & 1\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=1-\frac{1}{a}-\log\left(a\right)\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+R-distribution
+\end_layout
+
+\begin_layout Standard
+A general-purpose distribution with a variety of shapes controlled by
+\begin_inset Formula $c>0.$
+\end_inset
+
+ Range of standard distribution is
+\begin_inset Formula $x\in\left[-1,1\right]$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \frac{\left(1-x^{2}\right)^{c/2-1}}{B\left(\frac{1}{2},\frac{c}{2}\right)}\\
+F\left(x;c\right) & = & \frac{1}{2}+\frac{x}{B\left(\frac{1}{2},\frac{c}{2}\right)}\,_{2}F_{1}\left(\frac{1}{2},1-\frac{c}{2};\frac{3}{2};x^{2}\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\frac{\left(1+\left(-1\right)^{n}\right)}{2}B\left(\frac{n+1}{2},\frac{c}{2}\right)\]
+
+\end_inset
+
+ The R-distribution with parameter
+\begin_inset Formula $n$
+\end_inset
+
+ is the distribution of the correlation coefficient of a random sample of
+ size
+\begin_inset Formula $n$
+\end_inset
+
+ drawn from a bivariate normal distribution with
+\begin_inset Formula $\rho=0.$
+\end_inset
+
+ The mean of the standard distribution is always zero and as the sample
+ size grows, the distribution's mass concentrates more closely about this
+ mean.
+
+\end_layout
+
+\begin_layout Section
+Rayleigh
+\end_layout
+
+\begin_layout Standard
+This is Chi distribution with
+\begin_inset Formula $L=0.0$
+\end_inset
+
+ and
+\begin_inset Formula $\nu=2$
+\end_inset
+
+ and
+\begin_inset Formula $S=S$
+\end_inset
+
+ (no location parameter is generally used), the mode of the distribution
+ is
+\begin_inset Formula $S.$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(r\right) & = & re^{-r^{2}/2}I_{[0,\infty)}\left(x\right)\\
+F\left(r\right) & = & 1-e^{-r^{2}/2}I_{[0,\infty)}\left(x\right)\\
+G\left(q\right) & = & \sqrt{-2\log\left(1-q\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \sqrt{\frac{\pi}{2}}\\
+\mu_{2} & = & \frac{4-\pi}{2}\\
+\gamma_{1} & = & \frac{2\left(\pi-3\right)\sqrt{\pi}}{\left(4-\pi\right)^{3/2}}\\
+\gamma_{2} & = & \frac{24\pi-6\pi^{2}-16}{\left(4-\pi\right)^{2}}\\
+m_{d} & = & 1\\
+m_{n} & = & \sqrt{2\log\left(2\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=\frac{\gamma}{2}+\log\left(\frac{e}{\sqrt{2}}\right).\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\sqrt{2^{n}}\Gamma\left(\frac{n}{2}+1\right)\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Rice*
+\end_layout
+
+\begin_layout Standard
+Defined for
+\begin_inset Formula $x>0$
+\end_inset
+
+ and
+\begin_inset Formula $b>0$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;b\right) & = & x\exp\left(-\frac{x^{2}+b^{2}}{2}\right)I_{0}\left(xb\right)\\
+F\left(x;b\right) & = & \int_{0}^{x}\alpha\exp\left(-\frac{\alpha^{2}+b^{2}}{2}\right)I_{0}\left(\alpha b\right)d\alpha\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\sqrt{2^{n}}\Gamma\left(1+\frac{n}{2}\right)\,_{1}F_{1}\left(-\frac{n}{2};1;-\frac{b^{2}}{2}\right)\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Reciprocal
+\end_layout
+
+\begin_layout Standard
+Shape parameters
+\begin_inset Formula $a,b>0$
+\end_inset
+
+
+\begin_inset Formula $x\in\left[a,b\right]$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;a,b\right) & = & \frac{1}{x\log\left(b/a\right)}\\
+F\left(x;a,b\right) & = & \frac{\log\left(x/a\right)}{\log\left(b/a\right)}\\
+G\left(q;a,b\right) & = & a\exp\left(q\log\left(b/a\right)\right)=a\left(\frac{b}{a}\right)^{q}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+d & = & \log\left(a/b\right)\\
+\mu & = & \frac{a-b}{d}\\
+\mu_{2} & = & \mu\frac{a+b}{2}-\mu^{2}=\frac{\left(a-b\right)\left[a\left(d-2\right)+b\left(d+2\right)\right]}{2d^{2}}\\
+\gamma_{1} & = & \frac{\sqrt{2}\left[12d\left(a-b\right)^{2}+d^{2}\left(a^{2}\left(2d-9\right)+2abd+b^{2}\left(2d+9\right)\right)\right]}{3d\sqrt{a-b}\left[a\left(d-2\right)+b\left(d+2\right)\right]^{3/2}}\\
+\gamma_{2} & = & \frac{-36\left(a-b\right)^{3}+36d\left(a-b\right)^{2}\left(a+b\right)-16d^{2}\left(a^{3}-b^{3}\right)+3d^{3}\left(a^{2}+b^{2}\right)\left(a+b\right)}{3\left(a-b\right)\left[a\left(d-2\right)+b\left(d+2\right)\right]^{2}}-3\\
+m_{d} & = & a\\
+m_{n} & = & \sqrt{ab}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=\frac{1}{2}\log\left(ab\right)+\log\left[\log\left(\frac{b}{a}\right)\right].\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Reciprocal Inverse Gaussian
+\end_layout
+
+\begin_layout Standard
+The pdf is found from the inverse gaussian (IG),
+\begin_inset Formula $f_{RIG}\left(x;\mu\right)=\frac{1}{x^{2}}f_{IG}\left(\frac{1}{x};\mu\right)$
+\end_inset
+
+ defined for
+\begin_inset Formula $x\geq0$
+\end_inset
+
+ as
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f_{IG}\left(x;\mu\right) & = & \frac{1}{\sqrt{2\pi x^{3}}}\exp\left(-\frac{\left(x-\mu\right)^{2}}{2x\mu^{2}}\right).\\
+F_{IG}\left(x;\mu\right) & = & \Phi\left(\frac{1}{\sqrt{x}}\frac{x-\mu}{\mu}\right)+\exp\left(\frac{2}{\mu}\right)\Phi\left(-\frac{1}{\sqrt{x}}\frac{x+\mu}{\mu}\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f_{RIG}\left(x;\mu\right) & = & \frac{1}{\sqrt{2\pi x}}\exp\left(-\frac{\left(1-\mu x\right)^{2}}{2x\mu^{2}}\right)\\
+F_{RIG}\left(x;\mu\right) & = & 1-F_{IG}\left(\frac{1}{x},\mu\right)\\
+ & = & 1-\Phi\left(\frac{1}{\sqrt{x}}\frac{1-\mu x}{\mu}\right)-\exp\left(\frac{2}{\mu}\right)\Phi\left(-\frac{1}{\sqrt{x}}\frac{1+\mu x}{\mu}\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Semicircular
+\end_layout
+
+\begin_layout Standard
+Defined on
+\begin_inset Formula $x\in\left[-1,1\right]$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{2}{\pi}\sqrt{1-x^{2}}\\
+F\left(x\right) & = & \frac{1}{2}+\frac{1}{\pi}\left[x\sqrt{1-x^{2}}+\arcsin x\right]\\
+G\left(q\right) & = & F^{-1}\left(q\right)\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+m_{d}=m_{n}=\mu & = & 0\\
+\mu_{2} & = & \frac{1}{4}\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & -1\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=0.64472988584940017414.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Studentized Range*
+\end_layout
+
+\begin_layout Section
+Student t
+\end_layout
+
+\begin_layout Standard
+Shape parameter
+\begin_inset Formula $\nu>0.$
+\end_inset
+
+
+\begin_inset Formula $I\left(a,b,x\right)$
+\end_inset
+
+ is the incomplete beta integral and
+\begin_inset Formula $I^{-1}\left(a,b,I\left(a,b,x\right)\right)=x$
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\nu\right) & = & \frac{\Gamma\left(\frac{\nu+1}{2}\right)}{\sqrt{\pi\nu}\Gamma\left(\frac{\nu}{2}\right)\left[1+\frac{x^{2}}{\nu}\right]^{\frac{\nu+1}{2}}}\\
+F\left(x;\nu\right) & = & \left\{ \begin{array}{ccc}
+\frac{1}{2}I\left(\frac{\nu}{2},\frac{1}{2},\frac{\nu}{\nu+x^{2}}\right) & & x\leq0\\
+1-\frac{1}{2}I\left(\frac{\nu}{2},\frac{1}{2},\frac{\nu}{\nu+x^{2}}\right) & & x\geq0\end{array}\right.\\
+G\left(q;\nu\right) & = & \left\{ \begin{array}{ccc}
+-\sqrt{\frac{\nu}{I^{-1}\left(\frac{\nu}{2},\frac{1}{2},2q\right)}-\nu} & & q\leq\frac{1}{2}\\
+\sqrt{\frac{\nu}{I^{-1}\left(\frac{\nu}{2},\frac{1}{2},2-2q\right)}-\nu} & & q\geq\frac{1}{2}\end{array}\right.\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+m_{n}=m_{d}=\mu & = & 0\\
+\mu_{2} & = & \frac{\nu}{\nu-2}\quad\nu>2\\
+\gamma_{1} & = & 0\quad\nu>3\\
+\gamma_{2} & = & \frac{6}{\nu-4}\quad\nu>4\end{eqnarray*}
+
+\end_inset
+
+ As
+\begin_inset Formula $\nu\rightarrow\infty,$
+\end_inset
+
+ this distribution approaches the standard normal distribution.
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \[
+h\left[X\right]=\frac{1}{4}\log\left(\frac{\pi c\Gamma^{2}\left(\frac{c}{2}\right)}{\Gamma^{2}\left(\frac{c+1}{2}\right)}\right)-\frac{\left(c+1\right)}{4}\left[\Psi\left(\frac{c}{2}\right)-cZ\left(c\right)+\pi\tan\left(\frac{\pi c}{2}\right)+\gamma+2\log2\right]\]
+
+\end_inset
+
+where
+\begin_inset Formula \[
+Z\left(c\right)=\,_{3}F_{2}\left(1,1,1+\frac{c}{2};\frac{3}{2},2;1\right)=\sum_{k=0}^{\infty}\frac{k!}{k+1}\frac{\Gamma\left(\frac{c}{2}+1+k\right)}{\Gamma\left(\frac{c}{2}+1\right)}\frac{\Gamma\left(\frac{3}{2}\right)}{\Gamma\left(\frac{3}{2}+k\right)}\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Student Z
+\end_layout
+
+\begin_layout Standard
+The student Z distriubtion is defined over all space with one shape parameter
+
+\begin_inset Formula $\nu>0$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;\nu\right) & = & \frac{\Gamma\left(\frac{\nu}{2}\right)}{\sqrt{\pi}\Gamma\left(\frac{\nu-1}{2}\right)}\left(1+x^{2}\right)^{-\nu/2}\\
+F\left(x;\nu\right) & = & \left\{ \begin{array}{ccc}
+Q\left(x;\nu\right) & & x\leq0\\
+1-Q\left(x;\nu\right) & & x\geq0\end{array}\right.\\
+Q\left(x;\nu\right) & = & \frac{\left|x\right|^{1-n}\Gamma\left(\frac{n}{2}\right)\,_{2}F_{1}\left(\frac{n-1}{2},\frac{n}{2};\frac{n+1}{2};-\frac{1}{x^{2}}\right)}{2\sqrt{\pi}\Gamma\left(\frac{n+1}{2}\right)}\end{eqnarray*}
+
+\end_inset
+
+Interesting moments are
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & 0\\
+\sigma^{2} & = & \frac{1}{\nu-3}\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & \frac{6}{\nu-5}.\end{eqnarray*}
+
+\end_inset
+
+ The moment generating function is
+\begin_inset Formula \[
+\theta\left(t\right)=2\sqrt{\left|\frac{t}{2}\right|^{\nu-1}}\frac{K_{\left(n-1\right)/2}\left(\left|t\right|\right)}{\Gamma\left(\frac{\nu-1}{2}\right)}.\]
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Symmetric Power*
+\end_layout
+
+\begin_layout Section
+Triangular
+\end_layout
+
+\begin_layout Standard
+One shape parameter
+\begin_inset Formula $c\in[0,1]$
+\end_inset
+
+ giving the distance to the peak as a percentage of the total extent of
+ the non-zero portion.
+ The location parameter is the start of the non-zero portion, and the scale-para
+meter is the width of the non-zero portion.
+ In standard form we have
+\begin_inset Formula $x\in\left[0,1\right].$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \left\{ \begin{array}{ccc}
+2\frac{x}{c} & & x0$
+\end_inset
+
+.
+ Note, the PDF and CDF functions are periodic and are always defined over
+
+\begin_inset Formula $x\in\left[-\pi,\pi\right]$
+\end_inset
+
+ regardless of the location parameter.
+ Thus, if an input beyond this range is given, it is converted to the equivalent
+ angle in this range.
+ For values of
+\begin_inset Formula $b<100$
+\end_inset
+
+ the PDF and CDF formulas below are used.
+ Otherwise, a normal approximation with variance
+\begin_inset Formula $1/b$
+\end_inset
+
+ is used.
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;b\right) & = & \frac{e^{b\cos x}}{2\pi I_{0}\left(b\right)}\\
+F\left(x;b\right) & = & \frac{1}{2}+\frac{x}{2\pi}+\sum_{k=1}^{\infty}\frac{I_{k}\left(b\right)\sin\left(kx\right)}{I_{0}\left(b\right)\pi k}\\
+G\left(q;b\right) & = & F^{-1}\left(x;b\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & 0\\
+\mu_{2} & = & \int_{-\pi}^{\pi}x^{2}f\left(x;b\right)dx\\
+\gamma_{1} & = & 0\\
+\gamma_{2} & = & \frac{\int_{-\pi}^{\pi}x^{4}f\left(x;b\right)dx}{\mu_{2}^{2}}-3\end{eqnarray*}
+
+\end_inset
+
+ This can be used for defining circular variance.
+
+\end_layout
+
+\begin_layout Section
+Wald
+\end_layout
+
+\begin_layout Standard
+Special case of the Inverse Normal with shape parameter set to
+\begin_inset Formula $1.0$
+\end_inset
+
+.
+ Defined for
+\begin_inset Formula $x>0$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+f\left(x\right) & = & \frac{1}{\sqrt{2\pi x^{3}}}\exp\left(-\frac{\left(x-1\right)^{2}}{2x}\right).\\
+F\left(x\right) & = & \Phi\left(\frac{x-1}{\sqrt{x}}\right)+\exp\left(2\right)\Phi\left(-\frac{x+1}{\sqrt{x}}\right)\\
+G\left(q;\mu\right) & = & F^{-1}\left(q;\mu\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & 1\\
+\mu_{2} & = & 1\\
+\gamma_{1} & = & 3\\
+\gamma_{2} & = & 15\\
+m_{d} & = & \frac{1}{2}\left(\sqrt{13}-3\right)\end{eqnarray*}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Wishart*
+\end_layout
+
+\begin_layout Section
+Wrapped Cauchy
+\end_layout
+
+\begin_layout Standard
+For
+\begin_inset Formula $x\in\left[0,2\pi\right]$
+\end_inset
+
+
+\begin_inset Formula $c\in\left(0,1\right)$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+f\left(x;c\right) & = & \frac{1-c^{2}}{2\pi\left(1+c^{2}-2c\cos x\right)}\\
+g_{c}\left(x\right) & = & \frac{1}{\pi}\arctan\left[\frac{1+c}{1-c}\tan\left(\frac{x}{2}\right)\right]\\
+r_{c}\left(q\right) & = & 2\arctan\left[\frac{1-c}{1+c}\tan\left(\pi q\right)\right]\\
+F\left(x;c\right) & = & \left\{ \begin{array}{ccc}
+g_{c}\left(x\right) & & 0\leq x<\pi\\
+1-g_{c}\left(2\pi-x\right) & & \pi\leq x\leq2\pi\end{array}\right.\\
+G\left(q;c\right) & = & \left\{ \begin{array}{ccc}
+r_{c}\left(q\right) & & 0\leq q<\frac{1}{2}\\
+2\pi-r_{c}\left(1-q\right) & & \frac{1}{2}\leq q\leq1\end{array}\right.\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+\]
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=\log\left(2\pi\left(1-c^{2}\right)\right).\]
+
+\end_inset
+
+
+\end_layout
+
+\end_body
+\end_document
Added: trunk/doc/source/tutorial/stats/discrete.lyx
===================================================================
--- trunk/doc/source/tutorial/stats/discrete.lyx (rev 0)
+++ trunk/doc/source/tutorial/stats/discrete.lyx 2010-06-01 04:09:28 UTC (rev 6462)
@@ -0,0 +1,1218 @@
+#LyX 1.3 created this file. For more info see http://www.lyx.org/
+\lyxformat 221
+\textclass article
+\language english
+\inputencoding auto
+\fontscheme default
+\graphics default
+\paperfontsize default
+\spacing single
+\papersize Default
+\paperpackage a4
+\use_geometry 1
+\use_amsmath 1
+\use_natbib 0
+\use_numerical_citations 0
+\paperorientation portrait
+\leftmargin 1in
+\topmargin 1in
+\rightmargin 1in
+\bottommargin 1in
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\defskip medskip
+\quotes_language english
+\quotes_times 2
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+
+\layout Title
+
+Discrete Statistical Distributions
+\layout Standard
+
+Discrete random variables take on only a countable number of values.
+ The commonly used distributions are included in SciPy and described in
+ this document.
+ Each discrete distribution can take one extra integer parameter:
+\begin_inset Formula $L.$
+\end_inset
+
+ The relationship between the general distribution and the standard one
+ is
+\begin_inset Formula \[
+p\left(x\right)=p_{0}\left(x-L\right)\]
+
+\end_inset
+
+ which allows for shifting of the input.
+ When a distribution generator is initialized, the discrete distribution
+ can either specify the beginning and ending (integer) values
+\begin_inset Formula $a$
+\end_inset
+
+ and
+\begin_inset Formula $b$
+\end_inset
+
+ which must be such that
+\begin_inset Formula \[
+p_{0}\left(x\right)=0\quad xb\]
+
+\end_inset
+
+ in which case, it is assumed that the pdf function is specified on the
+ integers
+\begin_inset Formula $a+mk\leq b$
+\end_inset
+
+ where
+\begin_inset Formula $k$
+\end_inset
+
+ is a non-negative integer (
+\begin_inset Formula $0,1,2,\ldots$
+\end_inset
+
+) and
+\begin_inset Formula $m$
+\end_inset
+
+ is a positive integer multiplier.
+ Alternatively, the two lists
+\begin_inset Formula $x_{k}$
+\end_inset
+
+ and
+\begin_inset Formula $p\left(x_{k}\right)$
+\end_inset
+
+ can be provided directly in which case a dictionary is set up internally
+ to evaulate probabilities and generate random variates.
+
+\layout Subsection
+
+Probability Mass Function (PMF)
+\layout Standard
+
+The probability mass function of a random variable X is defined as the probabili
+ty that the random variable takes on a particular value.
+
+\begin_inset Formula \[
+p\left(x_{k}\right)=P\left[X=x_{k}\right]\]
+
+\end_inset
+
+ This is also sometimes called the probability density function, although
+ technically
+\begin_inset Formula \[
+f\left(x\right)=\sum_{k}p\left(x_{k}\right)\delta\left(x-x_{k}\right)\]
+
+\end_inset
+
+ is the probability density function for a discrete distribution
+\begin_inset Foot
+collapsed false
+
+\layout Standard
+
+Note that we will be using
+\begin_inset Formula $p$
+\end_inset
+
+ to represent the probability mass function and a parameter (a probability).
+ The usage should be obvious from context.
+
+\end_inset
+
+.
+
+\layout Subsection
+
+Cumulative Distribution Function (CDF)
+\layout Standard
+
+The cumulative distribution function is
+\begin_inset Formula \[
+F\left(x\right)=P\left[X\leq x\right]=\sum_{x_{k}\leq x}p\left(x_{k}\right)\]
+
+\end_inset
+
+ and is also useful to be able to compute.
+ Note that
+\begin_inset Formula \[
+F\left(x_{k}\right)-F\left(x_{k-1}\right)=p\left(x_{k}\right)\]
+
+\end_inset
+
+
+\layout Subsection
+
+Survival Function
+\layout Standard
+
+The survival function is just
+\begin_inset Formula \[
+S\left(x\right)=1-F\left(x\right)=P\left[X>k\right]\]
+
+\end_inset
+
+ the probability that the random variable is strictly larger than
+\begin_inset Formula $k$
+\end_inset
+
+.
+
+\layout Subsection
+
+Percent Point Function (Inverse CDF)
+\layout Standard
+
+The percent point function is the inverse of the cumulative distribution
+ function and is
+\begin_inset Formula \[
+G\left(q\right)=F^{-1}\left(q\right)\]
+
+\end_inset
+
+ for discrete distributions, this must be modified for cases where there
+ is no
+\begin_inset Formula $x_{k}$
+\end_inset
+
+ such that
+\begin_inset Formula $F\left(x_{k}\right)=q.$
+\end_inset
+
+ In these cases we choose
+\begin_inset Formula $G\left(q\right)$
+\end_inset
+
+ to be the smallest value
+\begin_inset Formula $x_{k}=G\left(q\right)$
+\end_inset
+
+ for which
+\begin_inset Formula $F\left(x_{k}\right)\geq q$
+\end_inset
+
+.
+ If
+\begin_inset Formula $q=0$
+\end_inset
+
+ then we define
+\begin_inset Formula $G\left(0\right)=a-1$
+\end_inset
+
+.
+ This definition allows random variates to be defined in the same way as
+ with continuous rv's using the inverse cdf on a uniform distribution to
+ generate random variates.
+
+\layout Subsection
+
+Inverse survival function
+\layout Standard
+
+The inverse survival function is the inverse of the survival function
+\begin_inset Formula \[
+Z\left(\alpha\right)=S^{-1}\left(\alpha\right)=G\left(1-\alpha\right)\]
+
+\end_inset
+
+ and is thus the smallest non-negative integer
+\begin_inset Formula $k$
+\end_inset
+
+ for which
+\begin_inset Formula $F\left(k\right)\geq1-\alpha$
+\end_inset
+
+ or the smallest non-negative integer
+\begin_inset Formula $k$
+\end_inset
+
+ for which
+\begin_inset Formula $S\left(k\right)\leq\alpha.$
+\end_inset
+
+
+\layout Subsection
+
+Hazard functions
+\layout Standard
+
+If desired, the hazard function and the cumulative hazard function could
+ be defined as
+\begin_inset Formula \[
+h\left(x_{k}\right)=\frac{p\left(x_{k}\right)}{1-F\left(x_{k}\right)}\]
+
+\end_inset
+
+ and
+\begin_inset Formula \[
+H\left(x\right)=\sum_{x_{k}\leq x}h\left(x_{k}\right)=\sum_{x_{k}\leq x}\frac{F\left(x_{k}\right)-F\left(x_{k-1}\right)}{1-F\left(x_{k}\right)}.\]
+
+\end_inset
+
+
+\layout Subsection
+
+Moments
+\layout Standard
+
+Non-central moments are defined using the PDF
+\begin_inset Formula \[
+\mu_{m}^{\prime}=E\left[X^{m}\right]=\sum_{k}x_{k}^{m}p\left(x_{k}\right).\]
+
+\end_inset
+
+ Central moments are computed similarly
+\begin_inset Formula $\mu=\mu_{1}^{\prime}$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu_{m}=E\left[\left(X-\mu\right)^{2}\right] & = & \sum_{k}\left(x_{k}-\mu\right)^{m}p\left(x_{k}\right)\\
+ & = & \sum_{k=0}^{m}\left(-1\right)^{m-k}\left(\begin{array}{c}
+m\\
+k\end{array}\right)\mu^{m-k}\mu_{k}^{\prime}\end{eqnarray*}
+
+\end_inset
+
+ The mean is the first moment
+\begin_inset Formula \[
+\mu=\mu_{1}^{\prime}=E\left[X\right]=\sum_{k}x_{k}p\left(x_{k}\right)\]
+
+\end_inset
+
+ the variance is the second central moment
+\begin_inset Formula \[
+\mu_{2}=E\left[\left(X-\mu\right)^{2}\right]=\sum_{x_{k}}x_{k}^{2}p\left(x_{k}\right)-\mu^{2}.\]
+
+\end_inset
+
+Skewness is defined as
+\begin_inset Formula \[
+\gamma_{1}=\frac{\mu_{3}}{\mu_{2}^{3/2}}\]
+
+\end_inset
+
+ while (Fisher) kurtosis is
+\begin_inset Formula \[
+\gamma_{2}=\frac{\mu_{4}}{\mu_{2}^{2}}-3,\]
+
+\end_inset
+
+ so that a normal distribution has a kurtosis of zero.
+
+\layout Subsection
+
+Moment generating function
+\layout Standard
+
+The moment generating funtion is defined as
+\begin_inset Formula \[
+M_{X}\left(t\right)=E\left[e^{Xt}\right]=\sum_{x_{k}}e^{x_{k}t}p\left(x_{k}\right)\]
+
+\end_inset
+
+ Moments are found as the derivatives of the moment generating function
+ evaluated at
+\begin_inset Formula $0.$
+\end_inset
+
+
+\layout Subsection
+
+Fitting data
+\layout Standard
+
+To fit data to a distribution, maximizing the likelihood function is common.
+ Alternatively, some distributions have well-known minimum variance unbiased
+ estimators.
+ These will be chosen by default, but the likelihood function will always
+ be available for minimizing.
+
+\layout Standard
+
+If
+\begin_inset Formula $f_{i}\left(k;\boldsymbol{\theta}\right)$
+\end_inset
+
+ is the PDF of a random-variable where
+\begin_inset Formula $\boldsymbol{\theta}$
+\end_inset
+
+ is a vector of parameters (
+\emph on
+e.g.
+
+\begin_inset Formula $L$
+\end_inset
+
+
+\emph default
+and
+\begin_inset Formula $S$
+\end_inset
+
+), then for a collection of
+\begin_inset Formula $N$
+\end_inset
+
+ independent samples from this distribution, the joint distribution the
+ random vector
+\begin_inset Formula $\mathbf{k}$
+\end_inset
+
+ is
+\begin_inset Formula \[
+f\left(\mathbf{k};\boldsymbol{\theta}\right)=\prod_{i=1}^{N}f_{i}\left(k_{i};\boldsymbol{\theta}\right).\]
+
+\end_inset
+
+ The maximum likelihood estimate of the parameters
+\begin_inset Formula $\boldsymbol{\theta}$
+\end_inset
+
+ are the parameters which maximize this function with
+\begin_inset Formula $\mathbf{x}$
+\end_inset
+
+ fixed and given by the data:
+\begin_inset Formula \begin{eqnarray*}
+\hat{\boldsymbol{\theta}} & = & \arg\max_{\boldsymbol{\theta}}f\left(\mathbf{k};\boldsymbol{\theta}\right)\\
+ & = & \arg\min_{\boldsymbol{\theta}}l_{\mathbf{k}}\left(\boldsymbol{\theta}\right).\end{eqnarray*}
+
+\end_inset
+
+ Where
+\begin_inset Formula \begin{eqnarray*}
+l_{\mathbf{k}}\left(\boldsymbol{\theta}\right) & = & -\sum_{i=1}^{N}\log f\left(k_{i};\boldsymbol{\theta}\right)\\
+ & = & -N\overline{\log f\left(k_{i};\boldsymbol{\theta}\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\layout Subsection
+
+Standard notation for mean
+\layout Standard
+
+We will use
+\begin_inset Formula \[
+\overline{y\left(\mathbf{x}\right)}=\frac{1}{N}\sum_{i=1}^{N}y\left(x_{i}\right)\]
+
+\end_inset
+
+ where
+\begin_inset Formula $N$
+\end_inset
+
+ should be clear from context.
+
+\layout Subsection
+
+Combinations
+\layout Standard
+
+Note that
+\begin_inset Formula \[
+k!=k\cdot\left(k-1\right)\cdot\left(k-2\right)\cdot\cdots\cdot1=\Gamma\left(k+1\right)\]
+
+\end_inset
+
+ and has special cases of
+\begin_inset Formula \begin{eqnarray*}
+0! & \equiv & 1\\
+k! & \equiv & 0\quad k<0\end{eqnarray*}
+
+\end_inset
+
+ and
+\begin_inset Formula \[
+\left(\begin{array}{c}
+n\\
+k\end{array}\right)=\frac{n!}{\left(n-k\right)!k!}.\]
+
+\end_inset
+
+ If
+\begin_inset Formula $n<0$
+\end_inset
+
+ or
+\begin_inset Formula $k<0$
+\end_inset
+
+ or
+\begin_inset Formula $k>n$
+\end_inset
+
+ we define
+\begin_inset Formula $\left(\begin{array}{c}
+n\\
+k\end{array}\right)=0$
+\end_inset
+
+
+\layout Section
+
+Bernoulli
+\layout Standard
+
+A Bernoulli random variable of parameter
+\begin_inset Formula $p$
+\end_inset
+
+ takes one of only two values
+\begin_inset Formula $X=0$
+\end_inset
+
+ or
+\begin_inset Formula $X=1$
+\end_inset
+
+.
+ The probability of success (
+\begin_inset Formula $X=1$
+\end_inset
+
+) is
+\begin_inset Formula $p$
+\end_inset
+
+, and the probability of failure (
+\begin_inset Formula $X=0$
+\end_inset
+
+) is
+\begin_inset Formula $1-p.$
+\end_inset
+
+ It can be thought of as a binomial random variable with
+\begin_inset Formula $n=1$
+\end_inset
+
+.
+ The PMF is
+\begin_inset Formula $p\left(k\right)=0$
+\end_inset
+
+ for
+\begin_inset Formula $k\neq0,1$
+\end_inset
+
+ and
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;p\right) & = & \begin{cases}
+1-p & k=0\\
+p & k=1\end{cases}\\
+F\left(x;p\right) & = & \begin{cases}
+0 & x<0\\
+1-p & 0\le x<1\\
+1 & 1\leq x\end{cases}\\
+G\left(q;p\right) & = & \begin{cases}
+0 & 0\leq q<1-p\\
+1 & 1-p\leq q\leq1\end{cases}\\
+\mu & = & p\\
+\mu_{2} & = & p\left(1-p\right)\\
+\gamma_{3} & = & \frac{1-2p}{\sqrt{p\left(1-p\right)}}\\
+\gamma_{4} & = & \frac{1-6p\left(1-p\right)}{p\left(1-p\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\layout Standard
+
+
+\begin_inset Formula \[
+M\left(t\right)=1-p\left(1-e^{t}\right)\]
+
+\end_inset
+
+
+\layout Standard
+
+
+\begin_inset Formula \[
+\mu_{m}^{\prime}=p\]
+
+\end_inset
+
+
+\layout Standard
+
+
+\begin_inset Formula \[
+h\left[X\right]=p\log p+\left(1-p\right)\log\left(1-p\right)\]
+
+\end_inset
+
+
+\layout Section
+
+Binomial
+\layout Standard
+
+A binomial random variable with parameters
+\begin_inset Formula $\left(n,p\right)$
+\end_inset
+
+ can be described as the sum of
+\begin_inset Formula $n$
+\end_inset
+
+ independent Bernoulli random variables of parameter
+\begin_inset Formula $p;$
+\end_inset
+
+
+\begin_inset Formula \[
+Y=\sum_{i=1}^{n}X_{i}.\]
+
+\end_inset
+
+ Therefore, this random variable counts the number of successes in
+\begin_inset Formula $n$
+\end_inset
+
+ independent trials of a random experiment where the probability of success
+ is
+\begin_inset Formula $p.$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;n,p\right) & = & \left(\begin{array}{c}
+n\\
+k\end{array}\right)p^{k}\left(1-p\right)^{n-k}\,\, k\in\left\{ 0,1,\ldots n\right\} ,\\
+F\left(x;n,p\right) & = & \sum_{k\leq x}\left(\begin{array}{c}
+n\\
+k\end{array}\right)p^{k}\left(1-p\right)^{n-k}=I_{1-p}\left(n-\left\lfloor x\right\rfloor ,\left\lfloor x\right\rfloor +1\right)\quad x\geq0\end{eqnarray*}
+
+\end_inset
+
+ where the incomplete beta integral is
+\begin_inset Formula \[
+I_{x}\left(a,b\right)=\frac{\Gamma\left(a+b\right)}{\Gamma\left(a\right)\Gamma\left(b\right)}\int_{0}^{x}t^{a-1}\left(1-t\right)^{b-1}dt.\]
+
+\end_inset
+
+ Now
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & np\\
+\mu_{2} & = & np\left(1-p\right)\\
+\gamma_{1} & = & \frac{1-2p}{\sqrt{np\left(1-p\right)}}\\
+\gamma_{2} & = & \frac{1-6p\left(1-p\right)}{np\left(1-p\right)}.\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\left[1-p\left(1-e^{t}\right)\right]^{n}\]
+
+\end_inset
+
+
+\layout Section
+
+Boltzmann (truncated Planck)
+\layout Standard
+
+
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;N,\lambda\right) & = & \frac{1-e^{-\lambda}}{1-e^{-\lambda N}}\exp\left(-\lambda k\right)\quad k\in\left\{ 0,1,\ldots,N-1\right\} \\
+F\left(x;N,\lambda\right) & = & \left\{ \begin{array}{cc}
+0 & x<0\\
+\frac{1-\exp\left[-\lambda\left(\left\lfloor x\right\rfloor +1\right)\right]}{1-\exp\left(-\lambda N\right)} & 0\leq x\leq N-1\\
+1 & x\geq N-1\end{array}\right.\\
+G\left(q,\lambda\right) & = & \left\lceil -\frac{1}{\lambda}\log\left[1-q\left(1-e^{-\lambda N}\right)\right]-1\right\rceil \end{eqnarray*}
+
+\end_inset
+
+ Define
+\begin_inset Formula $z=e^{-\lambda}$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{z}{1-z}-\frac{Nz^{N}}{1-z^{N}}\\
+\mu_{2} & = & \frac{z}{\left(1-z\right)^{2}}-\frac{N^{2}z^{N}}{\left(1-z^{N}\right)^{2}}\\
+\gamma_{1} & = & \frac{z\left(1+z\right)\left(\frac{1-z^{N}}{1-z}\right)^{3}-N^{3}z^{N}\left(1+z^{N}\right)}{\left[z\left(\frac{1-z^{N}}{1-z}\right)^{2}-N^{2}z^{N}\right]^{3/2}}\\
+\gamma_{2} & = & \frac{z\left(1+4z+z^{2}\right)\left(\frac{1-z^{N}}{1-z}\right)^{4}-N^{4}z^{N}\left(1+4z^{N}+z^{2N}\right)}{\left[z\left(\frac{1-z^{N}}{1-z}\right)^{2}-N^{2}z^{N}\right]^{2}}\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \[
+M\left(t\right)=\frac{1-e^{N\left(t-\lambda\right)}}{1-e^{t-\lambda}}\frac{1-e^{-\lambda}}{1-e^{-\lambda N}}\]
+
+\end_inset
+
+
+\layout Section
+
+Planck (discrete exponential)
+\layout Standard
+
+Named Planck because of its relationship to the black-body problem he solved.
+
+\layout Standard
+
+
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;\lambda\right) & = & \left(1-e^{-\lambda}\right)e^{-\lambda k}\quad k\lambda\geq0\\
+F\left(x;\lambda\right) & = & 1-e^{-\lambda\left(\left\lfloor x\right\rfloor +1\right)}\quad x\lambda\geq0\\
+G\left(q;\lambda\right) & = & \left\lceil -\frac{1}{\lambda}\log\left[1-q\right]-1\right\rceil .\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \frac{1}{e^{\lambda}-1}\\
+\mu_{2} & = & \frac{e^{-\lambda}}{\left(1-e^{-\lambda}\right)^{2}}\\
+\gamma_{1} & = & 2\cosh\left(\frac{\lambda}{2}\right)\\
+\gamma_{2} & = & 4+2\cosh\left(\lambda\right)\end{eqnarray*}
+
+\end_inset
+
+
+\layout Standard
+
+
+\begin_inset Formula \[
+M\left(t\right)=\frac{1-e^{-\lambda}}{1-e^{t-\lambda}}\]
+
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=\frac{\lambda e^{-\lambda}}{1-e^{-\lambda}}-\log\left(1-e^{-\lambda}\right)\]
+
+\end_inset
+
+
+\layout Section
+
+Poisson
+\layout Standard
+
+The Poisson random variable counts the number of successes in
+\begin_inset Formula $n$
+\end_inset
+
+ independent Bernoulli trials in the limit as
+\begin_inset Formula $n\rightarrow\infty$
+\end_inset
+
+ and
+\begin_inset Formula $p\rightarrow0$
+\end_inset
+
+ where the probability of success in each trial is
+\begin_inset Formula $p$
+\end_inset
+
+ and
+\begin_inset Formula $np=\lambda\geq0$
+\end_inset
+
+ is a constant.
+ It can be used to approximate the Binomial random variable or in it's own
+ right to count the number of events that occur in the interval
+\begin_inset Formula $\left[0,t\right]$
+\end_inset
+
+ for a process satisfying certain
+\begin_inset Quotes eld
+\end_inset
+
+sparsity
+\begin_inset Quotes erd
+\end_inset
+
+ constraints.
+ The functions are
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;\lambda\right) & = & e^{-\lambda}\frac{\lambda^{k}}{k!}\quad k\geq0,\\
+F\left(x;\lambda\right) & = & \sum_{n=0}^{\left\lfloor x\right\rfloor }e^{-\lambda}\frac{\lambda^{n}}{n!}=\frac{1}{\Gamma\left(\left\lfloor x\right\rfloor +1\right)}\int_{\lambda}^{\infty}t^{\left\lfloor x\right\rfloor }e^{-t}dt,\\
+\mu & = & \lambda\\
+\mu_{2} & = & \lambda\\
+\gamma_{1} & = & \frac{1}{\sqrt{\lambda}}\\
+\gamma_{2} & = & \frac{1}{\lambda}.\end{eqnarray*}
+
+\end_inset
+
+
+\layout Standard
+
+
+\begin_inset Formula \[
+M\left(t\right)=\exp\left[\lambda\left(e^{t}-1\right)\right].\]
+
+\end_inset
+
+
+\layout Section
+
+Geometric
+\layout Standard
+
+The geometric random variable with parameter
+\begin_inset Formula $p\in\left(0,1\right)$
+\end_inset
+
+ can be defined as the number of trials required to obtain a success where
+ the probability of success on each trial is
+\begin_inset Formula $p$
+\end_inset
+
+.
+ Thus,
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;p\right) & = & \left(1-p\right)^{k-1}p\quad k\geq1\\
+F\left(x;p\right) & = & 1-\left(1-p\right)^{\left\lfloor x\right\rfloor }\quad x\geq1\\
+G\left(q;p\right) & = & \left\lceil \frac{\log\left(1-q\right)}{\log\left(1-p\right)}\right\rceil \\
+\mu & = & \frac{1}{p}\\
+\mu_{2} & = & \frac{1-p}{p^{2}}\\
+\gamma_{1} & = & \frac{2-p}{\sqrt{1-p}}\\
+\gamma_{2} & = & \frac{p^{2}-6p+6}{1-p}.\end{eqnarray*}
+
+\end_inset
+
+
+\layout Standard
+
+
+\begin_inset Formula \begin{eqnarray*}
+M\left(t\right) & = & \frac{p}{e^{-t}-\left(1-p\right)}\end{eqnarray*}
+
+\end_inset
+
+
+\layout Section
+
+Negative Binomial
+\layout Standard
+
+The negative binomial random variable with parameters
+\begin_inset Formula $n$
+\end_inset
+
+ and
+\begin_inset Formula $p\in\left(0,1\right)$
+\end_inset
+
+ can be defined as the number of
+\emph on
+extra
+\emph default
+independent trials (beyond
+\begin_inset Formula $n$
+\end_inset
+
+) required to accumulate a total of
+\begin_inset Formula $n$
+\end_inset
+
+ successes where the probability of a success on each trial is
+\begin_inset Formula $p.$
+\end_inset
+
+ Equivalently, this random variable is the number of failures encoutered
+ while accumulating
+\begin_inset Formula $n$
+\end_inset
+
+ successes during independent trials of an experiment that succeeds with
+ probability
+\begin_inset Formula $p.$
+\end_inset
+
+ Thus,
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;n,p\right) & = & \left(\begin{array}{c}
+k+n-1\\
+n-1\end{array}\right)p^{n}\left(1-p\right)^{k}\quad k\geq0\\
+F\left(x;n,p\right) & = & \sum_{i=0}^{\left\lfloor x\right\rfloor }\left(\begin{array}{c}
+i+n-1\\
+i\end{array}\right)p^{n}\left(1-p\right)^{i}\quad x\geq0\\
+ & = & I_{p}\left(n,\left\lfloor x\right\rfloor +1\right)\quad x\geq0\\
+\mu & = & n\frac{1-p}{p}\\
+\mu_{2} & = & n\frac{1-p}{p^{2}}\\
+\gamma_{1} & = & \frac{2-p}{\sqrt{n\left(1-p\right)}}\\
+\gamma_{2} & = & \frac{p^{2}+6\left(1-p\right)}{n\left(1-p\right)}.\end{eqnarray*}
+
+\end_inset
+
+ Recall that
+\begin_inset Formula $I_{p}\left(a,b\right)$
+\end_inset
+
+ is the incomplete beta integral.
+
+\layout Section
+
+Hypergeometric
+\layout Standard
+
+The hypergeometric random variable with parameters
+\begin_inset Formula $\left(M,n,N\right)$
+\end_inset
+
+ counts the number of
+\begin_inset Quotes eld
+\end_inset
+
+good
+\begin_inset Quotes erd
+\end_inset
+
+ objects in a sample of size
+\begin_inset Formula $N$
+\end_inset
+
+ chosen without replacement from a population of
+\begin_inset Formula $M$
+\end_inset
+
+ objects where
+\begin_inset Formula $n$
+\end_inset
+
+ is the number of
+\begin_inset Quotes eld
+\end_inset
+
+good
+\begin_inset Quotes erd
+\end_inset
+
+ objects in the total population.
+
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;N,n,M\right) & = & \frac{\left(\begin{array}{c}
+n\\
+k\end{array}\right)\left(\begin{array}{c}
+M-n\\
+N-k\end{array}\right)}{\left(\begin{array}{c}
+M\\
+N\end{array}\right)}\quad N-\left(M-n\right)\leq k\leq\min\left(n,N\right)\\
+F\left(x;N,n,M\right) & = & \sum_{k=0}^{\left\lfloor x\right\rfloor }\frac{\left(\begin{array}{c}
+m\\
+k\end{array}\right)\left(\begin{array}{c}
+N-m\\
+n-k\end{array}\right)}{\left(\begin{array}{c}
+N\\
+n\end{array}\right)},\\
+\mu & = & \frac{nN}{M}\\
+\mu_{2} & = & \frac{nN\left(M-n\right)\left(M-N\right)}{M^{2}\left(M-1\right)}\\
+\gamma_{1} & = & \frac{\left(M-2n\right)\left(M-2N\right)}{M-2}\sqrt{\frac{M-1}{nN\left(M-m\right)\left(M-n\right)}}\\
+\gamma_{2} & = & \frac{g\left(N,n,M\right)}{nN\left(M-n\right)\left(M-3\right)\left(M-2\right)\left(N-M\right)}\end{eqnarray*}
+
+\end_inset
+
+ where (defining
+\begin_inset Formula $m=M-n$
+\end_inset
+
+)
+\begin_inset Formula \begin{eqnarray*}
+g\left(N,n,M\right) & = & m^{3}-m^{5}+3m^{2}n-6m^{3}n+m^{4}n+3mn^{2}\\
+ & & -12m^{2}n^{2}+8m^{3}n^{2}+n^{3}-6mn^{3}+8m^{2}n^{3}\\
+ & & +mn^{4}-n^{5}-6m^{3}N+6m^{4}N+18m^{2}nN\\
+ & & -6m^{3}nN+18mn^{2}N-24m^{2}n^{2}N-6n^{3}N\\
+ & & -6mn^{3}N+6n^{4}N+6m^{2}N^{2}-6m^{3}N^{2}-24mnN^{2}\\
+ & & +12m^{2}nN^{2}+6n^{2}N^{2}+12mn^{2}N^{2}-6n^{3}N^{2}.\end{eqnarray*}
+
+\end_inset
+
+
+\layout Section
+
+Zipf (Zeta)
+\layout Standard
+
+A random variable has the zeta distribution (also called the zipf distribution)
+ with parameter
+\begin_inset Formula $\alpha>1$
+\end_inset
+
+ if it's probability mass function is given by
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;\alpha\right) & = & \frac{1}{\zeta\left(\alpha\right)k^{\alpha}}\quad k\geq1\end{eqnarray*}
+
+\end_inset
+
+where
+\begin_inset Formula \[
+\zeta\left(\alpha\right)=\sum_{n=1}^{\infty}\frac{1}{n^{\alpha}}\]
+
+\end_inset
+
+ is the Riemann zeta function.
+ Other functions of this distribution are
+\begin_inset Formula \begin{eqnarray*}
+F\left(x;\alpha\right) & = & \frac{1}{\zeta\left(\alpha\right)}\sum_{k=1}^{\left\lfloor x\right\rfloor }\frac{1}{k^{\alpha}}\\
+\mu & = & \frac{\zeta_{1}}{\zeta_{0}}\quad\alpha>2\\
+\mu_{2} & = & \frac{\zeta_{2}\zeta_{0}-\zeta_{1}^{2}}{\zeta_{0}^{2}}\quad\alpha>3\\
+\gamma_{1} & = & \frac{\zeta_{3}\zeta_{0}^{2}-3\zeta_{0}\zeta_{1}\zeta_{2}+2\zeta_{1}^{3}}{\left[\zeta_{2}\zeta_{0}-\zeta_{1}^{2}\right]^{3/2}}\quad\alpha>4\\
+\gamma_{2} & = & \frac{\zeta_{4}\zeta_{0}^{3}-4\zeta_{3}\zeta_{1}\zeta_{0}^{2}+12\zeta_{2}\zeta_{1}^{2}\zeta_{0}-6\zeta_{1}^{4}-3\zeta_{2}^{2}\zeta_{0}^{2}}{\left(\zeta_{2}\zeta_{0}-\zeta_{1}^{2}\right)^{2}}.\end{eqnarray*}
+
+\end_inset
+
+
+\layout Standard
+
+
+\begin_inset Formula \begin{eqnarray*}
+M\left(t\right) & = & \frac{\textrm{Li}_{\alpha}\left(e^{t}\right)}{\zeta\left(\alpha\right)}\end{eqnarray*}
+
+\end_inset
+
+where
+\begin_inset Formula $\zeta_{i}=\zeta\left(\alpha-i\right)$
+\end_inset
+
+ and
+\begin_inset Formula $\textrm{Li}_{n}\left(z\right)$
+\end_inset
+
+ is the
+\begin_inset Formula $n^{\textrm{th}}$
+\end_inset
+
+ polylogarithm function of
+\begin_inset Formula $z$
+\end_inset
+
+ defined as
+\begin_inset Formula \[
+\textrm{Li}_{n}\left(z\right)\equiv\sum_{k=1}^{\infty}\frac{z^{k}}{k^{n}}\]
+
+\end_inset
+
+
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\left.M^{\left(n\right)}\left(t\right)\right|_{t=0}=\left.\frac{\textrm{Li}_{\alpha-n}\left(e^{t}\right)}{\zeta\left(a\right)}\right|_{t=0}=\frac{\zeta\left(\alpha-n\right)}{\zeta\left(\alpha\right)}\]
+
+\end_inset
+
+
+\layout Section
+
+Logarithmic (Log-Series, Series)
+\layout Standard
+
+The logarimthic distribution with parameter
+\begin_inset Formula $p$
+\end_inset
+
+ has a probability mass function with terms proportional to the Taylor series
+ expansion of
+\begin_inset Formula $\log\left(1-p\right)$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;p\right) & = & -\frac{p^{k}}{k\log\left(1-p\right)}\quad k\geq1\\
+F\left(x;p\right) & = & -\frac{1}{\log\left(1-p\right)}\sum_{k=1}^{\left\lfloor x\right\rfloor }\frac{p^{k}}{k}=1+\frac{p^{1+\left\lfloor x\right\rfloor }\Phi\left(p,1,1+\left\lfloor x\right\rfloor \right)}{\log\left(1-p\right)}\end{eqnarray*}
+
+\end_inset
+
+where
+\begin_inset Formula \[
+\Phi\left(z,s,a\right)=\sum_{k=0}^{\infty}\frac{z^{k}}{\left(a+k\right)^{s}}\]
+
+\end_inset
+
+ is the Lerch Transcendent.
+ Also define
+\begin_inset Formula $r=\log\left(1-p\right)$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & -\frac{p}{\left(1-p\right)r}\\
+\mu_{2} & = & -\frac{p\left[p+r\right]}{\left(1-p\right)^{2}r^{2}}\\
+\gamma_{1} & = & -\frac{2p^{2}+3pr+\left(1+p\right)r^{2}}{r\left(p+r\right)\sqrt{-p\left(p+r\right)}}r\\
+\gamma_{2} & = & -\frac{6p^{3}+12p^{2}r+p\left(4p+7\right)r^{2}+\left(p^{2}+4p+1\right)r^{3}}{p\left(p+r\right)^{2}}.\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+M\left(t\right) & = & -\frac{1}{\log\left(1-p\right)}\sum_{k=1}^{\infty}\frac{e^{tk}p^{k}}{k}\\
+ & = & \frac{\log\left(1-pe^{t}\right)}{\log\left(1-p\right)}\end{eqnarray*}
+
+\end_inset
+
+ Thus,
+\begin_inset Formula \[
+\mu_{n}^{\prime}=\left.M^{\left(n\right)}\left(t\right)\right|_{t=0}=\left.\frac{\textrm{Li}_{1-n}\left(pe^{t}\right)}{\log\left(1-p\right)}\right|_{t=0}=-\frac{\textrm{Li}_{1-n}\left(p\right)}{\log\left(1-p\right)}.\]
+
+\end_inset
+
+
+\layout Section
+
+Discrete Uniform (randint)
+\layout Standard
+
+The discrete uniform distribution with parameters
+\begin_inset Formula $\left(a,b\right)$
+\end_inset
+
+ constructs a random variable that has an equal probability of being any
+ one of the integers in the half-open range
+\begin_inset Formula $[a,b).$
+\end_inset
+
+ If
+\begin_inset Formula $a$
+\end_inset
+
+ is not given it is assumed to be zero and the only parameter is
+\begin_inset Formula $b.$
+\end_inset
+
+ Therefore,
+\begin_inset Formula \begin{eqnarray*}
+p\left(k;a,b\right) & = & \frac{1}{b-a}\quad a\leq k0$
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+p\left(k\right) & = & \tanh\left(\frac{a}{2}\right)e^{-a\left|k\right|},\\
+F\left(x\right) & = & \left\{ \begin{array}{cc}
+\frac{e^{a\left(\left\lfloor x\right\rfloor +1\right)}}{e^{a}+1} & \left\lfloor x\right\rfloor <0,\\
+1-\frac{e^{-a\left\lfloor x\right\rfloor }}{e^{a}+1} & \left\lfloor x\right\rfloor \geq0.\end{array}\right.\\
+G\left(q\right) & = & \left\{ \begin{array}{cc}
+\left\lceil \frac{1}{a}\log\left[q\left(e^{a}+1\right)\right]-1\right\rceil & q<\frac{1}{1+e^{-a}},\\
+\left\lceil -\frac{1}{a}\log\left[\left(1-q\right)\left(1+e^{a}\right)\right]\right\rceil & q\geq\frac{1}{1+e^{-a}}.\end{array}\right.\end{eqnarray*}
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+M\left(t\right) & = & \tanh\left(\frac{a}{2}\right)\sum_{k=-\infty}^{\infty}e^{tk}e^{-a\left|k\right|}\\
+ & = & C\left(1+\sum_{k=1}^{\infty}e^{-\left(t+a\right)k}+\sum_{1}^{\infty}e^{\left(t-a\right)k}\right)\\
+ & = & \tanh\left(\frac{a}{2}\right)\left(1+\frac{e^{-\left(t+a\right)}}{1-e^{-\left(t+a\right)}}+\frac{e^{t-a}}{1-e^{t-a}}\right)\\
+ & = & \frac{\tanh\left(\frac{a}{2}\right)\sinh a}{\cosh a-\cosh t}.\end{eqnarray*}
+
+\end_inset
+
+ Thus,
+\begin_inset Formula \[
+\mu_{n}^{\prime}=M^{\left(n\right)}\left(0\right)=\left[1+\left(-1\right)^{n}\right]\textrm{Li}_{-n}\left(e^{-a}\right)\]
+
+\end_inset
+
+ where
+\begin_inset Formula $\textrm{Li}_{-n}\left(z\right)$
+\end_inset
+
+ is the polylogarithm function of order
+\begin_inset Formula $-n$
+\end_inset
+
+ evaluated at
+\begin_inset Formula $z.$
+\end_inset
+
+
+\begin_inset Formula \[
+h\left[X\right]=-\log\left(\tanh\left(\frac{a}{2}\right)\right)+\frac{a}{\sinh a}\]
+
+\end_inset
+
+
+\layout Section
+
+Discrete Gaussian*
+\layout Standard
+
+Defined for all
+\begin_inset Formula $\mu$
+\end_inset
+
+ and
+\begin_inset Formula $\lambda>0$
+\end_inset
+
+ and
+\begin_inset Formula $k$
+\end_inset
+
+
+\begin_inset Formula \[
+p\left(k;\mu,\lambda\right)=\frac{1}{Z\left(\lambda\right)}\exp\left[-\lambda\left(k-\mu\right)^{2}\right]\]
+
+\end_inset
+
+ where
+\begin_inset Formula \[
+Z\left(\lambda\right)=\sum_{k=-\infty}^{\infty}\exp\left[-\lambda k^{2}\right]\]
+
+\end_inset
+
+
+\begin_inset Formula \begin{eqnarray*}
+\mu & = & \mu\\
+\mu_{2} & = & -\frac{\partial}{\partial\lambda}\log Z\left(\lambda\right)\\
+ & = & G\left(\lambda\right)e^{-\lambda}\end{eqnarray*}
+
+\end_inset
+
+ where
+\begin_inset Formula $G\left(0\right)\rightarrow\infty$
+\end_inset
+
+ and
+\begin_inset Formula $G\left(\infty\right)\rightarrow2$
+\end_inset
+
+ with a minimum less than 2 near
+\begin_inset Formula $\lambda=1$
+\end_inset
+
+
+\begin_inset Formula \[
+G\left(\lambda\right)=\frac{1}{Z\left(\lambda\right)}\sum_{k=-\infty}^{\infty}k^{2}\exp\left[-\lambda\left(k+1\right)\left(k-1\right)\right]\]
+
+\end_inset
+
+
+\the_end
From scipy-svn at scipy.org Tue Jun 1 01:51:53 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 00:51:53 -0500 (CDT)
Subject: [Scipy-svn] r6463 - branches/0.8.x/scipy/stats
Message-ID: <20100601055153.9A92339CAEA@scipy.org>
Author: oliphant
Date: 2010-06-01 00:51:53 -0500 (Tue, 01 Jun 2010)
New Revision: 6463
Modified:
branches/0.8.x/scipy/stats/distributions.py
Log:
Add documentationfor more new methods of distributions. Fix an indentation bug in expect. Use super when calling parent class methods.
Modified: branches/0.8.x/scipy/stats/distributions.py
===================================================================
--- branches/0.8.x/scipy/stats/distributions.py 2010-06-01 04:09:28 UTC (rev 6462)
+++ branches/0.8.x/scipy/stats/distributions.py 2010-06-01 05:51:53 UTC (rev 6463)
@@ -5,10 +5,14 @@
# SciPy Developers 2004-2010
#
+import math
+from copy import copy
+
from scipy.misc import comb, derivative
from scipy import special
from scipy import optimize
from scipy import integrate
+from scipy.special import gammaln as gamln
import inspect
from numpy import alltrue, where, arange, putmask, \
@@ -22,8 +26,6 @@
import numpy as np
import numpy.random as mtrand
from numpy import flatnonzero as nonzero
-from scipy.special import gammaln as gamln
-from copy import copy
import vonmises_cython
def _moment(data, n, mu=None):
@@ -562,34 +564,112 @@
return vals
def median(self, *args, **kwds):
+ """
+ Median of the distribution.
+
+ Parameters
+ ----------
+ arg1, arg2, arg3,... : array-like
+ The shape parameter(s) for the distribution (see docstring of the
+ instance object for more information)
+ loc : array-like, optional
+ location parameter (default=0)
+ scale : array-like, optional
+ scale parameter (default=1)
+
+ Returns
+ -------
+ median : float
+ the median of the distribution.
+
+ See Also
+ --------
+ self.ppf --- inverse of the CDF
+ """
return self.ppf(0.5, *args, **kwds)
def mean(self, *args, **kwds):
+ """
+ Mean of the distribution
+
+ Parameters
+ ----------
+ arg1, arg2, arg3,... : array-like
+ The shape parameter(s) for the distribution (see docstring of the
+ instance object for more information)
+ loc : array-like, optional
+ location parameter (default=0)
+ scale : array-like, optional
+ scale parameter (default=1)
+
+ Returns
+ -------
+ mean : float
+ the mean of the distribution
+ """
kwds['moments'] = 'm'
res = self.stats(*args, **kwds)
if isinstance(res, ndarray) and res.ndim == 0:
return res[()]
+ return res
def var(self, *args, **kwds):
+ """
+ Variance of the distribution
+
+ Parameters
+ ----------
+ arg1, arg2, arg3,... : array-like
+ The shape parameter(s) for the distribution (see docstring of the
+ instance object for more information)
+ loc : array-like, optional
+ location parameter (default=0)
+ scale : array-like, optional
+ scale parameter (default=1)
+
+ Returns
+ -------
+ var : float
+ the variance of the distribution
+
+ """
kwds['moments'] = 'v'
res = self.stats(*args, **kwds)
if isinstance(res, ndarray) and res.ndim == 0:
return res[()]
- else:
- return res
+ return res
def std(self, *args, **kwds):
+ """
+ Standard deviation of the distribution.
+
+ Parameters
+ ----------
+ arg1, arg2, arg3,... : array-like
+ The shape parameter(s) for the distribution (see docstring of the
+ instance object for more information)
+ loc : array-like, optional
+ location parameter (default=0)
+ scale : array-like, optional
+ scale parameter (default=1)
+
+ Returns
+ -------
+ std : float
+ standard deviation of the distribution
+
+ """
kwds['moments'] = 'v'
- res = sqrt(self.stats(*args, **kwds))
+ res = math.sqrt(self.stats(*args, **kwds))
return res
def interval(self, alpha, *args, **kwds):
- """Confidence interval centered on the median
+ """Confidence interval with equal areas around the median
Parameters
----------
alpha : array-like float in [0,1]
- Probability that an rv will be drawn from the returned range
+ Probability that an rv will be drawn from the returned range
arg1, arg2, ... : array-like
The shape parameter(s) for the distribution (see docstring of the instance
object for more information)
@@ -1606,10 +1686,10 @@
"""
if func is None:
def fun(x, *args):
- return x*self.pdf(x, *args, loc=loc, scale=scale)
+ return x*self.pdf(x, *args, **{'loc':loc, 'scale':scale})
else:
def fun(x, *args):
- return func(x)*self.pdf(x, *args, loc=loc, scale=scale)
+ return func(x)*self.pdf(x, *args, **{'loc':loc, 'scale':scale})
if lb is None:
lb = (self.a - loc)/(1.0*scale)
if ub is None:
@@ -1618,8 +1698,8 @@
invfac = self.sf(lb,*args) - self.sf(ub,*args)
else:
invfac = 1.0
- kwds['args'] = args
- return integrate.quad(fun, lb, ub, **kwds)[0] / invfac
+ kwds['args'] = args
+ return integrate.quad(fun, lb, ub, **kwds)[0] / invfac
_EULER = 0.577215664901532860606512090082402431042 # -special.psi(1)
@@ -1659,7 +1739,6 @@
# loc = mu, scale = std
# Keep these implementations out of the class definition so they can be reused
# by other distributions.
-import math
_norm_pdf_C = math.sqrt(2*pi)
_norm_pdf_logC = math.log(_norm_pdf_C)
def _norm_pdf(x):
@@ -4482,7 +4561,7 @@
moment_tol=1e-8,values=None,inc=1,longname=None,
shapes=None, extradoc=None):
- rv_generic.__init__(self)
+ super(rv_generic,self).__init__()
if badvalue is None:
badvalue = nan
@@ -5181,15 +5260,15 @@
Parameters
----------
- fn : function (default: identity mapping)
+ fn : function (default: identity mapping)
Function for which integral is calculated. Takes only one argument.
- args : tuple
+ args : tuple
argument (parameters) of the distribution
- optional keyword parameters
- lb, ub : numbers
+ optional keyword parameters
+ lb, ub : numbers
lower and upper bound for integration, default is set to the support
of the distribution, lb and ub are inclusive (ul<=k<=ub)
- conditional : boolean (False)
+ conditional : boolean (False)
If true then the expectation is corrected by the conditional
probability of the integration interval. The return value is the
expectation of the function, conditional on being in the given
@@ -5197,7 +5276,7 @@
Returns
-------
- expected value : float
+ expected value : float
Notes
-----
@@ -5214,7 +5293,6 @@
(a maximum of suppnmin+1000 positive plus suppnmin+1000 negative integers
are evaluated)
-
"""
#moment_tol = 1e-12 # increase compared to self.moment_tol,
@@ -5274,7 +5352,7 @@
pos -= self.inc
count += 1
if count > maxcount:
- # replace with proper warning
+ # fixme: replace with proper warning
print 'sum did not converge'
return tot/invfac
From scipy-svn at scipy.org Tue Jun 1 01:54:12 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 00:54:12 -0500 (CDT)
Subject: [Scipy-svn] r6464 - trunk/scipy/stats
Message-ID: <20100601055412.2E27839CAEA@scipy.org>
Author: oliphant
Date: 2010-06-01 00:54:12 -0500 (Tue, 01 Jun 2010)
New Revision: 6464
Modified:
trunk/scipy/stats/distributions.py
Log:
Apply docstring clean-up patch and bug fixes in 0.8.x branch to trunk.
Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py 2010-06-01 05:51:53 UTC (rev 6463)
+++ trunk/scipy/stats/distributions.py 2010-06-01 05:54:12 UTC (rev 6464)
@@ -5,10 +5,14 @@
# SciPy Developers 2004-2010
#
+import math
+from copy import copy
+
from scipy.misc import comb, derivative
from scipy import special
from scipy import optimize
from scipy import integrate
+from scipy.special import gammaln as gamln
import inspect
from numpy import alltrue, where, arange, putmask, \
@@ -22,8 +26,6 @@
import numpy as np
import numpy.random as mtrand
from numpy import flatnonzero as nonzero
-from scipy.special import gammaln as gamln
-from copy import copy
import vonmises_cython
def _moment(data, n, mu=None):
@@ -562,34 +564,112 @@
return vals
def median(self, *args, **kwds):
+ """
+ Median of the distribution.
+
+ Parameters
+ ----------
+ arg1, arg2, arg3,... : array-like
+ The shape parameter(s) for the distribution (see docstring of the
+ instance object for more information)
+ loc : array-like, optional
+ location parameter (default=0)
+ scale : array-like, optional
+ scale parameter (default=1)
+
+ Returns
+ -------
+ median : float
+ the median of the distribution.
+
+ See Also
+ --------
+ self.ppf --- inverse of the CDF
+ """
return self.ppf(0.5, *args, **kwds)
def mean(self, *args, **kwds):
+ """
+ Mean of the distribution
+
+ Parameters
+ ----------
+ arg1, arg2, arg3,... : array-like
+ The shape parameter(s) for the distribution (see docstring of the
+ instance object for more information)
+ loc : array-like, optional
+ location parameter (default=0)
+ scale : array-like, optional
+ scale parameter (default=1)
+
+ Returns
+ -------
+ mean : float
+ the mean of the distribution
+ """
kwds['moments'] = 'm'
res = self.stats(*args, **kwds)
if isinstance(res, ndarray) and res.ndim == 0:
return res[()]
+ return res
def var(self, *args, **kwds):
+ """
+ Variance of the distribution
+
+ Parameters
+ ----------
+ arg1, arg2, arg3,... : array-like
+ The shape parameter(s) for the distribution (see docstring of the
+ instance object for more information)
+ loc : array-like, optional
+ location parameter (default=0)
+ scale : array-like, optional
+ scale parameter (default=1)
+
+ Returns
+ -------
+ var : float
+ the variance of the distribution
+
+ """
kwds['moments'] = 'v'
res = self.stats(*args, **kwds)
if isinstance(res, ndarray) and res.ndim == 0:
return res[()]
- else:
- return res
+ return res
def std(self, *args, **kwds):
+ """
+ Standard deviation of the distribution.
+
+ Parameters
+ ----------
+ arg1, arg2, arg3,... : array-like
+ The shape parameter(s) for the distribution (see docstring of the
+ instance object for more information)
+ loc : array-like, optional
+ location parameter (default=0)
+ scale : array-like, optional
+ scale parameter (default=1)
+
+ Returns
+ -------
+ std : float
+ standard deviation of the distribution
+
+ """
kwds['moments'] = 'v'
- res = sqrt(self.stats(*args, **kwds))
+ res = math.sqrt(self.stats(*args, **kwds))
return res
def interval(self, alpha, *args, **kwds):
- """Confidence interval centered on the median
+ """Confidence interval with equal areas around the median
Parameters
----------
alpha : array-like float in [0,1]
- Probability that an rv will be drawn from the returned range
+ Probability that an rv will be drawn from the returned range
arg1, arg2, ... : array-like
The shape parameter(s) for the distribution (see docstring of the instance
object for more information)
@@ -1605,10 +1685,10 @@
"""
if func is None:
def fun(x, *args):
- return x*self.pdf(x, *args, loc=loc, scale=scale)
+ return x*self.pdf(x, *args, **{'loc':loc, 'scale':scale})
else:
def fun(x, *args):
- return func(x)*self.pdf(x, *args, loc=loc, scale=scale)
+ return func(x)*self.pdf(x, *args, **{'loc':loc, 'scale':scale})
if lb is None:
lb = (self.a - loc)/(1.0*scale)
if ub is None:
@@ -1617,8 +1697,8 @@
invfac = self.sf(lb,*args) - self.sf(ub,*args)
else:
invfac = 1.0
- kwds['args'] = args
- return integrate.quad(fun, lb, ub, **kwds)[0] / invfac
+ kwds['args'] = args
+ return integrate.quad(fun, lb, ub, **kwds)[0] / invfac
_EULER = 0.577215664901532860606512090082402431042 # -special.psi(1)
@@ -1658,7 +1738,6 @@
# loc = mu, scale = std
# Keep these implementations out of the class definition so they can be reused
# by other distributions.
-import math
_norm_pdf_C = math.sqrt(2*pi)
_norm_pdf_logC = math.log(_norm_pdf_C)
def _norm_pdf(x):
@@ -4481,7 +4560,7 @@
moment_tol=1e-8,values=None,inc=1,longname=None,
shapes=None, extradoc=None):
- rv_generic.__init__(self)
+ super(rv_generic,self).__init__()
if badvalue is None:
badvalue = nan
@@ -5180,15 +5259,15 @@
Parameters
----------
- fn : function (default: identity mapping)
+ fn : function (default: identity mapping)
Function for which integral is calculated. Takes only one argument.
- args : tuple
+ args : tuple
argument (parameters) of the distribution
- optional keyword parameters
- lb, ub : numbers
+ optional keyword parameters
+ lb, ub : numbers
lower and upper bound for integration, default is set to the support
of the distribution, lb and ub are inclusive (ul<=k<=ub)
- conditional : boolean (False)
+ conditional : boolean (False)
If true then the expectation is corrected by the conditional
probability of the integration interval. The return value is the
expectation of the function, conditional on being in the given
@@ -5196,7 +5275,7 @@
Returns
-------
- expected value : float
+ expected value : float
Notes
-----
@@ -5213,7 +5292,6 @@
(a maximum of suppnmin+1000 positive plus suppnmin+1000 negative integers
are evaluated)
-
"""
#moment_tol = 1e-12 # increase compared to self.moment_tol,
@@ -5273,7 +5351,7 @@
pos -= self.inc
count += 1
if count > maxcount:
- # replace with proper warning
+ # fixme: replace with proper warning
print 'sum did not converge'
return tot/invfac
From scipy-svn at scipy.org Tue Jun 1 03:58:06 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 02:58:06 -0500 (CDT)
Subject: [Scipy-svn] r6465 - branches/0.8.x/scipy/stats/tests
Message-ID: <20100601075806.DFE0639CAF8@scipy.org>
Author: oliphant
Date: 2010-06-01 02:58:06 -0500 (Tue, 01 Jun 2010)
New Revision: 6465
Modified:
branches/0.8.x/scipy/stats/tests/test_distributions.py
Log:
Add test for fit method including test for fixing number of parameters. Testing interface and calling only. Does not do a statistical test on the computed parameters.
Modified: branches/0.8.x/scipy/stats/tests/test_distributions.py
===================================================================
--- branches/0.8.x/scipy/stats/tests/test_distributions.py 2010-06-01 05:54:12 UTC (rev 6464)
+++ branches/0.8.x/scipy/stats/tests/test_distributions.py 2010-06-01 07:58:06 UTC (rev 6465)
@@ -380,6 +380,47 @@
assert_array_equal(b, a)
assert_array_equal(c, [2] * numpy.size(a))
+import sys
+class TestFitMethod(TestCase):
+ skip = ['ncf']
+ def test_fit(self):
+ for func, dist, args, alpha in test_all_distributions():
+ if dist in self.skip:
+ continue
+ distfunc = getattr(stats, dist)
+ res = distfunc.rvs(*args, size=200)
+ vals = distfunc.fit(res)
+ if dist in ['erlang', 'frechet']:
+ assert(len(vals)==len(args))
+ else:
+ assert(len(vals) == 2+len(args))
+ def test_fix_fit(self):
+ for func, dist, args, alpha in test_all_distributions():
+ # Not sure why 'ncf', and 'beta' are failing
+ # erlang and frechet have different len(args) than distfunc.numargs
+ if dist in self.skip + ['erlang', 'frechet', 'beta']:
+ continue
+ distfunc = getattr(stats, dist)
+ res = distfunc.rvs(*args, size=200)
+ vals = distfunc.fit(res,floc=0)
+ vals2 = distfunc.fit(res,fscale=1)
+ assert(len(vals) == 2+len(args))
+ assert(vals[-2] == 0)
+ assert(vals2[-1] == 1)
+ assert(len(vals2) == 2+len(args))
+ if len(args) > 0:
+ vals3 = distfunc.fit(res, f0=args[0])
+ assert(len(vals3) == 2+len(args))
+ assert(vals3[0] == args[0])
+ if len(args) > 1:
+ vals4 = distfunc.fit(res, f1=args[1])
+ assert(len(vals4) == 2+len(args))
+ assert(vals4[1] == args[1])
+ if len(args) > 2:
+ vals5 = distfunc.fit(res, f2=args[2])
+ assert(len(vals5) == 2+len(args))
+ assert(vals5[2] == args[2])
+
if __name__ == "__main__":
run_module_suite()
From scipy-svn at scipy.org Tue Jun 1 03:59:21 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 02:59:21 -0500 (CDT)
Subject: [Scipy-svn] r6466 - trunk/scipy/stats/tests
Message-ID: <20100601075921.0D2B339CAF8@scipy.org>
Author: oliphant
Date: 2010-06-01 02:59:20 -0500 (Tue, 01 Jun 2010)
New Revision: 6466
Modified:
trunk/scipy/stats/tests/test_distributions.py
Log:
Add tests for fit method including fixing input parameters.
Modified: trunk/scipy/stats/tests/test_distributions.py
===================================================================
--- trunk/scipy/stats/tests/test_distributions.py 2010-06-01 07:58:06 UTC (rev 6465)
+++ trunk/scipy/stats/tests/test_distributions.py 2010-06-01 07:59:20 UTC (rev 6466)
@@ -380,6 +380,47 @@
assert_array_equal(b, a)
assert_array_equal(c, [2] * numpy.size(a))
+import sys
+class TestFitMethod(TestCase):
+ skip = ['ncf']
+ def test_fit(self):
+ for func, dist, args, alpha in test_all_distributions():
+ if dist in self.skip:
+ continue
+ distfunc = getattr(stats, dist)
+ res = distfunc.rvs(*args, size=200)
+ vals = distfunc.fit(res)
+ if dist in ['erlang', 'frechet']:
+ assert(len(vals)==len(args))
+ else:
+ assert(len(vals) == 2+len(args))
+ def test_fix_fit(self):
+ for func, dist, args, alpha in test_all_distributions():
+ # Not sure why 'ncf', and 'beta' are failing
+ # erlang and frechet have different len(args) than distfunc.numargs
+ if dist in self.skip + ['erlang', 'frechet', 'beta']:
+ continue
+ distfunc = getattr(stats, dist)
+ res = distfunc.rvs(*args, size=200)
+ vals = distfunc.fit(res,floc=0)
+ vals2 = distfunc.fit(res,fscale=1)
+ assert(len(vals) == 2+len(args))
+ assert(vals[-2] == 0)
+ assert(vals2[-1] == 1)
+ assert(len(vals2) == 2+len(args))
+ if len(args) > 0:
+ vals3 = distfunc.fit(res, f0=args[0])
+ assert(len(vals3) == 2+len(args))
+ assert(vals3[0] == args[0])
+ if len(args) > 1:
+ vals4 = distfunc.fit(res, f1=args[1])
+ assert(len(vals4) == 2+len(args))
+ assert(vals4[1] == args[1])
+ if len(args) > 2:
+ vals5 = distfunc.fit(res, f2=args[2])
+ assert(len(vals5) == 2+len(args))
+ assert(vals5[2] == args[2])
+
if __name__ == "__main__":
run_module_suite()
From scipy-svn at scipy.org Tue Jun 1 04:47:56 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 03:47:56 -0500 (CDT)
Subject: [Scipy-svn] r6467 - in trunk: doc/release scipy/linalg
scipy/linalg/tests
Message-ID: <20100601084756.98B9339CAF5@scipy.org>
Author: warren.weckesser
Date: 2010-06-01 03:47:56 -0500 (Tue, 01 Jun 2010)
New Revision: 6467
Modified:
trunk/doc/release/0.8.0-notes.rst
trunk/scipy/linalg/basic.py
trunk/scipy/linalg/tests/test_basic.py
Log:
DEP: Revert a change made to solveh_banded, and add a deprecation warning so the change can eventually be made for the 0.9 release.
Modified: trunk/doc/release/0.8.0-notes.rst
===================================================================
--- trunk/doc/release/0.8.0-notes.rst 2010-06-01 07:59:20 UTC (rev 6466)
+++ trunk/doc/release/0.8.0-notes.rst 2010-06-01 08:47:56 UTC (rev 6467)
@@ -61,6 +61,12 @@
The modules `helpmod`, `ppimport` and `pexec` from `scipy.misc` are deprecated.
They will be removed from SciPy in version 0.9.
+Additional deprecations
+-----------------------
+* linalg: The function `solveh_banded` currently returns a tuple containing
+ the Cholesky factorization and the solution to the linear system. In
+ SciPy 0.9, the return value will be just the solution.
+
New features
============
Modified: trunk/scipy/linalg/basic.py
===================================================================
--- trunk/scipy/linalg/basic.py 2010-06-01 07:59:20 UTC (rev 6466)
+++ trunk/scipy/linalg/basic.py 2010-06-01 08:47:56 UTC (rev 6467)
@@ -6,6 +6,8 @@
__all__ = ['solve', 'solveh_banded', 'solve_banded',
'inv', 'det', 'lstsq', 'pinv', 'pinv2']
+from warnings import warn
+
from numpy import asarray, zeros, sum, conjugate, dot, transpose, \
asarray_chkfinite, single
import numpy
@@ -165,10 +167,20 @@
Returns
-------
+ c : array, shape (u+1, M)
+ Cholesky factorization of a, in the same banded format as ab
x : array, shape (M,) or (M, K)
The solution to the system a x = b
+
+ Notes
+ -----
+ The inclusion of `c` in the return value is deprecated. In SciPy
+ version 0.9, the return value will be the solution `x` only.
"""
+ warn("In SciPy 0.9, the return value of solveh_banded will be "
+ "the solution x only.", DeprecationWarning)
+
ab, b = map(asarray_chkfinite, (ab, b))
# Validate shapes.
@@ -183,7 +195,7 @@
if info < 0:
raise ValueError('illegal value in %d-th argument of internal pbsv'
% -info)
- return x
+ return c, x
# matrix inversion
Modified: trunk/scipy/linalg/tests/test_basic.py
===================================================================
--- trunk/scipy/linalg/tests/test_basic.py 2010-06-01 07:59:20 UTC (rev 6466)
+++ trunk/scipy/linalg/tests/test_basic.py 2010-06-01 08:47:56 UTC (rev 6467)
@@ -19,6 +19,8 @@
python tests/test_basic.py
"""
+import warnings
+
from numpy import arange, array, dot, zeros, identity, conjugate, transpose, \
float32, zeros_like
import numpy.linalg as linalg
@@ -98,8 +100,12 @@
class TestSolveHBanded(TestCase):
+ # solveh_banded currently has a DeprecationWarning. When the warning
+ # is removed in scipy 0.9, the 'ignore' filters and the test for the
+ # warning can be removed.
def test_01_upper(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1]
# [ 1 4 1] X = [4]
@@ -107,10 +113,17 @@
# with the RHS as a 1D array.
ab = array([[-99, 1.0, 1.0], [4.0, 4.0, 4.0]])
b = array([1.0, 4.0, 1.0])
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
assert_array_almost_equal(x, [0.0, 1.0, 0.0])
+ # Remove the following part of this test in scipy 0.9.
+ a = array([[4.0, 1.0, 0.0], [1.0, 4.0, 1.0], [0.0, 1.0, 4.0]])
+ fac = zeros_like(a)
+ fac[range(3),range(3)] = c[-1]
+ fac[(0,1),(1,2)] = c[0,1:]
+ assert_array_almost_equal(a, dot(fac.T, fac))
def test_02_upper(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1 4]
# [ 1 4 1] X = [4 2]
@@ -121,13 +134,14 @@
b = array([[1.0, 4.0],
[4.0, 2.0],
[1.0, 4.0]])
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
expected = array([[0.0, 1.0],
[1.0, 0.0],
[0.0, 1.0]])
assert_array_almost_equal(x, expected)
def test_03_upper(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1]
# [ 1 4 1] X = [4]
@@ -135,10 +149,11 @@
# with the RHS as a 2D array with shape (3,1).
ab = array([[-99, 1.0, 1.0], [4.0, 4.0, 4.0]])
b = array([1.0, 4.0, 1.0]).reshape(-1,1)
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
assert_array_almost_equal(x, array([0.0, 1.0, 0.0]).reshape(-1,1))
def test_01_lower(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1]
# [ 1 4 1] X = [4]
@@ -147,10 +162,11 @@
ab = array([[4.0, 4.0, 4.0],
[1.0, 1.0, -99]])
b = array([1.0, 4.0, 1.0])
- x = solveh_banded(ab, b, lower=True)
+ c, x = solveh_banded(ab, b, lower=True)
assert_array_almost_equal(x, [0.0, 1.0, 0.0])
def test_02_lower(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1 4]
# [ 1 4 1] X = [4 2]
@@ -161,13 +177,14 @@
b = array([[1.0, 4.0],
[4.0, 2.0],
[1.0, 4.0]])
- x = solveh_banded(ab, b, lower=True)
+ c, x = solveh_banded(ab, b, lower=True)
expected = array([[0.0, 1.0],
[1.0, 0.0],
[0.0, 1.0]])
assert_array_almost_equal(x, expected)
def test_01_float32(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1]
# [ 1 4 1] X = [4]
@@ -175,10 +192,11 @@
#
ab = array([[-99, 1.0, 1.0], [4.0, 4.0, 4.0]], dtype=float32)
b = array([1.0, 4.0, 1.0], dtype=float32)
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
assert_array_almost_equal(x, [0.0, 1.0, 0.0])
def test_02_float32(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1 4]
# [ 1 4 1] X = [4 2]
@@ -189,13 +207,14 @@
b = array([[1.0, 4.0],
[4.0, 2.0],
[1.0, 4.0]], dtype=float32)
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
expected = array([[0.0, 1.0],
[1.0, 0.0],
[0.0, 1.0]])
assert_array_almost_equal(x, expected)
def test_01_complex(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 -j 0] [ -j]
# [ j 4 -j] X = [4-j]
@@ -203,10 +222,11 @@
#
ab = array([[-99, -1.0j, -1.0j], [4.0, 4.0, 4.0]])
b = array([-1.0j, 4.0-1j, 4+1j])
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
assert_array_almost_equal(x, [0.0, 1.0, 1.0])
def test_02_complex(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 -j 0] [ -j 4j]
# [ j 4 -j] X = [4-j -1-j]
@@ -217,13 +237,15 @@
b = array([[ -1j, 4.0j],
[4.0-1j, -1.0-1j],
[4.0+1j, 4.0]])
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
expected = array([[0.0, 1.0j],
[1.0, 0.0],
[1.0, 1.0]])
assert_array_almost_equal(x, expected)
def test_bad_shapes(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+
ab = array([[-99, 1.0, 1.0],
[4.0, 4.0, 4.0]])
b = array([[1.0, 4.0],
@@ -232,6 +254,12 @@
assert_raises(ValueError, solveh_banded, ab, [1.0, 2.0])
assert_raises(ValueError, solveh_banded, ab, [1.0])
+ def test_00_deprecation_warning(self):
+ warnings.simplefilter('error', category=DeprecationWarning)
+ ab = array([[-99, 1.0, 1.0], [4.0, 4.0, 4.0]])
+ b = array([1.0, 4.0, 1.0])
+ assert_raises(DeprecationWarning, solveh_banded, ab, b)
+ #warnings.simplefilter('ignore', category=DeprecationWarning)
class TestSolve(TestCase):
From scipy-svn at scipy.org Tue Jun 1 04:50:32 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 03:50:32 -0500 (CDT)
Subject: [Scipy-svn] r6468 - trunk/scipy/linalg/tests
Message-ID: <20100601085032.1ACBB39CAF5@scipy.org>
Author: warren.weckesser
Date: 2010-06-01 03:50:31 -0500 (Tue, 01 Jun 2010)
New Revision: 6468
Modified:
trunk/scipy/linalg/tests/test_basic.py
Log:
Removed commented line of code.
Modified: trunk/scipy/linalg/tests/test_basic.py
===================================================================
--- trunk/scipy/linalg/tests/test_basic.py 2010-06-01 08:47:56 UTC (rev 6467)
+++ trunk/scipy/linalg/tests/test_basic.py 2010-06-01 08:50:31 UTC (rev 6468)
@@ -259,8 +259,8 @@
ab = array([[-99, 1.0, 1.0], [4.0, 4.0, 4.0]])
b = array([1.0, 4.0, 1.0])
assert_raises(DeprecationWarning, solveh_banded, ab, b)
- #warnings.simplefilter('ignore', category=DeprecationWarning)
+
class TestSolve(TestCase):
def test_20Feb04_bug(self):
From scipy-svn at scipy.org Tue Jun 1 05:14:38 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 04:14:38 -0500 (CDT)
Subject: [Scipy-svn] r6469 - in branches/0.8.x: doc/release scipy/linalg
scipy/linalg/tests
Message-ID: <20100601091438.4737639CAFC@scipy.org>
Author: warren.weckesser
Date: 2010-06-01 04:14:38 -0500 (Tue, 01 Jun 2010)
New Revision: 6469
Modified:
branches/0.8.x/doc/release/0.8.0-notes.rst
branches/0.8.x/scipy/linalg/basic.py
branches/0.8.x/scipy/linalg/tests/test_basic.py
Log:
DEP: Revert a change made to solveh_banded, and add a deprecation warning so the change can eventually be made for the 0.9 release.
Modified: branches/0.8.x/doc/release/0.8.0-notes.rst
===================================================================
--- branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-01 08:50:31 UTC (rev 6468)
+++ branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-01 09:14:38 UTC (rev 6469)
@@ -61,6 +61,12 @@
The modules `helpmod`, `ppimport` and `pexec` from `scipy.misc` are deprecated.
They will be removed from SciPy in version 0.9.
+Additional deprecations
+-----------------------
+* linalg: The function `solveh_banded` currently returns a tuple containing
+ the Cholesky factorization and the solution to the linear system. In
+ SciPy 0.9, the return value will be just the solution.
+
New features
============
Modified: branches/0.8.x/scipy/linalg/basic.py
===================================================================
--- branches/0.8.x/scipy/linalg/basic.py 2010-06-01 08:50:31 UTC (rev 6468)
+++ branches/0.8.x/scipy/linalg/basic.py 2010-06-01 09:14:38 UTC (rev 6469)
@@ -6,6 +6,8 @@
__all__ = ['solve', 'solveh_banded', 'solve_banded',
'inv', 'det', 'lstsq', 'pinv', 'pinv2']
+from warnings import warn
+
from numpy import asarray, zeros, sum, conjugate, dot, transpose, \
asarray_chkfinite, single
import numpy
@@ -165,10 +167,20 @@
Returns
-------
+ c : array, shape (u+1, M)
+ Cholesky factorization of a, in the same banded format as ab
x : array, shape (M,) or (M, K)
The solution to the system a x = b
+
+ Notes
+ -----
+ The inclusion of `c` in the return value is deprecated. In SciPy
+ version 0.9, the return value will be the solution `x` only.
"""
+ warn("In SciPy 0.9, the return value of solveh_banded will be "
+ "the solution x only.", DeprecationWarning)
+
ab, b = map(asarray_chkfinite, (ab, b))
# Validate shapes.
@@ -183,7 +195,7 @@
if info < 0:
raise ValueError('illegal value in %d-th argument of internal pbsv'
% -info)
- return x
+ return c, x
# matrix inversion
Modified: branches/0.8.x/scipy/linalg/tests/test_basic.py
===================================================================
--- branches/0.8.x/scipy/linalg/tests/test_basic.py 2010-06-01 08:50:31 UTC (rev 6468)
+++ branches/0.8.x/scipy/linalg/tests/test_basic.py 2010-06-01 09:14:38 UTC (rev 6469)
@@ -19,6 +19,8 @@
python tests/test_basic.py
"""
+import warnings
+
from numpy import arange, array, dot, zeros, identity, conjugate, transpose, \
float32, zeros_like
import numpy.linalg as linalg
@@ -98,8 +100,12 @@
class TestSolveHBanded(TestCase):
+ # solveh_banded currently has a DeprecationWarning. When the warning
+ # is removed in scipy 0.9, the 'ignore' filters and the test for the
+ # warning can be removed.
def test_01_upper(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1]
# [ 1 4 1] X = [4]
@@ -107,10 +113,17 @@
# with the RHS as a 1D array.
ab = array([[-99, 1.0, 1.0], [4.0, 4.0, 4.0]])
b = array([1.0, 4.0, 1.0])
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
assert_array_almost_equal(x, [0.0, 1.0, 0.0])
+ # Remove the following part of this test in scipy 0.9.
+ a = array([[4.0, 1.0, 0.0], [1.0, 4.0, 1.0], [0.0, 1.0, 4.0]])
+ fac = zeros_like(a)
+ fac[range(3),range(3)] = c[-1]
+ fac[(0,1),(1,2)] = c[0,1:]
+ assert_array_almost_equal(a, dot(fac.T, fac))
def test_02_upper(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1 4]
# [ 1 4 1] X = [4 2]
@@ -121,13 +134,14 @@
b = array([[1.0, 4.0],
[4.0, 2.0],
[1.0, 4.0]])
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
expected = array([[0.0, 1.0],
[1.0, 0.0],
[0.0, 1.0]])
assert_array_almost_equal(x, expected)
def test_03_upper(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1]
# [ 1 4 1] X = [4]
@@ -135,10 +149,11 @@
# with the RHS as a 2D array with shape (3,1).
ab = array([[-99, 1.0, 1.0], [4.0, 4.0, 4.0]])
b = array([1.0, 4.0, 1.0]).reshape(-1,1)
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
assert_array_almost_equal(x, array([0.0, 1.0, 0.0]).reshape(-1,1))
def test_01_lower(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1]
# [ 1 4 1] X = [4]
@@ -147,10 +162,11 @@
ab = array([[4.0, 4.0, 4.0],
[1.0, 1.0, -99]])
b = array([1.0, 4.0, 1.0])
- x = solveh_banded(ab, b, lower=True)
+ c, x = solveh_banded(ab, b, lower=True)
assert_array_almost_equal(x, [0.0, 1.0, 0.0])
def test_02_lower(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1 4]
# [ 1 4 1] X = [4 2]
@@ -161,13 +177,14 @@
b = array([[1.0, 4.0],
[4.0, 2.0],
[1.0, 4.0]])
- x = solveh_banded(ab, b, lower=True)
+ c, x = solveh_banded(ab, b, lower=True)
expected = array([[0.0, 1.0],
[1.0, 0.0],
[0.0, 1.0]])
assert_array_almost_equal(x, expected)
def test_01_float32(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1]
# [ 1 4 1] X = [4]
@@ -175,10 +192,11 @@
#
ab = array([[-99, 1.0, 1.0], [4.0, 4.0, 4.0]], dtype=float32)
b = array([1.0, 4.0, 1.0], dtype=float32)
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
assert_array_almost_equal(x, [0.0, 1.0, 0.0])
def test_02_float32(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 1 0] [1 4]
# [ 1 4 1] X = [4 2]
@@ -189,13 +207,14 @@
b = array([[1.0, 4.0],
[4.0, 2.0],
[1.0, 4.0]], dtype=float32)
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
expected = array([[0.0, 1.0],
[1.0, 0.0],
[0.0, 1.0]])
assert_array_almost_equal(x, expected)
def test_01_complex(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 -j 0] [ -j]
# [ j 4 -j] X = [4-j]
@@ -203,10 +222,11 @@
#
ab = array([[-99, -1.0j, -1.0j], [4.0, 4.0, 4.0]])
b = array([-1.0j, 4.0-1j, 4+1j])
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
assert_array_almost_equal(x, [0.0, 1.0, 1.0])
def test_02_complex(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
# Solve
# [ 4 -j 0] [ -j 4j]
# [ j 4 -j] X = [4-j -1-j]
@@ -217,13 +237,15 @@
b = array([[ -1j, 4.0j],
[4.0-1j, -1.0-1j],
[4.0+1j, 4.0]])
- x = solveh_banded(ab, b)
+ c, x = solveh_banded(ab, b)
expected = array([[0.0, 1.0j],
[1.0, 0.0],
[1.0, 1.0]])
assert_array_almost_equal(x, expected)
def test_bad_shapes(self):
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+
ab = array([[-99, 1.0, 1.0],
[4.0, 4.0, 4.0]])
b = array([[1.0, 4.0],
@@ -232,7 +254,13 @@
assert_raises(ValueError, solveh_banded, ab, [1.0, 2.0])
assert_raises(ValueError, solveh_banded, ab, [1.0])
+ def test_00_deprecation_warning(self):
+ warnings.simplefilter('error', category=DeprecationWarning)
+ ab = array([[-99, 1.0, 1.0], [4.0, 4.0, 4.0]])
+ b = array([1.0, 4.0, 1.0])
+ assert_raises(DeprecationWarning, solveh_banded, ab, b)
+
class TestSolve(TestCase):
def test_20Feb04_bug(self):
From scipy-svn at scipy.org Tue Jun 1 05:18:15 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 04:18:15 -0500 (CDT)
Subject: [Scipy-svn] r6470 - trunk/doc/release
Message-ID: <20100601091815.30BDC39CAFD@scipy.org>
Author: warren.weckesser
Date: 2010-06-01 04:18:15 -0500 (Tue, 01 Jun 2010)
New Revision: 6470
Modified:
trunk/doc/release/0.8.0-notes.rst
Log:
DOC: Fix release notes--return value of solveh_banded is not changed.
Modified: trunk/doc/release/0.8.0-notes.rst
===================================================================
--- trunk/doc/release/0.8.0-notes.rst 2010-06-01 09:14:38 UTC (rev 6469)
+++ trunk/doc/release/0.8.0-notes.rst 2010-06-01 09:18:15 UTC (rev 6470)
@@ -126,9 +126,6 @@
The function `block_diag` was enhanced to accept scalar and 1D arguments,
along with the usual 2D arguments.
-The function `solveh_banded` no longer returns the Cholesky factorization. It
-returns just the solution.
-
ARPACK-based sparse SVD
-----------------------
From scipy-svn at scipy.org Tue Jun 1 05:19:15 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 04:19:15 -0500 (CDT)
Subject: [Scipy-svn] r6471 - branches/0.8.x/doc/release
Message-ID: <20100601091915.BE58839CAFD@scipy.org>
Author: warren.weckesser
Date: 2010-06-01 04:19:15 -0500 (Tue, 01 Jun 2010)
New Revision: 6471
Modified:
branches/0.8.x/doc/release/0.8.0-notes.rst
Log:
DOC: Fix release notes--return value of solveh_banded is not changed.
Modified: branches/0.8.x/doc/release/0.8.0-notes.rst
===================================================================
--- branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-01 09:18:15 UTC (rev 6470)
+++ branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-01 09:19:15 UTC (rev 6471)
@@ -126,9 +126,6 @@
The function `block_diag` was enhanced to accept scalar and 1D arguments,
along with the usual 2D arguments.
-The function `solveh_banded` no longer returns the Cholesky factorization. It
-returns just the solution.
-
ARPACK-based sparse SVD
-----------------------
From scipy-svn at scipy.org Tue Jun 1 06:10:30 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 05:10:30 -0500 (CDT)
Subject: [Scipy-svn] r6472 - in trunk/scipy/stats: . tests
Message-ID: <20100601101030.73FC439CAF5@scipy.org>
Author: oliphant
Date: 2010-06-01 05:10:30 -0500 (Tue, 01 Jun 2010)
New Revision: 6472
Modified:
trunk/scipy/stats/distributions.py
trunk/scipy/stats/tests/test_continuous_basic.py
Log:
Add tests for logpdf, logcdf, and logsf plus one fix.
Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py 2010-06-01 09:19:15 UTC (rev 6471)
+++ trunk/scipy/stats/distributions.py 2010-06-01 10:10:30 UTC (rev 6472)
@@ -2332,7 +2332,7 @@
return exp(1)*b*xbm1 * exp(xb - exp(xb))
def _logpdf(self, x, b):
xb = x**(b-1.0)*x
- return log(b) + (b-1.0)*log(x) + xb - exp(xb)
+ return 1 + log(b) + (b-1.0)*log(x) + xb - exp(xb)
def _cdf(self, x, b):
xb = arr(x**b)
return -expm1(-expm1(xb))
@@ -4282,11 +4282,13 @@
%(example)s
"""
def _rvs(self):
- return invnorm_gen._rvs(self, 1.0)
+ return mtrand.wald(1.0, 1.0, size=self._size)
def _pdf(self, x):
- return invnorm.pdf(x,1.0)
+ return invnorm._pdf(x, 1.0)
+ def _logpdf(self, x):
+ return invnorm._logpdf(x, 1.0)
def _cdf(self, x):
- return invnorm.cdf(x,1,0)
+ return invnorm._logcdf(x, 1.0)
def _stats(self):
return 1.0, 1.0, 3.0, 15.0
wald = wald_gen(a=0.0, name="wald", extradoc="""
Modified: trunk/scipy/stats/tests/test_continuous_basic.py
===================================================================
--- trunk/scipy/stats/tests/test_continuous_basic.py 2010-06-01 09:19:15 UTC (rev 6471)
+++ trunk/scipy/stats/tests/test_continuous_basic.py 2010-06-01 10:10:30 UTC (rev 6472)
@@ -175,11 +175,14 @@
yield check_cdf_ppf, distfn, arg, distname
yield check_sf_isf, distfn, arg, distname
yield check_pdf, distfn, arg, distname
+ if distname in ['wald']: continue
+ yield check_pdf_logpdf, distfn, arg, distname
+ yield check_cdf_logcdf, distfn, arg, distname
+ yield check_sf_logsf, distfn, arg, distname
if distname in distmissing:
alpha = 0.01
- yield check_distribution_rvs, dist, args, alpha, rvs
+ # yield check_distribution_rvs, dist, args, alpha, rvs
-
@npt.dec.slow
def test_cont_basic_slow():
# same as above for slow distributions
@@ -202,14 +205,14 @@
yield check_cdf_ppf, distfn, arg, distname
yield check_sf_isf, distfn, arg, distname
yield check_pdf, distfn, arg, distname
+ yield check_pdf_logpdf, distfn, arg, distname
+ yield check_cdf_logcdf, distfn, arg, distname
+ yield check_sf_logsf, distfn, arg, distname
#yield check_oth, distfn, arg # is still missing
if distname in distmissing:
alpha = 0.01
yield check_distribution_rvs, dist, args, alpha, rvs
-
-
-
def check_moment(distfn, arg, m, v, msg):
m1 = distfn.moment(1,*arg)
m2 = distfn.moment(2,*arg)
@@ -314,7 +317,37 @@
npt.assert_almost_equal(pdfv, cdfdiff,
decimal=DECIMAL, err_msg= msg + ' - cdf-pdf relationship')
+def check_pdf_logpdf(distfn, args, msg):
+ # compares pdf at several points with the log of the pdf
+ points = np.array([0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8])
+ vals = distfn.ppf(points, *args)
+ pdf = distfn.pdf(vals, *args)
+ logpdf = distfn.logpdf(vals, *args)
+ pdf = pdf[pdf != 0]
+ logpdf = logpdf[np.isfinite(logpdf)]
+ npt.assert_almost_equal(np.log(pdf), logpdf, decimal=7, err_msg=msg + " - logpdf-log(pdf) relationship")
+def check_sf_logsf(distfn, args, msg):
+ # compares sf at several points with the log of the sf
+ points = np.array([0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8])
+ vals = distfn.ppf(points, *args)
+ sf = distfn.sf(vals, *args)
+ logsf = distfn.logsf(vals, *args)
+ sf = sf[sf != 0]
+ logsf = logsf[np.isfinite(logsf)]
+ npt.assert_almost_equal(np.log(sf), logsf, decimal=7, err_msg=msg + " - logsf-log(sf) relationship")
+
+def check_cdf_logcdf(distfn, args, msg):
+ # compares cdf at several points with the log of the cdf
+ points = np.array([0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8])
+ vals = distfn.ppf(points, *args)
+ cdf = distfn.cdf(vals, *args)
+ logcdf = distfn.logcdf(vals, *args)
+ cdf = cdf[cdf != 0]
+ logcdf = logcdf[np.isfinite(logcdf)]
+ npt.assert_almost_equal(np.log(cdf), logcdf, decimal=7, err_msg=msg + " - logcdf-log(cdf) relationship")
+
+
def check_distribution_rvs(dist, args, alpha, rvs):
#test from scipy.stats.tests
#this version reuses existing random variables
From scipy-svn at scipy.org Tue Jun 1 06:11:33 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 05:11:33 -0500 (CDT)
Subject: [Scipy-svn] r6473 - in branches/0.8.x/scipy/stats: . tests
Message-ID: <20100601101133.EF5B139CAF5@scipy.org>
Author: oliphant
Date: 2010-06-01 05:11:33 -0500 (Tue, 01 Jun 2010)
New Revision: 6473
Modified:
branches/0.8.x/scipy/stats/distributions.py
branches/0.8.x/scipy/stats/tests/test_continuous_basic.py
Log:
Add tests for logpdf, logcdf, and logsf to 0.8.x branch from trunk
Modified: branches/0.8.x/scipy/stats/distributions.py
===================================================================
--- branches/0.8.x/scipy/stats/distributions.py 2010-06-01 10:10:30 UTC (rev 6472)
+++ branches/0.8.x/scipy/stats/distributions.py 2010-06-01 10:11:33 UTC (rev 6473)
@@ -2333,7 +2333,7 @@
return exp(1)*b*xbm1 * exp(xb - exp(xb))
def _logpdf(self, x, b):
xb = x**(b-1.0)*x
- return log(b) + (b-1.0)*log(x) + xb - exp(xb)
+ return 1 + log(b) + (b-1.0)*log(x) + xb - exp(xb)
def _cdf(self, x, b):
xb = arr(x**b)
return -expm1(-expm1(xb))
@@ -4283,11 +4283,13 @@
%(example)s
"""
def _rvs(self):
- return invnorm_gen._rvs(self, 1.0)
+ return mtrand.wald(1.0, 1.0, size=self._size)
def _pdf(self, x):
- return invnorm.pdf(x,1.0)
+ return invnorm._pdf(x, 1.0)
+ def _logpdf(self, x):
+ return invnorm._logpdf(x, 1.0)
def _cdf(self, x):
- return invnorm.cdf(x,1,0)
+ return invnorm._logcdf(x, 1.0)
def _stats(self):
return 1.0, 1.0, 3.0, 15.0
wald = wald_gen(a=0.0, name="wald", extradoc="""
Modified: branches/0.8.x/scipy/stats/tests/test_continuous_basic.py
===================================================================
--- branches/0.8.x/scipy/stats/tests/test_continuous_basic.py 2010-06-01 10:10:30 UTC (rev 6472)
+++ branches/0.8.x/scipy/stats/tests/test_continuous_basic.py 2010-06-01 10:11:33 UTC (rev 6473)
@@ -175,11 +175,14 @@
yield check_cdf_ppf, distfn, arg, distname
yield check_sf_isf, distfn, arg, distname
yield check_pdf, distfn, arg, distname
+ if distname in ['wald']: continue
+ yield check_pdf_logpdf, distfn, arg, distname
+ yield check_cdf_logcdf, distfn, arg, distname
+ yield check_sf_logsf, distfn, arg, distname
if distname in distmissing:
alpha = 0.01
- yield check_distribution_rvs, dist, args, alpha, rvs
+ # yield check_distribution_rvs, dist, args, alpha, rvs
-
@npt.dec.slow
def test_cont_basic_slow():
# same as above for slow distributions
@@ -202,14 +205,14 @@
yield check_cdf_ppf, distfn, arg, distname
yield check_sf_isf, distfn, arg, distname
yield check_pdf, distfn, arg, distname
+ yield check_pdf_logpdf, distfn, arg, distname
+ yield check_cdf_logcdf, distfn, arg, distname
+ yield check_sf_logsf, distfn, arg, distname
#yield check_oth, distfn, arg # is still missing
if distname in distmissing:
alpha = 0.01
yield check_distribution_rvs, dist, args, alpha, rvs
-
-
-
def check_moment(distfn, arg, m, v, msg):
m1 = distfn.moment(1,*arg)
m2 = distfn.moment(2,*arg)
@@ -314,7 +317,37 @@
npt.assert_almost_equal(pdfv, cdfdiff,
decimal=DECIMAL, err_msg= msg + ' - cdf-pdf relationship')
+def check_pdf_logpdf(distfn, args, msg):
+ # compares pdf at several points with the log of the pdf
+ points = np.array([0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8])
+ vals = distfn.ppf(points, *args)
+ pdf = distfn.pdf(vals, *args)
+ logpdf = distfn.logpdf(vals, *args)
+ pdf = pdf[pdf != 0]
+ logpdf = logpdf[np.isfinite(logpdf)]
+ npt.assert_almost_equal(np.log(pdf), logpdf, decimal=7, err_msg=msg + " - logpdf-log(pdf) relationship")
+def check_sf_logsf(distfn, args, msg):
+ # compares sf at several points with the log of the sf
+ points = np.array([0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8])
+ vals = distfn.ppf(points, *args)
+ sf = distfn.sf(vals, *args)
+ logsf = distfn.logsf(vals, *args)
+ sf = sf[sf != 0]
+ logsf = logsf[np.isfinite(logsf)]
+ npt.assert_almost_equal(np.log(sf), logsf, decimal=7, err_msg=msg + " - logsf-log(sf) relationship")
+
+def check_cdf_logcdf(distfn, args, msg):
+ # compares cdf at several points with the log of the cdf
+ points = np.array([0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8])
+ vals = distfn.ppf(points, *args)
+ cdf = distfn.cdf(vals, *args)
+ logcdf = distfn.logcdf(vals, *args)
+ cdf = cdf[cdf != 0]
+ logcdf = logcdf[np.isfinite(logcdf)]
+ npt.assert_almost_equal(np.log(cdf), logcdf, decimal=7, err_msg=msg + " - logcdf-log(cdf) relationship")
+
+
def check_distribution_rvs(dist, args, alpha, rvs):
#test from scipy.stats.tests
#this version reuses existing random variables
From scipy-svn at scipy.org Tue Jun 1 19:13:36 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 18:13:36 -0500 (CDT)
Subject: [Scipy-svn] r6474 - branches/0.8.x/scipy/stats
Message-ID: <20100601231336.B92F039CAE9@scipy.org>
Author: oliphant
Date: 2010-06-01 18:13:36 -0500 (Tue, 01 Jun 2010)
New Revision: 6474
Modified:
branches/0.8.x/scipy/stats/distributions.py
Log:
Remove accidental committal of old rv_continuous template.
Modified: branches/0.8.x/scipy/stats/distributions.py
===================================================================
--- branches/0.8.x/scipy/stats/distributions.py 2010-06-01 10:11:33 UTC (rev 6473)
+++ branches/0.8.x/scipy/stats/distributions.py 2010-06-01 23:13:36 UTC (rev 6474)
@@ -731,70 +731,6 @@
-------
...
- generic.pdf(x,,loc=0,scale=1)
- - probability density function
-
- generic.cdf(x,,loc=0,scale=1)
- - cumulative density function
-
- generic.sf(x,,loc=0,scale=1)
- - survival function (1-cdf --- sometimes more accurate)
-
- generic.ppf(q,,loc=0,scale=1)
- - percent point function (inverse of cdf --- percentiles)
-
- generic.median(,loc=0,scale=1)
- - median of the distribution
-
- generic.isf(q,,loc=0,scale=1)
- - inverse survival function (inverse of sf)
-
- generic.stats(,loc=0,scale=1,moments='mv')
- - mean('m'), variance('v'), skew('s'), and/or kurtosis('k')
-
- generic.mean(,loc=0,scale=1)
- - mean of the distribution
-
- generic.var(,loc=0,scale=1)
- - variance of the distribution
-
- generic.std(,loc=0,scale=1)
- - standard deviation of the distribution
-
- generic.entropy(,loc=0,scale=1)
- - (differential) entropy of the RV.
-
- generic.fit(data,,loc=0,scale=1)
- - Parameter estimates for generic data
-
- generic.interval(alpha, ,loc=0,scale=1)
- - Return an alpha confidence interval centered on the median
-
- Alternatively, the object may be called (as a function) to fix the shape,
- location, and scale parameters returning a "frozen" continuous RV object:
-
- rv = generic(,loc=0,scale=1)
- - frozen RV object with the same methods but holding the given shape, location, and scale fixed
-
- Parameters
- ----------
- x : array-like
- quantiles
- q : array-like
- lower or upper tail probability
- : array-like
- shape parameters
- loc : array-like, optional
- location parameter (default=0)
- scale : array-like, optional
- scale parameter (default=1)
- size : int or tuple of ints, optional
- shape of random variates (default computed from input arguments )
- moments : string, optional
- composed of letters ['mvsk'] specifying which moments to compute where
- 'm' = mean, 'v' = variance, 's' = (Fisher's) skew and
- 'k' = (Fisher's) kurtosis. (default='mv')
-
Examples
--------
To create a new Gaussian distribution, we would do the following::
From scipy-svn at scipy.org Tue Jun 1 19:26:07 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 18:26:07 -0500 (CDT)
Subject: [Scipy-svn] r6475 - trunk/scipy/stats
Message-ID: <20100601232607.96DA139CB07@scipy.org>
Author: oliphant
Date: 2010-06-01 18:26:07 -0500 (Tue, 01 Jun 2010)
New Revision: 6475
Modified:
trunk/scipy/stats/distributions.py
Log:
Fix Python < 2.6 syntax in the trunk.
Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py 2010-06-01 23:13:36 UTC (rev 6474)
+++ trunk/scipy/stats/distributions.py 2010-06-01 23:26:07 UTC (rev 6475)
@@ -1903,7 +1903,6 @@
return a, b, floc, fscale
else: # do general fit
return super(beta_gen, self).fit(data, *args, **kwds)
-
beta = beta_gen(a=0.0, b=1.0, name='beta',shapes='a, b',extradoc="""
Beta distribution
@@ -5104,7 +5103,7 @@
signature = inspect.getargspec(self._stats.im_func)
if (signature[2] is not None) or ('moments' in signature[0]):
- mu, mu2, g1, g2 = self._stats(*args,moments=moments)
+ mu, mu2, g1, g2 = self._stats(*args,**{'moments':moments})
else:
mu, mu2, g1, g2 = self._stats(*args)
if g1 is None:
From scipy-svn at scipy.org Tue Jun 1 19:27:33 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 1 Jun 2010 18:27:33 -0500 (CDT)
Subject: [Scipy-svn] r6476 - trunk/scipy/stats
Message-ID: <20100601232733.7D28A39CAE9@scipy.org>
Author: oliphant
Date: 2010-06-01 18:27:33 -0500 (Tue, 01 Jun 2010)
New Revision: 6476
Modified:
trunk/scipy/stats/distributions.py
Log:
Remove accidentally applied rv_continuous doc template.
Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py 2010-06-01 23:26:07 UTC (rev 6475)
+++ trunk/scipy/stats/distributions.py 2010-06-01 23:27:33 UTC (rev 6476)
@@ -731,70 +731,6 @@
-------
...
- generic.pdf(x,,loc=0,scale=1)
- - probability density function
-
- generic.cdf(x,,loc=0,scale=1)
- - cumulative density function
-
- generic.sf(x,,loc=0,scale=1)
- - survival function (1-cdf --- sometimes more accurate)
-
- generic.ppf(q,,loc=0,scale=1)
- - percent point function (inverse of cdf --- percentiles)
-
- generic.median(,loc=0,scale=1)
- - median of the distribution
-
- generic.isf(q,,loc=0,scale=1)
- - inverse survival function (inverse of sf)
-
- generic.stats(,loc=0,scale=1,moments='mv')
- - mean('m'), variance('v'), skew('s'), and/or kurtosis('k')
-
- generic.mean(,loc=0,scale=1)
- - mean of the distribution
-
- generic.var(,loc=0,scale=1)
- - variance of the distribution
-
- generic.std(,loc=0,scale=1)
- - standard deviation of the distribution
-
- generic.entropy(,loc=0,scale=1)
- - (differential) entropy of the RV.
-
- generic.fit(data,,loc=0,scale=1)
- - Parameter estimates for generic data
-
- generic.interval(alpha, ,loc=0,scale=1)
- - Return an alpha confidence interval centered on the median
-
- Alternatively, the object may be called (as a function) to fix the shape,
- location, and scale parameters returning a "frozen" continuous RV object:
-
- rv = generic(,loc=0,scale=1)
- - frozen RV object with the same methods but holding the given shape, location, and scale fixed
-
- Parameters
- ----------
- x : array-like
- quantiles
- q : array-like
- lower or upper tail probability
- : array-like
- shape parameters
- loc : array-like, optional
- location parameter (default=0)
- scale : array-like, optional
- scale parameter (default=1)
- size : int or tuple of ints, optional
- shape of random variates (default computed from input arguments )
- moments : string, optional
- composed of letters ['mvsk'] specifying which moments to compute where
- 'm' = mean, 'v' = variance, 's' = (Fisher's) skew and
- 'k' = (Fisher's) kurtosis. (default='mv')
-
Examples
--------
To create a new Gaussian distribution, we would do the following::
From scipy-svn at scipy.org Wed Jun 2 19:50:28 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Wed, 2 Jun 2010 18:50:28 -0500 (CDT)
Subject: [Scipy-svn] r6477 - in trunk: doc/release scipy/constants
scipy/constants/tests
Message-ID: <20100602235028.4474E39CAE9@scipy.org>
Author: warren.weckesser
Date: 2010-06-02 18:50:28 -0500 (Wed, 02 Jun 2010)
New Revision: 6477
Modified:
trunk/doc/release/0.8.0-notes.rst
trunk/scipy/constants/codata.py
trunk/scipy/constants/tests/test_codata.py
Log:
Add a keyword argument to constants.codata.find, so the change in behavior can go through a proper deprecation cycle.
Modified: trunk/doc/release/0.8.0-notes.rst
===================================================================
--- trunk/doc/release/0.8.0-notes.rst 2010-06-01 23:27:33 UTC (rev 6476)
+++ trunk/doc/release/0.8.0-notes.rst 2010-06-02 23:50:28 UTC (rev 6477)
@@ -66,6 +66,10 @@
* linalg: The function `solveh_banded` currently returns a tuple containing
the Cholesky factorization and the solution to the linear system. In
SciPy 0.9, the return value will be just the solution.
+* The function `constants.codata.find` will generate a DeprecationWarning.
+ In Scipy version 0.8.0, the keyword argument 'disp' was added to the
+ function, with the default value 'True'. In 0.9.0, the default will be
+ 'False'.
New features
============
@@ -133,10 +137,13 @@
scipy.sparse.linalg.eigen.arpack. It is based on using an symmetric solver on
, and as such may not be very precise.
-Better behavior for `scipy.constants.find` (scipy.constants)
-------------------------------------------------------------
-The function `scipy.constants.find` was modified to return the list of keys
-that it finds, instead of printing them and returning None.
+Alternative behavior available for `scipy.constants.find`
+---------------------------------------------------------
+The keyword argument `disp` was added to the function `scipy.constants.find`,
+with the default value `True`. When `disp` is `True`, the behavior is the
+same as in Scipy version 0.7. When `False`, the function returns the list of
+keys instead of printing them. (In SciPy version 0.9, the default will be
+reversed.)
Incomplete sparse LU decompositions
-----------------------------------
Modified: trunk/scipy/constants/codata.py
===================================================================
--- trunk/scipy/constants/codata.py 2010-06-01 23:27:33 UTC (rev 6476)
+++ trunk/scipy/constants/codata.py 2010-06-02 23:50:28 UTC (rev 6477)
@@ -20,6 +20,7 @@
find(sub) prints out a list of keys containing the string sub.
"""
+import warnings
import string
from math import pi, sqrt
__all__ = ['physical_constants', 'value', 'unit', 'precision', 'find']
@@ -442,19 +443,24 @@
"""
return physical_constants[key][2] / physical_constants[key][0]
-def find(sub) :
+
+def find(sub, disp=True) :
"""
- Return list of codata.physical_constant keys containing a given string
+ Find the codata.physical_constant keys containing a given string.
Parameters
----------
sub : str or unicode
Sub-string to search keys for
+ disp : bool
+ If True, print the keys that are found, and return None.
+ Otherwise, return the list of keys without printing anything.
Returns
-------
- keys : list
- List of keys containing `sub`
+ keys : None or list
+ If `disp` is False, the list of keys is returned. Otherwise, None
+ is returned.
See Also
--------
@@ -462,6 +468,9 @@
dictionary literal object, does not itself possess a docstring.
"""
+ warnings.warn("In Scipy version 0.8.0, the keyword argument 'disp' was added to "
+ "find(), with the default value True. In 0.9.0, the default will be False.",
+ DeprecationWarning)
l_sub = string.lower(sub)
result = []
for key in physical_constants :
@@ -469,8 +478,14 @@
if l_sub in l_key:
result.append(key)
result.sort()
- return result
+ if disp:
+ for key in result:
+ print key
+ return
+ else:
+ return result
+
#table is lacking some digits for exact values: calculate from definition
c = value('speed of light in vacuum')
Modified: trunk/scipy/constants/tests/test_codata.py
===================================================================
--- trunk/scipy/constants/tests/test_codata.py 2010-06-01 23:27:33 UTC (rev 6476)
+++ trunk/scipy/constants/tests/test_codata.py 2010-06-02 23:50:28 UTC (rev 6477)
@@ -1,16 +1,20 @@
+import warnings
+
from scipy.constants import find
from numpy.testing import assert_equal
def test_find():
- keys = find('weak mixing')
+ warnings.simplefilter('ignore', DeprecationWarning)
+
+ keys = find('weak mixing', disp=False)
assert_equal(keys, ['weak mixing angle'])
- keys = find('qwertyuiop')
+ keys = find('qwertyuiop', disp=False)
assert_equal(keys, [])
- keys = find('natural unit')
+ keys = find('natural unit', disp=False)
assert_equal(keys, sorted(['natural unit of velocity',
'natural unit of action',
'natural unit of action in eV s',
From scipy-svn at scipy.org Wed Jun 2 19:58:30 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Wed, 2 Jun 2010 18:58:30 -0500 (CDT)
Subject: [Scipy-svn] r6478 - in branches/0.8.x: doc/release scipy/constants
scipy/constants/tests
Message-ID: <20100602235830.775BC39CAE9@scipy.org>
Author: warren.weckesser
Date: 2010-06-02 18:58:30 -0500 (Wed, 02 Jun 2010)
New Revision: 6478
Modified:
branches/0.8.x/doc/release/0.8.0-notes.rst
branches/0.8.x/scipy/constants/codata.py
branches/0.8.x/scipy/constants/tests/test_codata.py
Log:
0.8.x branch: Add a keyword argument to constants.codata.find, so the change in behavior can go through a proper deprecation cycle.
Modified: branches/0.8.x/doc/release/0.8.0-notes.rst
===================================================================
--- branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-02 23:50:28 UTC (rev 6477)
+++ branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-02 23:58:30 UTC (rev 6478)
@@ -66,6 +66,10 @@
* linalg: The function `solveh_banded` currently returns a tuple containing
the Cholesky factorization and the solution to the linear system. In
SciPy 0.9, the return value will be just the solution.
+* The function `constants.codata.find` will generate a DeprecationWarning.
+ In Scipy version 0.8.0, the keyword argument 'disp' was added to the
+ function, with the default value 'True'. In 0.9.0, the default will be
+ 'False'.
New features
============
@@ -133,10 +137,13 @@
scipy.sparse.linalg.eigen.arpack. It is based on using an symmetric solver on
, and as such may not be very precise.
-Better behavior for `scipy.constants.find` (scipy.constants)
-------------------------------------------------------------
-The function `scipy.constants.find` was modified to return the list of keys
-that it finds, instead of printing them and returning None.
+Alternative behavior available for `scipy.constants.find`
+---------------------------------------------------------
+The keyword argument `disp` was added to the function `scipy.constants.find`,
+with the default value `True`. When `disp` is `True`, the behavior is the
+same as in Scipy version 0.7. When `False`, the function returns the list of
+keys instead of printing them. (In SciPy version 0.9, the default will be
+reversed.)
Incomplete sparse LU decompositions
-----------------------------------
Modified: branches/0.8.x/scipy/constants/codata.py
===================================================================
--- branches/0.8.x/scipy/constants/codata.py 2010-06-02 23:50:28 UTC (rev 6477)
+++ branches/0.8.x/scipy/constants/codata.py 2010-06-02 23:58:30 UTC (rev 6478)
@@ -20,6 +20,7 @@
find(sub) prints out a list of keys containing the string sub.
"""
+import warnings
import string
from math import pi, sqrt
__all__ = ['physical_constants', 'value', 'unit', 'precision', 'find']
@@ -442,19 +443,24 @@
"""
return physical_constants[key][2] / physical_constants[key][0]
-def find(sub) :
+
+def find(sub, disp=True) :
"""
- Return list of codata.physical_constant keys containing a given string
+ Find the codata.physical_constant keys containing a given string.
Parameters
----------
sub : str or unicode
Sub-string to search keys for
+ disp : bool
+ If True, print the keys that are found, and return None.
+ Otherwise, return the list of keys without printing anything.
Returns
-------
- keys : list
- List of keys containing `sub`
+ keys : None or list
+ If `disp` is False, the list of keys is returned. Otherwise, None
+ is returned.
See Also
--------
@@ -462,6 +468,9 @@
dictionary literal object, does not itself possess a docstring.
"""
+ warnings.warn("In Scipy version 0.8.0, the keyword argument 'disp' was added to "
+ "find(), with the default value True. In 0.9.0, the default will be False.",
+ DeprecationWarning)
l_sub = string.lower(sub)
result = []
for key in physical_constants :
@@ -469,8 +478,14 @@
if l_sub in l_key:
result.append(key)
result.sort()
- return result
+ if disp:
+ for key in result:
+ print key
+ return
+ else:
+ return result
+
#table is lacking some digits for exact values: calculate from definition
c = value('speed of light in vacuum')
Modified: branches/0.8.x/scipy/constants/tests/test_codata.py
===================================================================
--- branches/0.8.x/scipy/constants/tests/test_codata.py 2010-06-02 23:50:28 UTC (rev 6477)
+++ branches/0.8.x/scipy/constants/tests/test_codata.py 2010-06-02 23:58:30 UTC (rev 6478)
@@ -1,16 +1,20 @@
+import warnings
+
from scipy.constants import find
from numpy.testing import assert_equal
def test_find():
- keys = find('weak mixing')
+ warnings.simplefilter('ignore', DeprecationWarning)
+
+ keys = find('weak mixing', disp=False)
assert_equal(keys, ['weak mixing angle'])
- keys = find('qwertyuiop')
+ keys = find('qwertyuiop', disp=False)
assert_equal(keys, [])
- keys = find('natural unit')
+ keys = find('natural unit', disp=False)
assert_equal(keys, sorted(['natural unit of velocity',
'natural unit of action',
'natural unit of action in eV s',
From scipy-svn at scipy.org Wed Jun 2 22:36:51 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Wed, 2 Jun 2010 21:36:51 -0500 (CDT)
Subject: [Scipy-svn] r6479 - trunk/scipy/signal
Message-ID: <20100603023651.7DB2D39CAF5@scipy.org>
Author: warren.weckesser
Date: 2010-06-02 21:36:51 -0500 (Wed, 02 Jun 2010)
New Revision: 6479
Modified:
trunk/scipy/signal/waveforms.py
Log:
Fix signal.chirp to maintain old behavior, and add deprecation warnings.
Modified: trunk/scipy/signal/waveforms.py
===================================================================
--- trunk/scipy/signal/waveforms.py 2010-06-02 23:58:30 UTC (rev 6478)
+++ trunk/scipy/signal/waveforms.py 2010-06-03 02:36:51 UTC (rev 6479)
@@ -5,8 +5,9 @@
# Rewrote much of chirp()
# Added sweep_poly()
+import warnings
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
- exp, cos, sin, polyval, polyint
+ exp, cos, sin, polyval, polyint, size, log10
def sawtooth(t,width=1):
"""
@@ -186,9 +187,83 @@
return yI, yQ, yenv
-def chirp(t, f0, t1, f1, method='linear', phi=0, vertex_zero=True):
+# This is chirp from scipy 0.7:
+
+def old_chirp(t, f0=0, t1=1, f1=100, method='linear', phi=0, qshape=None):
"""Frequency-swept cosine generator.
+ Parameters
+ ----------
+ t : ndarray
+ Times at which to evaluate the waveform.
+ f0 : float or ndarray, optional
+ Frequency (in Hz) of the waveform at time 0. If `f0` is an
+ ndarray, it specifies the frequency change as a polynomial in
+ `t` (see Notes below).
+ t1 : float, optional
+ Time at which `f1` is specified.
+ f1 : float, optional
+ Frequency (in Hz) of the waveform at time `t1`.
+ method : {'linear', 'quadratic', 'logarithmic'}, optional
+ Kind of frequency sweep.
+ phi : float
+ Phase offset, in degrees.
+ qshape : {'convex', 'concave'}
+ If method is 'quadratic', `qshape` specifies its shape.
+
+ Notes
+ -----
+ If `f0` is an array, it forms the coefficients of a polynomial in
+ `t` (see `numpy.polval`). The polynomial determines the waveform
+ frequency change in time. In this case, the values of `f1`, `t1`,
+ `method`, and `qshape` are ignored.
+
+ This function is deprecated. It will be removed in SciPy version 0.9.0.
+ It exists so that during in version 0.8.0, the new chirp function can
+ call this function to preserve the old behavior of the quadratic chirp.
+ """
+ warnings.warn("The function old_chirp is deprecated, and will be removed in "
+ "SciPy 0.9", DeprecationWarning)
+ # Convert to radians.
+ phi *= pi / 180
+ if size(f0) > 1:
+ # We were given a polynomial.
+ return cos(2*pi*polyval(polyint(f0),t)+phi)
+ if method in ['linear','lin','li']:
+ beta = (f1-f0)/t1
+ phase_angle = 2*pi * (f0*t + 0.5*beta*t*t)
+ elif method in ['quadratic','quad','q']:
+ if qshape == 'concave':
+ mxf = max(f0,f1)
+ mnf = min(f0,f1)
+ f1,f0 = mxf, mnf
+ elif qshape == 'convex':
+ mxf = max(f0,f1)
+ mnf = min(f0,f1)
+ f1,f0 = mnf, mxf
+ else:
+ raise ValueError("qshape must be either 'concave' or 'convex' but "
+ "a value of %r was given." % qshape)
+ beta = (f1-f0)/t1/t1
+ phase_angle = 2*pi * (f0*t + beta*t*t*t/3)
+ elif method in ['logarithmic','log','lo']:
+ if f1 <= f0:
+ raise ValueError(
+ "For a logarithmic sweep, f1=%f must be larger than f0=%f."
+ % (f1, f0))
+ beta = log10(f1-f0)/t1
+ phase_angle = 2*pi * (f0*t + (pow(10,beta*t)-1)/(beta*log(10)))
+ else:
+ raise ValueError("method must be 'linear', 'quadratic', or "
+ "'logarithmic' but a value of %r was given." % method)
+
+ return cos(phase_angle + phi)
+
+
+def chirp(t, f0, t1, f1, method='linear', phi=0, vertex_zero=True,
+ qshape=None):
+ """Frequency-swept cosine generator.
+
In the following, 'Hz' should be interpreted as 'cycles per time unit';
there is no assumption here that the time unit is one second. The
important distinction is that the units of rotation are cycles, not
@@ -213,6 +288,10 @@
This parameter is only used when `method` is 'quadratic'.
It determines whether the vertex of the parabola that is the graph
of the frequency is at t=0 or t=t1.
+ qshape : str (deprecated)
+ If `method` is `quadratic` and `qshape` is not None, chirp() will
+ use scipy.signal.waveforms.old_chirp to compute the wave form.
+ This parameter is deprecated, and will be removed in SciPy 0.9.
Returns
-------
@@ -272,6 +351,24 @@
f1 must be positive, and f0 must be greater than f1.
"""
+ if size(f0) > 1:
+ # Preserve old behavior for one release cycle; this can be
+ # removed in scipy 0.9.
+ warnings.warn("Passing a list of polynomial coefficients in f0 to the "
+ "function chirp is deprecated. Use scipy.signal.sweep_poly.",
+ DeprecationWarning)
+ return old_chirp(t, f0, t1, f1, method, phi, qshape)
+
+ if method in ['quadratic', 'quad', 'q'] and qshape is not None:
+ # We must use the old version of the quadratic chirp. Fortunately,
+ # the old API *required* that qshape be either 'convex' or 'concave'
+ # if the quadratic method was selected--`None` would raise an error.
+ # So if the code reaches this point, we should use the old version.
+ warnings.warn("The qshape keyword argument is deprecated. "
+ "Use vertex_zero.", DeprecationWarning)
+ waveform = old_chirp(t, f0, t1, f1, method, phi, qshape)
+ return waveform
+
# 'phase' is computed in _chirp_phase, to make testing easier.
phase = _chirp_phase(t, f0, t1, f1, method, vertex_zero)
# Convert phi to radians.
From scipy-svn at scipy.org Wed Jun 2 22:37:25 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Wed, 2 Jun 2010 21:37:25 -0500 (CDT)
Subject: [Scipy-svn] r6480 - trunk/doc/release
Message-ID: <20100603023725.6EC6939CAF5@scipy.org>
Author: warren.weckesser
Date: 2010-06-02 21:37:25 -0500 (Wed, 02 Jun 2010)
New Revision: 6480
Modified:
trunk/doc/release/0.8.0-notes.rst
Log:
Update release notes to go along with r6479.
Modified: trunk/doc/release/0.8.0-notes.rst
===================================================================
--- trunk/doc/release/0.8.0-notes.rst 2010-06-03 02:36:51 UTC (rev 6479)
+++ trunk/doc/release/0.8.0-notes.rst 2010-06-03 02:37:25 UTC (rev 6480)
@@ -70,6 +70,11 @@
In Scipy version 0.8.0, the keyword argument 'disp' was added to the
function, with the default value 'True'. In 0.9.0, the default will be
'False'.
+* The `qshape` keyword argument of `signal.chirp` is deprecated. Use
+ the argument `vertex_zero` instead.
+* Passing the coefficients of a polynomial as the argument `f0` to
+ `signal.chirp` is deprecated. Use the function `signal.sweep_poly`
+ instead.
New features
============
@@ -198,9 +203,4 @@
The module `scipy.misc.limits` was removed.
-scipy.signal.chirp:
-* The `qshape` keyword argument was removed. Instead, use the `vertex_zero`
- argument.
-* `chirp` no longer handles the case of a general polynomial. This
- functionality has been moved to a new function, `sweep_poly`.
From scipy-svn at scipy.org Wed Jun 2 22:41:25 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Wed, 2 Jun 2010 21:41:25 -0500 (CDT)
Subject: [Scipy-svn] r6481 - in branches/0.8.x: doc/release scipy/signal
Message-ID: <20100603024125.299B539CAF5@scipy.org>
Author: warren.weckesser
Date: 2010-06-02 21:41:25 -0500 (Wed, 02 Jun 2010)
New Revision: 6481
Modified:
branches/0.8.x/doc/release/0.8.0-notes.rst
branches/0.8.x/scipy/signal/waveforms.py
Log:
0.8.x branch: Fix signal.chirp to maintain old behavior, and add deprecation warnings.
Modified: branches/0.8.x/doc/release/0.8.0-notes.rst
===================================================================
--- branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-03 02:37:25 UTC (rev 6480)
+++ branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-03 02:41:25 UTC (rev 6481)
@@ -70,6 +70,11 @@
In Scipy version 0.8.0, the keyword argument 'disp' was added to the
function, with the default value 'True'. In 0.9.0, the default will be
'False'.
+* The `qshape` keyword argument of `signal.chirp` is deprecated. Use
+ the argument `vertex_zero` instead.
+* Passing the coefficients of a polynomial as the argument `f0` to
+ `signal.chirp` is deprecated. Use the function `signal.sweep_poly`
+ instead.
New features
============
@@ -198,9 +203,4 @@
The module `scipy.misc.limits` was removed.
-scipy.signal.chirp:
-* The `qshape` keyword argument was removed. Instead, use the `vertex_zero`
- argument.
-* `chirp` no longer handles the case of a general polynomial. This
- functionality has been moved to a new function, `sweep_poly`.
Modified: branches/0.8.x/scipy/signal/waveforms.py
===================================================================
--- branches/0.8.x/scipy/signal/waveforms.py 2010-06-03 02:37:25 UTC (rev 6480)
+++ branches/0.8.x/scipy/signal/waveforms.py 2010-06-03 02:41:25 UTC (rev 6481)
@@ -5,8 +5,9 @@
# Rewrote much of chirp()
# Added sweep_poly()
+import warnings
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
- exp, cos, sin, polyval, polyint
+ exp, cos, sin, polyval, polyint, size, log10
def sawtooth(t,width=1):
"""
@@ -186,9 +187,83 @@
return yI, yQ, yenv
-def chirp(t, f0, t1, f1, method='linear', phi=0, vertex_zero=True):
+# This is chirp from scipy 0.7:
+
+def old_chirp(t, f0=0, t1=1, f1=100, method='linear', phi=0, qshape=None):
"""Frequency-swept cosine generator.
+ Parameters
+ ----------
+ t : ndarray
+ Times at which to evaluate the waveform.
+ f0 : float or ndarray, optional
+ Frequency (in Hz) of the waveform at time 0. If `f0` is an
+ ndarray, it specifies the frequency change as a polynomial in
+ `t` (see Notes below).
+ t1 : float, optional
+ Time at which `f1` is specified.
+ f1 : float, optional
+ Frequency (in Hz) of the waveform at time `t1`.
+ method : {'linear', 'quadratic', 'logarithmic'}, optional
+ Kind of frequency sweep.
+ phi : float
+ Phase offset, in degrees.
+ qshape : {'convex', 'concave'}
+ If method is 'quadratic', `qshape` specifies its shape.
+
+ Notes
+ -----
+ If `f0` is an array, it forms the coefficients of a polynomial in
+ `t` (see `numpy.polval`). The polynomial determines the waveform
+ frequency change in time. In this case, the values of `f1`, `t1`,
+ `method`, and `qshape` are ignored.
+
+ This function is deprecated. It will be removed in SciPy version 0.9.0.
+ It exists so that during in version 0.8.0, the new chirp function can
+ call this function to preserve the old behavior of the quadratic chirp.
+ """
+ warnings.warn("The function old_chirp is deprecated, and will be removed in "
+ "SciPy 0.9", DeprecationWarning)
+ # Convert to radians.
+ phi *= pi / 180
+ if size(f0) > 1:
+ # We were given a polynomial.
+ return cos(2*pi*polyval(polyint(f0),t)+phi)
+ if method in ['linear','lin','li']:
+ beta = (f1-f0)/t1
+ phase_angle = 2*pi * (f0*t + 0.5*beta*t*t)
+ elif method in ['quadratic','quad','q']:
+ if qshape == 'concave':
+ mxf = max(f0,f1)
+ mnf = min(f0,f1)
+ f1,f0 = mxf, mnf
+ elif qshape == 'convex':
+ mxf = max(f0,f1)
+ mnf = min(f0,f1)
+ f1,f0 = mnf, mxf
+ else:
+ raise ValueError("qshape must be either 'concave' or 'convex' but "
+ "a value of %r was given." % qshape)
+ beta = (f1-f0)/t1/t1
+ phase_angle = 2*pi * (f0*t + beta*t*t*t/3)
+ elif method in ['logarithmic','log','lo']:
+ if f1 <= f0:
+ raise ValueError(
+ "For a logarithmic sweep, f1=%f must be larger than f0=%f."
+ % (f1, f0))
+ beta = log10(f1-f0)/t1
+ phase_angle = 2*pi * (f0*t + (pow(10,beta*t)-1)/(beta*log(10)))
+ else:
+ raise ValueError("method must be 'linear', 'quadratic', or "
+ "'logarithmic' but a value of %r was given." % method)
+
+ return cos(phase_angle + phi)
+
+
+def chirp(t, f0, t1, f1, method='linear', phi=0, vertex_zero=True,
+ qshape=None):
+ """Frequency-swept cosine generator.
+
In the following, 'Hz' should be interpreted as 'cycles per time unit';
there is no assumption here that the time unit is one second. The
important distinction is that the units of rotation are cycles, not
@@ -213,6 +288,10 @@
This parameter is only used when `method` is 'quadratic'.
It determines whether the vertex of the parabola that is the graph
of the frequency is at t=0 or t=t1.
+ qshape : str (deprecated)
+ If `method` is `quadratic` and `qshape` is not None, chirp() will
+ use scipy.signal.waveforms.old_chirp to compute the wave form.
+ This parameter is deprecated, and will be removed in SciPy 0.9.
Returns
-------
@@ -272,6 +351,24 @@
f1 must be positive, and f0 must be greater than f1.
"""
+ if size(f0) > 1:
+ # Preserve old behavior for one release cycle; this can be
+ # removed in scipy 0.9.
+ warnings.warn("Passing a list of polynomial coefficients in f0 to the "
+ "function chirp is deprecated. Use scipy.signal.sweep_poly.",
+ DeprecationWarning)
+ return old_chirp(t, f0, t1, f1, method, phi, qshape)
+
+ if method in ['quadratic', 'quad', 'q'] and qshape is not None:
+ # We must use the old version of the quadratic chirp. Fortunately,
+ # the old API *required* that qshape be either 'convex' or 'concave'
+ # if the quadratic method was selected--`None` would raise an error.
+ # So if the code reaches this point, we should use the old version.
+ warnings.warn("The qshape keyword argument is deprecated. "
+ "Use vertex_zero.", DeprecationWarning)
+ waveform = old_chirp(t, f0, t1, f1, method, phi, qshape)
+ return waveform
+
# 'phase' is computed in _chirp_phase, to make testing easier.
phase = _chirp_phase(t, f0, t1, f1, method, vertex_zero)
# Convert phi to radians.
From scipy-svn at scipy.org Thu Jun 3 10:00:34 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Thu, 3 Jun 2010 09:00:34 -0500 (CDT)
Subject: [Scipy-svn] r6482 - in branches/0.8.x/scipy/stats: . tests
Message-ID: <20100603140034.1476939CB09@scipy.org>
Author: rgommers
Date: 2010-06-03 09:00:33 -0500 (Thu, 03 Jun 2010)
New Revision: 6482
Modified:
branches/0.8.x/scipy/stats/_support.py
branches/0.8.x/scipy/stats/distributions.py
branches/0.8.x/scipy/stats/morestats.py
branches/0.8.x/scipy/stats/stats.py
branches/0.8.x/scipy/stats/tests/test_continuous_basic.py
branches/0.8.x/scipy/stats/tests/test_distributions.py
Log:
REF: Remove recent stats commits since r6391, except for:
r6406, r6417, r6420, r6421, r6443
Modified: branches/0.8.x/scipy/stats/_support.py
===================================================================
--- branches/0.8.x/scipy/stats/_support.py 2010-06-03 02:41:25 UTC (rev 6481)
+++ branches/0.8.x/scipy/stats/_support.py 2010-06-03 14:00:33 UTC (rev 6482)
@@ -134,7 +134,8 @@
Format: adm (a,criterion) where criterion is like 'x[2]==37'\n"""
- lines = eval('filter(lambda x: '+criterion+',a)')
+ function = 'lines = filter(lambda x: '+criterion+',a)'
+ exec(function)
try:
lines = np.array(lines)
except:
Modified: branches/0.8.x/scipy/stats/distributions.py
===================================================================
--- branches/0.8.x/scipy/stats/distributions.py 2010-06-03 02:41:25 UTC (rev 6481)
+++ branches/0.8.x/scipy/stats/distributions.py 2010-06-03 14:00:33 UTC (rev 6482)
@@ -1,52 +1,32 @@
# Functions to implement several important functions for
# various Continous and Discrete Probability Distributions
#
-# Author: Travis Oliphant 2002-2010 with contributions from
-# SciPy Developers 2004-2010
+# Author: Travis Oliphant 2002-2003
#
-import math
-from copy import copy
-
+import scipy
from scipy.misc import comb, derivative
from scipy import special
from scipy import optimize
-from scipy import integrate
-from scipy.special import gammaln as gamln
+import scipy.integrate
import inspect
-from numpy import alltrue, where, arange, putmask, \
+from numpy import alltrue, where, arange, put, putmask, \
ravel, take, ones, sum, shape, product, repeat, reshape, \
zeros, floor, logical_and, log, sqrt, exp, arctanh, tan, sin, arcsin, \
arctan, tanh, ndarray, cos, cosh, sinh, newaxis, array, log1p, expm1
-from numpy import atleast_1d, polyval, ceil, place, extract, \
- any, argsort, argmax, vectorize, r_, asarray, nan, inf, pi, isinf, \
- power, NINF, empty
+from numpy import atleast_1d, polyval, angle, ceil, place, extract, \
+ any, argsort, argmax, vectorize, r_, asarray, nan, inf, pi, isnan, isinf, \
+ power
import numpy
import numpy as np
import numpy.random as mtrand
from numpy import flatnonzero as nonzero
+from scipy.special import gammaln as gamln
+from copy import copy
import vonmises_cython
-def _moment(data, n, mu=None):
- if mu is None:
- mu = data.mean()
- return ((data - mu)**n).mean()
-def _skew(data):
- data = np.ravel(data)
- mu = data.mean()
- m2 = ((data - mu)**2).mean()
- m3 = ((data - mu)**3).mean()
- return m3 / m2**1.5
-
-def _kurtosis(data):
- data = np.ravel(data)
- mu = data.mean()
- m2 = ((data - mu)**2).mean()
- m4 = ((data - mu)**4).mean()
- return m4 / m2**2 - 3
-
__all__ = [
'rv_continuous',
'ksone', 'kstwobign', 'norm', 'alpha', 'anglit', 'arcsine',
@@ -76,9 +56,14 @@
errp = special.errprint
arr = asarray
gam = special.gamma
+lgam = special.gammaln
+
import types
+import stats as st
+
from scipy.misc import doccer
+
all = alltrue
sgf = vectorize
import new
@@ -334,22 +319,12 @@
kwds = self.kwds
kwds.update({'moments':moments})
return self.dist.stats(*self.args,**kwds)
- def median(self):
- return self.dist.median(*self.args, **self.kwds)
- def mean(self):
- return self.dist.mean(*self.args,**self.kwds)
- def var(self):
- return self.dist.var(*self.args, **self.kwds)
- def std(self):
- return self.dist.std(*self.args, **self.kwds)
def moment(self,n):
return self.dist.moment(n,*self.args,**self.kwds)
def entropy(self):
return self.dist.entropy(*self.args,**self.kwds)
def pmf(self,k):
return self.dist.pmf(k,*self.args,**self.kwds)
- def interval(self,alpha):
- return self.dist.interval(alpha, *self.args, **self.kwds)
@@ -388,11 +363,8 @@
##
## rvs -- Random Variates (alternatively calling the class could produce these)
## pdf -- PDF
-## logpdf -- log PDF (more numerically accurate if possible)
## cdf -- CDF
-## logcdf -- log of CDF
## sf -- Survival Function (1-CDF)
-## logsf --- log of SF
## ppf -- Percent Point Function (Inverse of CDF)
## isf -- Inverse Survival Function (Inverse of SF)
## stats -- Return mean, variance, (Fisher's) skew, or (Fisher's) kurtosis
@@ -422,7 +394,7 @@
##
## _cdf, _ppf, _rvs, _isf, _sf
##
-## Rarely would you override _isf and _sf but you could for numerical precision.
+## Rarely would you override _isf and _sf but you could.
##
## Statistics are computed using numerical integration by default.
## For speed you can redefine this using
@@ -451,7 +423,7 @@
if typecode is not None:
out = out.astype(typecode)
if not isinstance(out, ndarray):
- out = arr(out)
+ out = asarray(out)
return out
# This should be rewritten
@@ -563,136 +535,7 @@
return vals
- def median(self, *args, **kwds):
- """
- Median of the distribution.
- Parameters
- ----------
- arg1, arg2, arg3,... : array-like
- The shape parameter(s) for the distribution (see docstring of the
- instance object for more information)
- loc : array-like, optional
- location parameter (default=0)
- scale : array-like, optional
- scale parameter (default=1)
-
- Returns
- -------
- median : float
- the median of the distribution.
-
- See Also
- --------
- self.ppf --- inverse of the CDF
- """
- return self.ppf(0.5, *args, **kwds)
-
- def mean(self, *args, **kwds):
- """
- Mean of the distribution
-
- Parameters
- ----------
- arg1, arg2, arg3,... : array-like
- The shape parameter(s) for the distribution (see docstring of the
- instance object for more information)
- loc : array-like, optional
- location parameter (default=0)
- scale : array-like, optional
- scale parameter (default=1)
-
- Returns
- -------
- mean : float
- the mean of the distribution
- """
- kwds['moments'] = 'm'
- res = self.stats(*args, **kwds)
- if isinstance(res, ndarray) and res.ndim == 0:
- return res[()]
- return res
-
- def var(self, *args, **kwds):
- """
- Variance of the distribution
-
- Parameters
- ----------
- arg1, arg2, arg3,... : array-like
- The shape parameter(s) for the distribution (see docstring of the
- instance object for more information)
- loc : array-like, optional
- location parameter (default=0)
- scale : array-like, optional
- scale parameter (default=1)
-
- Returns
- -------
- var : float
- the variance of the distribution
-
- """
- kwds['moments'] = 'v'
- res = self.stats(*args, **kwds)
- if isinstance(res, ndarray) and res.ndim == 0:
- return res[()]
- return res
-
- def std(self, *args, **kwds):
- """
- Standard deviation of the distribution.
-
- Parameters
- ----------
- arg1, arg2, arg3,... : array-like
- The shape parameter(s) for the distribution (see docstring of the
- instance object for more information)
- loc : array-like, optional
- location parameter (default=0)
- scale : array-like, optional
- scale parameter (default=1)
-
- Returns
- -------
- std : float
- standard deviation of the distribution
-
- """
- kwds['moments'] = 'v'
- res = math.sqrt(self.stats(*args, **kwds))
- return res
-
- def interval(self, alpha, *args, **kwds):
- """Confidence interval with equal areas around the median
-
- Parameters
- ----------
- alpha : array-like float in [0,1]
- Probability that an rv will be drawn from the returned range
- arg1, arg2, ... : array-like
- The shape parameter(s) for the distribution (see docstring of the instance
- object for more information)
- loc: array-like, optioal
- location parameter (deafult = 0)
- scale : array-like, optional
- scale paramter (default = 1)
-
- Returns
- -------
- a, b: array-like (float)
- end-points of range that contain alpha % of the rvs
- """
- alpha = arr(alpha)
- if any((alpha > 1) | (alpha < 0)):
- raise ValueError, "alpha must be between 0 and 1 inclusive"
- q1 = (1.0-alpha)/2
- q2 = (1.0+alpha)/2
- a = self.ppf(q1, *args, **kwds)
- b = self.ppf(q2, *args, **kwds)
- return a, b
-
-
class rv_continuous(rv_generic):
"""A generic continuous random variable class meant for subclassing.
@@ -840,13 +683,13 @@
def _mom_integ0(self, x,m,*args):
return x**m * self.pdf(x,*args)
def _mom0_sc(self, m,*args):
- return integrate.quad(self._mom_integ0, self.a,
+ return scipy.integrate.quad(self._mom_integ0, self.a,
self.b, args=(m,)+args)[0]
# moment calculated using ppf
def _mom_integ1(self, q,m,*args):
return (self.ppf(q,*args))**m
def _mom1_sc(self, m,*args):
- return integrate.quad(self._mom_integ1, 0, 1,args=(m,)+args)[0]
+ return scipy.integrate.quad(self._mom_integ1, 0, 1,args=(m,)+args)[0]
## These are the methods you must define (standard form functions)
def _argcheck(self, *args):
@@ -861,11 +704,7 @@
def _pdf(self,x,*args):
return derivative(self._cdf,x,dx=1e-5,args=args,order=5)
- ## Could also define any of these
- def _logpdf(self, x, *args):
- return log(self._pdf(x, *args))
-
- ##(return 1-d using self._size to get number)
+ ## Could also define any of these (return 1-d using self._size to get number)
def _rvs(self, *args):
## Use basic inverse cdf algorithm for RV generation as default.
U = mtrand.sample(self._size)
@@ -873,20 +712,14 @@
return Y
def _cdf_single_call(self, x, *args):
- return integrate.quad(self._pdf, self.a, x, args=args)[0]
+ return scipy.integrate.quad(self._pdf, self.a, x, args=args)[0]
def _cdf(self, x, *args):
return self.veccdf(x,*args)
- def _logcdf(self, x, *args):
- return log(self._cdf(x, *args))
-
def _sf(self, x, *args):
return 1.0-self._cdf(x,*args)
- def _logsf(self, x, *args):
- return log(self._sf(x, *args))
-
def _ppf(self, q, *args):
return self.vecfunc(q,*args)
@@ -897,6 +730,7 @@
# If these are defined, the others won't be looked at.
# Otherwise, the other set can be defined.
def _stats(self,*args, **kwds):
+ moments = kwds.get('moments')
return None, None, None, None
# Central moments
@@ -942,49 +776,6 @@
return output[()]
return output
- def logpdf(self, x, *args, **kwds):
- """
- Log of the probability density function at x of the given RV.
-
- This uses more numerically accurate calculation if available.
-
- Parameters
- ----------
- x : array-like
- quantiles
- arg1, arg2, arg3,... : array-like
- The shape parameter(s) for the distribution (see docstring of the
- instance object for more information)
- loc : array-like, optional
- location parameter (default=0)
- scale : array-like, optional
- scale parameter (default=1)
-
- Returns
- -------
- logpdf : array-like
- Log of the probability density function evaluated at x
-
- """
- loc,scale=map(kwds.get,['loc','scale'])
- args, loc, scale = self._fix_loc_scale(args, loc, scale)
- x,loc,scale = map(arr,(x,loc,scale))
- args = tuple(map(arr,args))
- x = arr((x-loc)*1.0/scale)
- cond0 = self._argcheck(*args) & (scale > 0)
- cond1 = (scale > 0) & (x >= self.a) & (x <= self.b)
- cond = cond0 & cond1
- output = empty(shape(cond),'d')
- output.fill(NINF)
- putmask(output,(1-cond0)*array(cond1,bool),self.badvalue)
- goodargs = argsreduce(cond, *((x,)+args+(scale,)))
- scale, goodargs = goodargs[-1], goodargs[:-1]
- place(output,cond,self._logpdf(*goodargs) - log(scale))
- if output.ndim == 0:
- return output[()]
- return output
-
-
def cdf(self,x,*args,**kwds):
"""
Cumulative distribution function at x of the given RV.
@@ -1026,48 +817,6 @@
return output[()]
return output
- def logcdf(self,x,*args,**kwds):
- """
- Log of the cumulative distribution function at x of the given RV.
-
- Parameters
- ----------
- x : array-like
- quantiles
- arg1, arg2, arg3,... : array-like
- The shape parameter(s) for the distribution (see docstring of the
- instance object for more information)
- loc : array-like, optional
- location parameter (default=0)
- scale : array-like, optional
- scale parameter (default=1)
-
- Returns
- -------
- logcdf : array-like
- Log of the cumulative distribution function evaluated at x
-
- """
- loc,scale=map(kwds.get,['loc','scale'])
- args, loc, scale = self._fix_loc_scale(args, loc, scale)
- x,loc,scale = map(arr,(x,loc,scale))
- args = tuple(map(arr,args))
- x = (x-loc)*1.0/scale
- cond0 = self._argcheck(*args) & (scale > 0)
- cond1 = (scale > 0) & (x > self.a) & (x < self.b)
- cond2 = (x >= self.b) & cond0
- cond = cond0 & cond1
- output = empty(shape(cond),'d')
- output.fill(NINF)
- place(output,(1-cond0)*(cond1==cond1),self.badvalue)
- place(output,cond2,0.0)
- if any(cond): #call only if at least 1 entry
- goodargs = argsreduce(cond, *((x,)+args))
- place(output,cond,self._logcdf(*goodargs))
- if output.ndim == 0:
- return output[()]
- return output
-
def sf(self,x,*args,**kwds):
"""
Survival function (1-cdf) at x of the given RV.
@@ -1108,46 +857,6 @@
return output[()]
return output
- def logsf(self,x,*args,**kwds):
- """
- Log of the Survival function log(1-cdf) at x of the given RV.
-
- Parameters
- ----------
- x : array-like
- quantiles
- arg1, arg2, arg3,... : array-like
- The shape parameter(s) for the distribution (see docstring of the
- instance object for more information)
- loc : array-like, optional
- location parameter (default=0)
- scale : array-like, optional
- scale parameter (default=1)
-
- Returns
- -------
- logsf : array-like
- Log of the survival function evaluated at x
- """
- loc,scale=map(kwds.get,['loc','scale'])
- args, loc, scale = self._fix_loc_scale(args, loc, scale)
- x,loc,scale = map(arr,(x,loc,scale))
- args = tuple(map(arr,args))
- x = (x-loc)*1.0/scale
- cond0 = self._argcheck(*args) & (scale > 0)
- cond1 = (scale > 0) & (x > self.a) & (x < self.b)
- cond2 = cond0 & (x <= self.a)
- cond = cond0 & cond1
- output = empty(shape(cond),'d')
- output.fill(NINF)
- place(output,(1-cond0)*(cond1==cond1),self.badvalue)
- place(output,cond2,0.0)
- goodargs = argsreduce(cond, *((x,)+args))
- place(output,cond,self._logsf(*goodargs))
- if output.ndim == 0:
- return output[()]
- return output
-
def ppf(self,q,*args,**kwds):
"""
Percent point function (inverse of cdf) at q of the given RV.
@@ -1402,7 +1111,7 @@
return self._munp(n,*args)
def _nnlf(self, x, *args):
- return -sum(self._logpdf(x, *args),axis=0)
+ return -sum(log(self._pdf(x, *args)),axis=0)
def nnlf(self, theta, x):
# - sum (log pdf(x, theta),axis=0)
@@ -1424,115 +1133,26 @@
N = len(x)
return self._nnlf(x, *args) + N*log(scale)
- # return starting point for fit (shape arguments + loc + scale)
- def _fitstart(self, data, args=None):
- if args is None:
- args = (1.0,)*self.numargs
- return args + self.fit_loc_scale(data, *args)
-
- def _reduce_func(self, args, kwds):
- args = list(args)
- Nargs = len(args) - 2
- fixedn = []
- index = range(Nargs) + [-2, -1]
- names = ['f%d' % n for n in range(Nargs)] + ['floc', 'fscale']
- x0 = args[:]
- for n, key in zip(index, names):
- if kwds.has_key(key):
- fixedn.append(n)
- args[n] = kwds[key]
- del x0[n]
-
- if len(fixedn) == 0:
- func = self.nnlf
- restore = None
- else:
- if len(fixedn) == len(index):
- raise ValueError, "All parameters fixed. There is nothing to optimize."
- def restore(args, theta):
- # Replace with theta for all numbers not in fixedn
- # This allows the non-fixed values to vary, but
- # we still call self.nnlf with all parameters.
- i = 0
- for n in range(Nargs):
- if n not in fixedn:
- args[n] = theta[i]
- i += 1
- return args
-
- def func(theta, x):
- newtheta = restore(args[:], theta)
- return self.nnlf(newtheta, x)
-
- return x0, func, restore, args
-
-
def fit(self, data, *args, **kwds):
- """
- Return max like estimators to shape, location, and scale from data
-
- Starting points for the fit are given by input arguments. For any
- arguments not given starting points, self._fitstart(data) is called
- to get the starting estimates.
-
- You can hold some parameters fixed to specific values by passing in
- keyword arguments f0..fn for shape paramters and floc, fscale for
- location and scale parameters.
-
- Parameters
- ----------
- data : array-like
- Data to use in calculating the MLE
- args : optional
- Starting values for any shape arguments (those not specified
- will be determined by _fitstart(data))
- kwds : loc, scale
- Starting values for the location and scale parameters
- Special keyword arguments are recognized as holding certain
- parameters fixed:
- f1..fn : hold respective shape paramters fixed
- floc : hold location parameter fixed to specified value
- fscale : hold scale parameter fixed to specified value
-
- Return
- ------
- shape, loc, scale : tuple of float
- MLE estimates for any shape arguments followed by location and scale
- """
+ loc0, scale0 = map(kwds.get, ['loc', 'scale'],[0.0, 1.0])
Narg = len(args)
- if Narg > self.numargs:
+ if Narg != self.numargs:
+ if Narg > self.numargs:
raise ValueError, "Too many input arguments."
- start = [None]*2
- if (Narg < self.numargs) or not (kwds.has_key('loc') and
- kwds.has_key('scale')):
- start = self._fitstart(data) # get distribution specific starting locations
- args += start[Narg:-2]
- loc = kwds.get('loc', start[-2])
- scale = kwds.get('scale', start[-1])
- args += (loc, scale)
- x0, func, restore, args = self._reduce_func(args, kwds)
- vals = optimize.fmin(func,x0,args=(ravel(data),),disp=0)
- vals = tuple(vals)
- if restore is not None:
- vals = restore(args, vals)
- return vals
+ else:
+ args += (1.0,)*(self.numargs-Narg)
+ # location and scale are at the end
+ x0 = args + (loc0, scale0)
+ return optimize.fmin(self.nnlf,x0,args=(ravel(data),),disp=0)
- def fit_loc_scale(self, data, *args):
- """
- Estimate loc and scale parameters from data using 1st and 2nd moments
- """
+ def est_loc_scale(self, data, *args):
mu, mu2 = self.stats(*args,**{'moments':'mv'})
- muhat = arr(data).mean()
- mu2hat = arr(data).var()
+ muhat = st.nanmean(data)
+ mu2hat = st.nanstd(data)
Shat = sqrt(mu2hat / mu2)
Lhat = muhat - Shat*mu
return Lhat, Shat
- @np.deprecate
- def est_loc_scale(self, data, *args):
- """This function is deprecated, use self.fit_loc_scale(data) instead. """
- return self.fit_loc_scale(data, *args)
-
def freeze(self,*args,**kwds):
return rv_frozen(self,*args,**kwds)
@@ -1544,7 +1164,7 @@
val = self._pdf(x, *args)
return val*log(val)
- entr = -integrate.quad(integ,self.a,self.b)[0]
+ entr = -scipy.integrate.quad(integ,self.a,self.b)[0]
if not np.isnan(entr):
return entr
else: # try with different limits if integration problems
@@ -1557,7 +1177,7 @@
lower = low
else:
lower = self.a
- return -integrate.quad(integ,lower,upper)[0]
+ return -scipy.integrate.quad(integ,lower,upper)[0]
def entropy(self, *args, **kwds):
@@ -1589,55 +1209,7 @@
else:
place(output,cond0,self.vecentropy(*goodargs)+log(scale))
return output
-
- def expect(self, func=None, args=(), loc=0, scale=1, lb=None, ub=None,
- conditional=False, **kwds):
- """calculate expected value of a function with respect to the distribution
- location and scale only tested on a few examples
-
- Parameters
- ----------
- all parameters are keyword parameters
- func : function (default: identity mapping)
- Function for which integral is calculated. Takes only one argument.
- args : tuple
- argument (parameters) of the distribution
- lb, ub : numbers
- lower and upper bound for integration, default is set to the support
- of the distribution
- conditional : boolean (False)
- If true then the integral is corrected by the conditional probability
- of the integration interval. The return value is the expectation
- of the function, conditional on being in the given interval.
-
- Returns
- -------
- expected value : float
-
- Notes
- -----
- This function has not been checked for it's behavior when the integral is
- not finite. The integration behavior is inherited from integrate.quad.
- """
- if func is None:
- def fun(x, *args):
- return x*self.pdf(x, *args, **{'loc':loc, 'scale':scale})
- else:
- def fun(x, *args):
- return func(x)*self.pdf(x, *args, **{'loc':loc, 'scale':scale})
- if lb is None:
- lb = (self.a - loc)/(1.0*scale)
- if ub is None:
- ub = (self.b - loc)/(1.0*scale)
- if conditional:
- invfac = self.sf(lb,*args) - self.sf(ub,*args)
- else:
- invfac = 1.0
- kwds['args'] = args
- return integrate.quad(fun, lb, ub, **kwds)[0] / invfac
-
-
_EULER = 0.577215664901532860606512090082402431042 # -special.psi(1)
_ZETA3 = 1.202056903159594285399738161511449990765 # special.zeta(3,1) Apery's constant
@@ -1675,16 +1247,10 @@
# loc = mu, scale = std
# Keep these implementations out of the class definition so they can be reused
# by other distributions.
-_norm_pdf_C = math.sqrt(2*pi)
-_norm_pdf_logC = math.log(_norm_pdf_C)
def _norm_pdf(x):
- return exp(-x**2/2.0) / _norm_pdf_C
-def _norm_logpdf(x):
- return -x**2 / 2.0 - _norm_pdf_logC
+ return 1.0/sqrt(2*pi)*exp(-x**2/2.0)
def _norm_cdf(x):
return special.ndtr(x)
-def _norm_logcdf(x):
- return log(special.ndtr(x))
def _norm_ppf(q):
return special.ndtri(q)
class norm_gen(rv_continuous):
@@ -1692,16 +1258,10 @@
return mtrand.standard_normal(self._size)
def _pdf(self,x):
return _norm_pdf(x)
- def _logpdf(self, x):
- return _norm_logpdf(x)
def _cdf(self,x):
return _norm_cdf(x)
- def _logcdf(self, x):
- return _norm_logcdf(x)
def _sf(self, x):
return _norm_cdf(-x)
- def _logsf(self, x):
- return _norm_logcdf(-x)
def _ppf(self,q):
return _norm_ppf(q)
def _isf(self,q):
@@ -1725,9 +1285,7 @@
##
class alpha_gen(rv_continuous):
def _pdf(self, x, a):
- return 1.0/(x**2)/special.ndtr(a)*_norm_pdf(a-1.0/x)
- def _logpdf(self, x, a):
- return -2*log(x) + _norm_logpdf(a-1.0/x) - log(special.ndtr(a))
+ return 1.0/arr(x**2)/special.ndtr(a)*norm.pdf(a-1.0/x)
def _cdf(self, x, a):
return special.ndtr(a-1.0/x) / special.ndtr(a)
def _ppf(self, q, a):
@@ -1773,7 +1331,7 @@
def _ppf(self, q):
return sin(pi/2.0*q)**2.0
def _stats(self):
- #mup = 0.5, 3.0/8.0, 15.0/48.0, 35.0/128.0
+ mup = 0.5, 3.0/8.0, 15.0/48.0, 35.0/128.0
mu = 0.5
mu2 = 1.0/8
g1 = 0
@@ -1799,10 +1357,6 @@
Px = (1.0-x)**(b-1.0) * x**(a-1.0)
Px /= special.beta(a,b)
return Px
- def _logpdf(self, x, a, b):
- lPx = (b-1.0)*log(1.0-x) + (a-1.0)*log(x)
- lPx -= log(special.beta(a,b))
- return lPx
def _cdf(self, x, a, b):
return special.btdtr(a,b,x)
def _ppf(self, q, a, b):
@@ -1814,33 +1368,6 @@
g2 = 6.0*(a**3 + a**2*(1-2*b) + b**2*(1+b) - 2*a*b*(2+b))
g2 /= a*b*(a+b+2)*(a+b+3)
return mn, var, g1, g2
- def _fitstart(self, data):
- g1 = _skew(data)
- g2 = _kurtosis(data)
- def func(x):
- a, b = x
- sk = 2*(b-a)*math.sqrt(a + b + 1) / (a + b + 2) / math.sqrt(a*b)
- ku = a**3 - a**2*(2*b-1) + b**2*(b+1) - 2*a*b*(b+2)
- ku /= a*b*(a+b+2)*(a+b+3)
- ku *= 6
- return [sk-g1, ku-g2]
- a, b = optimize.fsolve(func, (1.0, 1.0))
- return super(beta_gen, self)._fitstart(data, args=(a,b))
- def fit(self, data, *args, **kwds):
- floc = kwds.get('floc', None)
- fscale = kwds.get('fscale', None)
- if floc is not None and fscale is not None:
- # special case
- data = (ravel(data)-floc)/fscale
- xbar = data.mean()
- v = data.var(ddof=0)
- fac = xbar*(1-xbar)/v - 1
- a = xbar * fac
- b = (1-xbar) * fac
- return a, b, floc, fscale
- else: # do general fit
- return super(beta_gen, self).fit(data, *args, **kwds)
-
beta = beta_gen(a=0.0, b=1.0, name='beta',shapes='a, b',extradoc="""
Beta distribution
@@ -1857,8 +1384,6 @@
return (u1 / u2)
def _pdf(self, x, a, b):
return 1.0/special.beta(a,b)*x**(a-1.0)/(1+x)**(a+b)
- def _logpdf(self, x, a, b):
- return (a-1.0)*log(x) - (a+b)*log(1+x) - log(special.beta(a,b))
def _cdf_skip(self, x, a, b):
# remove for now: special.hyp2f1 is incorrect for large a
x = where(x==1.0, 1.0-1e-6,x)
@@ -2054,12 +1579,10 @@
def _rvs(self, df):
return mtrand.chisquare(df,self._size)
def _pdf(self, x, df):
- return exp(self._logpdf(x, df))
- def _logpdf(self, x, df):
- return (df/2.-1)*log(x)-x/2.-gamln(df/2.)-(log(2)*df)/2.
+ return exp((df/2.-1)*log(x)-x/2.-gamln(df/2.)-(log(2)*df)/2.)
## Px = x**(df/2.0-1)*exp(-x/2.0)
## Px /= special.gamma(df/2.0)* 2**(df/2.0)
-## return log(Px)
+## return Px
def _cdf(self, x, df):
return special.chdtr(df, x)
def _sf(self, x, df):
@@ -2109,9 +1632,6 @@
def _pdf(self, x, a):
ax = abs(x)
return 1.0/(2*special.gamma(a))*ax**(a-1.0) * exp(-ax)
- def _logpdf(self, x, a):
- ax = abs(x)
- return (a-1.0)*log(ax) - ax - log(2) - gamln(a)
def _cdf(self, x, a):
fac = 0.5*special.gammainc(a,abs(x))
return where(x>0,0.5+fac,0.5-fac)
@@ -2145,9 +1665,6 @@
ax = abs(x)
Px = c/2.0*ax**(c-1.0)*exp(-ax**c)
return Px
- def _logpdf(self, x, c):
- ax = abs(x)
- return log(c) - log(2.0) + (c-1.0)*log(ax) - ax**c
def _cdf(self, x, c):
Cx1 = 0.5*exp(-abs(x)**c)
return where(x > 0, 1-Cx1, Cx1)
@@ -2179,8 +1696,6 @@
def _pdf(self, x, n):
Px = (x)**(n-1.0)*exp(-x)/special.gamma(n)
return Px
- def _logpdf(self, x, n):
- return (n-1.0)*log(x) - x - gamln(n)
def _cdf(self, x, n):
return special.gdtr(1.0,n,x)
def _sf(self, x, n):
@@ -2191,7 +1706,7 @@
n = n*1.0
return n, n, 2/sqrt(n), 6/n
def _entropy(self, n):
- return special.psi(n)*(1-n) + 1 + gamln(n)
+ return special.psi(n)*(1-n) + 1 + special.gammaln(n)
erlang = erlang_gen(a=0.0,name='erlang',longname='An Erlang',
shapes='n',extradoc="""
@@ -2207,16 +1722,12 @@
return mtrand.standard_exponential(self._size)
def _pdf(self, x):
return exp(-x)
- def _logpdf(self, x):
- return -x
def _cdf(self, x):
return -expm1(-x)
def _ppf(self, q):
return -log1p(-q)
def _sf(self,x):
return exp(-x)
- def _logsf(self, x):
- return -x
def _isf(self,q):
return -log(q)
def _stats(self):
@@ -2240,10 +1751,7 @@
class exponweib_gen(rv_continuous):
def _pdf(self, x, a, c):
exc = exp(-x**c)
- return a*c*(1-exc)**arr(a-1) * exc * x**(c-1)
- def _logpdf(self, x, a, c):
- exc = exp(-x**c)
- return log(a) + log(c) + (a-1.)*log(1-exc) - x**c + (c-1.0)*log(x)
+ return a*c*(1-exc)**arr(a-1) * exc * x**arr(c-1)
def _cdf(self, x, a, c):
exm1c = -expm1(-x**c)
return arr((exm1c)**a)
@@ -2267,9 +1775,6 @@
xbm1 = arr(x**(b-1.0))
xb = xbm1 * x
return exp(1)*b*xbm1 * exp(xb - exp(xb))
- def _logpdf(self, x, b):
- xb = x**(b-1.0)*x
- return 1 + log(b) + (b-1.0)*log(x) + xb - exp(xb)
def _cdf(self, x, b):
xb = arr(x**b)
return -expm1(-expm1(xb))
@@ -2300,8 +1805,6 @@
return t
def _pdf(self, x, c):
return (x+1)/arr(2*c*sqrt(2*pi*x**3))*exp(-(x-1)**2/arr((2.0*x*c**2)))
- def _logpdf(self, x, c):
- return log(x+1) - (x-1)**2 / (2.0*x*c**2) - log(2*c) - 0.5*(log(2*pi) + 3*log(x))
def _cdf(self, x, c):
return special.ndtr(1.0/c*(sqrt(x)-1.0/arr(sqrt(x))))
def _ppf(self, q, c):
@@ -2355,17 +1858,11 @@
def _rvs(self, dfn, dfd):
return mtrand.f(dfn, dfd, self._size)
def _pdf(self, x, dfn, dfd):
-# n = arr(1.0*dfn)
-# m = arr(1.0*dfd)
-# Px = m**(m/2) * n**(n/2) * x**(n/2-1)
-# Px /= (m+n*x)**((n+m)/2)*special.beta(n/2,m/2)
- return exp(self._logpdf(x, dfn, dfd))
- def _logpdf(self, x, dfn, dfd):
- n = 1.0*dfn
- m = 1.0*dfd
- lPx = m/2*log(m) + n/2*log(n) + (n/2-1)*log(x)
- lPx -= ((n+m)/2)*log(m+n*x) + special.betaln(n/2,m/2)
- return lPx
+ n = arr(1.0*dfn)
+ m = arr(1.0*dfd)
+ Px = m**(m/2) * n**(n/2) * x**(n/2-1)
+ Px /= (m+n*x)**((n+m)/2)*special.beta(n/2,m/2)
+ return Px
def _cdf(self, x, dfn, dfd):
return special.fdtr(dfn, dfd, x)
def _sf(self, x, dfn, dfd):
@@ -2441,8 +1938,6 @@
class frechet_r_gen(rv_continuous):
def _pdf(self, x, c):
return c*pow(x,c-1)*exp(-pow(x,c))
- def _logpdf(self, x, c):
- return log(c) + (c-1)*log(x) - pow(x,c)
def _cdf(self, x, c):
return -expm1(-pow(x,c))
def _ppf(self, q, c):
@@ -2512,8 +2007,6 @@
def _pdf(self, x, c):
Px = c*exp(-x)/(1+exp(-x))**(c+1.0)
return Px
- def _logpdf(self, x, c):
- return log(c) - x - (c+1.0)*log1p(exp(-x))
def _cdf(self, x, c):
Cx = (1+exp(-x))**(-c)
return Cx
@@ -2549,8 +2042,6 @@
def _pdf(self, x, c):
Px = pow(1+c*x,arr(-1.0-1.0/c))
return Px
- def _logpdf(self, x, c):
- return (-1.0-1.0/c) * np.log1p(c*x)
def _cdf(self, x, c):
return 1.0 - pow(1+c*x,arr(-1.0/c))
def _ppf(self, q, c):
@@ -2566,7 +2057,6 @@
else:
self.b = -1.0 / c
return rv_continuous._entropy(self, c)
-
genpareto = genpareto_gen(a=0.0,name='genpareto',
longname="A generalized Pareto",
shapes='c',extradoc="""
@@ -2585,8 +2075,6 @@
return (a+b*(-expm1(-c*x)))*exp((-a-b)*x+b*(-expm1(-c*x))/c)
def _cdf(self, x, a, b, c):
return -expm1((-a-b)*x + b*(-expm1(-c*x))/c)
- def _logpdf(self, x, a, b, c):
- return np.log(a+b*(-expm1(-c*x))) + (-a-b)*x+b*(-expm1(-c*x))/c
genexpon = genexpon_gen(a=0.0,name='genexpon',
longname='A generalized exponential',
shapes='a, b, c',extradoc="""
@@ -2702,8 +2190,6 @@
return mtrand.standard_gamma(a, self._size)
def _pdf(self, x, a):
return x**(a-1)*exp(-x)/special.gamma(a)
- def _logpdf(self, x, a):
- return (a-1)*log(x) - x - gamln(a)
def _cdf(self, x, a):
return special.gammainc(a, x)
def _ppf(self, q, a):
@@ -2711,26 +2197,7 @@
def _stats(self, a):
return a, a, 2.0/sqrt(a), 6.0/a
def _entropy(self, a):
- return special.psi(a)*(1-a) + 1 + gamln(a)
- def _fitstart(self, data):
- a = 4 / _skew(data)**2
- return super(gamma_gen, self)._fitstart(data, args=(a,))
- def fit(self, data, *args, **kwds):
- floc = kwds.get('floc', None)
- if floc == 0:
- xbar = ravel(data).mean()
- logx_bar = ravel(log(data)).mean()
- s = log(xbar) - logx_bar
- def func(a):
- return log(a) - special.digamma(a) - s
- aest = (3-s + math.sqrt((s-3)**2 + 24*s)) / (12*s)
- xa = aest*(1-0.4)
- xb = aest*(1+0.4)
- a = optimize.brentq(func, xa, xb, disp=0)
- scale = xbar / a
- return a, floc, scale
- else:
- return super(gamma_gen, self).fit(data, *args, **kwds)
+ return special.psi(a)*(1-a) + 1 + special.gammaln(a)
gamma = gamma_gen(a=0.0,name='gamma',longname='A gamma',
shapes='a',extradoc="""
@@ -2749,7 +2216,7 @@
def _argcheck(self, a, c):
return (a > 0) & (c != 0)
def _pdf(self, x, a, c):
- return abs(c)* exp((c*a-1)*log(x)-x**c- gamln(a))
+ return abs(c)* exp((c*a-1)*log(x)-x**c- special.gammaln(a))
def _cdf(self, x, a, c):
val = special.gammainc(a,x**c)
cond = c + 0*val
@@ -2764,7 +2231,7 @@
return special.gamma(a+n*1.0/c) / special.gamma(a)
def _entropy(self, a,c):
val = special.psi(a)
- return a*(1-val) + 1.0/c*val + gamln(a)-log(abs(c))
+ return a*(1-val) + 1.0/c*val + special.gammaln(a)-log(abs(c))
gengamma = gengamma_gen(a=0.0, name='gengamma',
longname='A generalized gamma',
shapes="a, c", extradoc="""
@@ -2841,12 +2308,8 @@
def _pdf(self, x):
ex = exp(-x)
return ex*exp(-ex)
- def _logpdf(self, x):
- return -x - exp(-x)
def _cdf(self, x):
return exp(-exp(-x))
- def _logcdf(self, x):
- return -exp(-x)
def _ppf(self, q):
return -log(-log(q))
def _stats(self):
@@ -2866,8 +2329,6 @@
def _pdf(self, x):
ex = exp(x)
return ex*exp(-ex)
- def _logpdf(self, x):
- return x - exp(x)
def _cdf(self, x):
return 1.0-exp(-exp(x))
def _ppf(self, q):
@@ -2891,8 +2352,6 @@
class halfcauchy_gen(rv_continuous):
def _pdf(self, x):
return 2.0/pi/(1.0+x*x)
- def _logpdf(self, x):
- return np.log(2.0/pi) - np.log1p(x*x)
def _cdf(self, x):
return 2.0/pi*arctan(x)
def _ppf(self, q):
@@ -2949,8 +2408,6 @@
return abs(norm.rvs(size=self._size))
def _pdf(self, x):
return sqrt(2.0/pi)*exp(-x*x/2.0)
- def _logpdf(self, x):
- return 0.5 * np.log(2.0/pi) - x*x/2.0
def _cdf(self, x):
return special.ndtr(x)*2-1.0
def _ppf(self, q):
@@ -3025,17 +2482,15 @@
class invgamma_gen(rv_continuous):
def _pdf(self, x, a):
- return exp(self._logpdf(x,a))
- def _logpdf(self, x, a):
- return (-(a+1)*log(x)-gamln(a) - 1.0/x)
+ return exp(-(a+1)*log(x)-special.gammaln(a) - 1.0/x)
def _cdf(self, x, a):
return 1.0-special.gammainc(a, 1.0/x)
def _ppf(self, q, a):
return 1.0/special.gammaincinv(a,1-q)
def _munp(self, n, a):
- return exp(gamln(a-n) - gamln(a))
+ return exp(special.gammaln(a-n) - special.gammaln(a))
def _entropy(self, a):
- return a - (a+1.0)*special.psi(a) + gamln(a)
+ return a - (a+1.0)*special.psi(a) + special.gammaln(a)
invgamma = invgamma_gen(a=0.0, name='invgamma',longname="An inverted gamma",
shapes='a',extradoc="""
@@ -3055,8 +2510,6 @@
return mtrand.wald(mu, 1.0, size=self._size)
def _pdf(self, x, mu):
return 1.0/sqrt(2*pi*x**3.0)*exp(-1.0/(2*x)*((x-mu)/mu)**2)
- def _logpdf(self, x, mu):
- return -0.5*log(2*pi) - 1.5*log(x) - ((x-mu)/mu)**2/(2*x)
def _cdf(self, x, mu):
fac = sqrt(1.0/x)
C1 = norm.cdf(fac*(x-mu)/mu)
@@ -3292,7 +2745,7 @@
def _rvs(self, c):
return log(mtrand.gamma(c, size=self._size))
def _pdf(self, x, c):
- return exp(c*x-exp(x)-gamln(c))
+ return exp(c*x-exp(x)-special.gammaln(c))
def _cdf(self, x, c):
return special.gammainc(c, exp(x))
def _ppf(self, q, c):
@@ -3579,14 +3032,9 @@
#return 0.5*sqrt(df)*(sY-1.0/sY)
def _pdf(self, x, df):
r = arr(df*1.0)
- Px = exp(gamln((r+1)/2)-gamln(r/2))
+ Px = exp(special.gammaln((r+1)/2)-special.gammaln(r/2))
Px /= sqrt(r*pi)*(1+(x**2)/r)**((r+1)/2)
return Px
- def _logpdf(self, x, df):
- r = df*1.0
- lPx = gamln((r+1)/2)-gamln(r/2)
- lPx -= 0.5*log(r*pi) + (r+1)/2*log(1+(x**2)/r)
- return lPx
def _cdf(self, x, df):
return special.stdtr(df, x)
def _sf(self, x, df):
@@ -3729,14 +3177,8 @@
class lomax_gen(rv_continuous):
def _pdf(self, x, c):
return c*1.0/(1.0+x)**(c+1.0)
- def _logpdf(self, x, c):
- return log(c) - (c+1)*log(1+x)
def _cdf(self, x, c):
return 1.0-1.0/(1.0+x)**c
- def _sf(self, x, c):
- return 1.0/(1.0+x)**c
- def _logsf(self, x, c):
- return -c*log(1+x)
def _ppf(self, q, c):
return pow(1.0-q,-1.0/c)-1
def _stats(self, c):
@@ -3760,12 +3202,8 @@
class powerlaw_gen(rv_continuous):
def _pdf(self, x, a):
return a*x**(a-1.0)
- def _logpdf(self, x, a):
- return log(a) + (a-1)*log(x)
def _cdf(self, x, a):
return x**(a*1.0)
- def _logcdf(self, x, a):
- return a*log(x)
def _ppf(self, q, a):
return pow(q, 1.0/a)
def _stats(self, a):
@@ -3810,12 +3248,10 @@
class powernorm_gen(rv_continuous):
def _pdf(self, x, c):
- return c*_norm_pdf(x)* \
- (_norm_cdf(-x)**(c-1.0))
- def _logpdf(self, x, c):
- return log(c) + _norm_logpdf(x) + (c-1)*_norm_logcdf(-x)
+ return c*norm.pdf(x)* \
+ (norm.cdf(-x)**(c-1.0))
def _cdf(self, x, c):
- return 1.0-_norm_cdf(-x)**(c*1.0)
+ return 1.0-norm.cdf(-x)**(c*1.0)
def _ppf(self, q, c):
return -norm.ppf(pow(1.0-q,1.0/c))
powernorm = powernorm_gen(name='powernorm', longname="A power normal",
@@ -3890,8 +3326,6 @@
def _pdf(self, x, a, b):
# argcheck should be called before _pdf
return 1.0/(x*self.d)
- def _logpdf(self, x, a, b):
- return -log(x) - log(self.d)
def _cdf(self, x, a, b):
return (log(x)-log(a)) / self.d
def _ppf(self, q, a, b):
@@ -3917,8 +3351,6 @@
class rice_gen(rv_continuous):
def _pdf(self, x, b):
return x*exp(-(x*x+b*b)/2.0)*special.i0(x*b)
- def _logpdf(self, x, b):
- return log(x) - (x*x + b*b)/2.0 + log(special.i0(x*b))
def _munp(self, n, b):
nd2 = n/2.0
n1 = 1+nd2
@@ -3943,13 +3375,11 @@
return 1.0/mtrand.wald(mu, 1.0, size=self._size)
def _pdf(self, x, mu):
return 1.0/sqrt(2*pi*x)*exp(-(1-mu*x)**2.0 / (2*x*mu**2.0))
- def _logpdf(self, x, mu):
- return -(1-mu*x)**2.0 / (2*x*mu**2.0) - 0.5*log(2*pi*x)
def _cdf(self, x, mu):
trm1 = 1.0/mu - x
trm2 = 1.0/mu + x
isqx = 1.0/sqrt(x)
- return 1.0-_norm_cdf(isqx*trm1)-exp(2.0/mu)*_norm_cdf(-isqx*trm2)
+ return 1.0-norm.cdf(isqx*trm1)-exp(2.0/mu)*norm.cdf(-isqx*trm2)
# xb=50 or something large is necessary for stats to converge without exception
recipinvgauss = recipinvgauss_gen(a=0.0, xb=50, name='recipinvgauss',
longname="A reciprocal inverse Gaussian",
@@ -4027,8 +3457,6 @@
return (b > 0)
def _pdf(self, x, b):
return exp(-x)/(1-exp(-b))
- def _logpdf(self, x, b):
- return -x - log(1-exp(-b))
def _cdf(self, x, b):
return (1.0-exp(-x))/(1-exp(-b))
def _ppf(self, q, b):
@@ -4064,25 +3492,19 @@
def _argcheck(self, a, b):
self.a = a
self.b = b
- self._nb = _norm_cdf(b)
- self._na = _norm_cdf(a)
- self._delta = self._nb - self._na
- self._logdelta = log(self._delta)
+ self.nb = norm._cdf(b)
+ self.na = norm._cdf(a)
return (a != b)
- # All of these assume that _argcheck is called first
- # and no other thread calls _pdf before.
def _pdf(self, x, a, b):
- return _norm_pdf(x) / self._delta
- def _logpdf(self, x, a, b):
- return _norm_logpdf(x) - self._logdelta
+ return norm._pdf(x) / (self.nb - self.na)
def _cdf(self, x, a, b):
- return (_norm_cdf(x) - self._na) / self._delta
+ return (norm._cdf(x) - self.na) / (self.nb - self.na)
def _ppf(self, q, a, b):
- return norm._ppf(q*self._nb + self._na*(1.0-q))
+ return norm._ppf(q*self.nb + self.na*(1.0-q))
def _stats(self, a, b):
- nA, nB = self._na, self._nb
+ nA, nB = self.na, self.nb
d = nB - nA
- pA, pB = _norm_pdf(a), _norm_pdf(b)
+ pA, pB = norm._pdf(a), norm._pdf(b)
mu = (pA - pB) / d #correction sign
mu2 = 1 + (a*pA - b*pB) / d - mu*mu
return mu, mu2, None, None
@@ -4133,7 +3555,7 @@
def _entropy(self, lam):
def integ(p):
return log(pow(p,lam-1)+pow(1-p,lam-1))
- return integrate.quad(integ,0,1)[0]
+ return scipy.integrate.quad(integ,0,1)[0]
tukeylambda = tukeylambda_gen(name='tukeylambda', longname="A Tukey-Lambda",
shapes="lam", extradoc="""
@@ -4219,13 +3641,11 @@
%(example)s
"""
def _rvs(self):
- return mtrand.wald(1.0, 1.0, size=self._size)
+ return invnorm_gen._rvs(self, 1.0)
def _pdf(self, x):
- return invnorm._pdf(x, 1.0)
- def _logpdf(self, x):
- return invnorm._logpdf(x, 1.0)
+ return invnorm.pdf(x,1.0)
def _cdf(self, x):
- return invnorm._logcdf(x, 1.0)
+ return invnorm.cdf(x,1,0)
def _stats(self):
return 1.0, 1.0, 3.0, 15.0
wald = wald_gen(a=0.0, name="wald", extradoc="""
@@ -4499,7 +3919,7 @@
moment_tol=1e-8,values=None,inc=1,longname=None,
shapes=None, extradoc=None):
- super(rv_generic,self).__init__()
+ rv_generic.__init__(self)
if badvalue is None:
badvalue = nan
@@ -4613,11 +4033,8 @@
return cond
def _pmf(self, k, *args):
- return self._cdf(k,*args) - self._cdf(k-1,*args)
+ return self.cdf(k,*args) - self.cdf(k-1,*args)
- def _logpmf(self, k, *args):
- return log(self._pmf(k, *args))
-
def _cdfsingle(self, k, *args):
m = arange(int(self.a),k+1)
return sum(self._pmf(m,*args),axis=0)
@@ -4626,15 +4043,9 @@
k = floor(x)
return self._cdfvec(k,*args)
- def _logcdf(self, x, *args):
- return log(self._cdf(x, *args))
-
def _sf(self, x, *args):
return 1.0-self._cdf(x,*args)
- def _logsf(self, x, *args):
- return log(self._sf(x, *args))
-
def _ppf(self, q, *args):
return self._vecppf(q, *args)
@@ -4669,7 +4080,7 @@
"""
kwargs['discrete'] = True
- return super(rv_discrete, self).rvs(*args, **kwargs)
+ return rv_generic.rvs(self, *args, **kwargs)
def pmf(self, k,*args, **kwds):
"""
@@ -4708,44 +4119,6 @@
return output[()]
return output
- def logpmf(self, k,*args, **kwds):
- """
- Log of the probability mass function at k of the given RV.
-
-
- Parameters
- ----------
- k : array-like
- quantiles
- arg1, arg2, arg3,... : array-like
- The shape parameter(s) for the distribution (see docstring of the
- instance object for more information)
- loc : array-like, optional
- location parameter (default=0)
-
- Returns
- -------
- logpmf : array-like
- Log of the probability mass function evaluated at k
-
- """
- loc = kwds.get('loc')
- args, loc = self._fix_loc(args, loc)
- k,loc = map(arr,(k,loc))
- args = tuple(map(arr,args))
- k = arr((k-loc))
- cond0 = self._argcheck(*args)
- cond1 = (k >= self.a) & (k <= self.b) & self._nonzero(k,*args)
- cond = cond0 & cond1
- output = empty(shape(cond),'d')
- output.fill(NINF)
- place(output,(1-cond0)*(cond1==cond1),self.badvalue)
- goodargs = argsreduce(cond, *((k,)+args))
- place(output,cond,self._logpmf(*goodargs))
- if output.ndim == 0:
- return output[()]
- return output
-
def cdf(self, k, *args, **kwds):
"""
Cumulative distribution function at k of the given RV
@@ -4786,47 +4159,6 @@
return output[()]
return output
- def logcdf(self, k, *args, **kwds):
- """
- Log of the cumulative distribution function at k of the given RV
-
- Parameters
- ----------
- k : array-like, int
- quantiles
- arg1, arg2, arg3,... : array-like
- The shape parameter(s) for the distribution (see docstring of the
- instance object for more information)
- loc : array-like, optional
- location parameter (default=0)
-
- Returns
- -------
- logcdf : array-like
- Log of the cumulative distribution function evaluated at k
-
- """
- loc = kwds.get('loc')
- args, loc = self._fix_loc(args, loc)
- k,loc = map(arr,(k,loc))
- args = tuple(map(arr,args))
- k = arr((k-loc))
- cond0 = self._argcheck(*args)
- cond1 = (k >= self.a) & (k < self.b)
- cond2 = (k >= self.b)
- cond = cond0 & cond1
- output = empty(shape(cond),'d')
- output.fill(NINF)
- place(output,(1-cond0)*(cond1==cond1),self.badvalue)
- place(output,cond2*(cond0==cond0), 0.0)
-
- if any(cond):
- goodargs = argsreduce(cond, *((k,)+args))
- place(output,cond,self._logcdf(*goodargs))
- if output.ndim == 0:
- return output[()]
- return output
-
def sf(self,k,*args,**kwds):
"""
Survival function (1-cdf) at k of the given RV
@@ -4865,45 +4197,6 @@
return output[()]
return output
- def logsf(self,k,*args,**kwds):
- """
- Log of the survival function (1-cdf) at k of the given RV
-
- Parameters
- ----------
- k : array-like
- quantiles
- arg1, arg2, arg3,... : array-like
- The shape parameter(s) for the distribution (see docstring of the
- instance object for more information)
- loc : array-like, optional
- location parameter (default=0)
-
- Returns
- -------
- sf : array-like
- Survival function evaluated at k
-
- """
- loc= kwds.get('loc')
- args, loc = self._fix_loc(args, loc)
- k,loc = map(arr,(k,loc))
- args = tuple(map(arr,args))
- k = arr(k-loc)
- cond0 = self._argcheck(*args)
- cond1 = (k >= self.a) & (k <= self.b)
- cond2 = (k < self.a) & cond0
- cond = cond0 & cond1
- output = empty(shape(cond),'d')
- output.fill(NINF)
- place(output,(1-cond0)*(cond1==cond1),self.badvalue)
- place(output,cond2,0.0)
- goodargs = argsreduce(cond, *((k,)+args))
- place(output,cond,self._logsf(*goodargs))
- if output.ndim == 0:
- return output[()]
- return output
-
def ppf(self,q,*args,**kwds):
"""
Percent point function (inverse of cdf) at q of the given RV
@@ -4917,8 +4210,6 @@
instance object for more information)
loc : array-like, optional
location parameter (default=0)
- scale: array-like, optional
- scale parameter (default=1)
Returns
-------
@@ -5192,109 +4483,6 @@
def __call__(self, *args, **kwds):
return self.freeze(*args,**kwds)
- def expect(self, func=None, args=(), loc=0, lb=None, ub=None, conditional=False):
- """calculate expected value of a function with respect to the distribution
- for discrete distribution
-
- Parameters
- ----------
- fn : function (default: identity mapping)
- Function for which integral is calculated. Takes only one argument.
- args : tuple
- argument (parameters) of the distribution
- optional keyword parameters
- lb, ub : numbers
- lower and upper bound for integration, default is set to the support
- of the distribution, lb and ub are inclusive (ul<=k<=ub)
- conditional : boolean (False)
- If true then the expectation is corrected by the conditional
- probability of the integration interval. The return value is the
- expectation of the function, conditional on being in the given
- interval (k such that ul<=k<=ub).
-
- Returns
- -------
- expected value : float
-
- Notes
- -----
- * function is not vectorized
- * accuracy: uses self.moment_tol as stopping criterium
- for heavy tailed distribution e.g. zipf(4), accuracy for
- mean, variance in example is only 1e-5,
- increasing precision (moment_tol) makes zipf very slow
- * suppnmin=100 internal parameter for minimum number of points to evaluate
- could be added as keyword parameter, to evaluate functions with
- non-monotonic shapes, points include integers in (-suppnmin, suppnmin)
- * uses maxcount=1000 limits the number of points that are evaluated
- to break loop for infinite sums
- (a maximum of suppnmin+1000 positive plus suppnmin+1000 negative integers
- are evaluated)
-
- """
-
- #moment_tol = 1e-12 # increase compared to self.moment_tol,
- # too slow for only small gain in precision for zipf
-
- #avoid endless loop with unbound integral, eg. var of zipf(2)
- maxcount = 1000
- suppnmin = 100 #minimum number of points to evaluate (+ and -)
-
- if func is None:
- def fun(x):
- #loc and args from outer scope
- return (x+loc)*self._pmf(x, *args)
- else:
- def fun(x):
- #loc and args from outer scope
- return func(x+loc)*self._pmf(x, *args)
- # used pmf because _pmf does not check support in randint
- # and there might be problems(?) with correct self.a, self.b at this stage
- # maybe not anymore, seems to work now with _pmf
-
- self._argcheck(*args) # (re)generate scalar self.a and self.b
- if lb is None:
- lb = (self.a)
- if ub is None:
- ub = (self.b)
- if conditional:
- invfac = self.sf(lb,*args) - self.sf(ub+1,*args)
- else:
- invfac = 1.0
-
- tot = 0.0
- low, upp = self._ppf(0.001, *args), self._ppf(0.999, *args)
- low = max(min(-suppnmin, low), lb)
- upp = min(max(suppnmin, upp), ub)
- supp = np.arange(low, upp+1, self.inc) #check limits
- #print 'low, upp', low, upp
- tot = np.sum(fun(supp))
- diff = 1e100
- pos = upp + self.inc
- count = 0
-
- #handle cases with infinite support
-
- while (pos <= ub) and (diff > self.moment_tol) and count <= maxcount:
- diff = fun(pos)
- tot += diff
- pos += self.inc
- count += 1
-
- if self.a < 0: #handle case when self.a = -inf
- diff = 1e100
- pos = low - self.inc
- while (pos >= lb) and (diff > self.moment_tol) and count <= maxcount:
- diff = fun(pos)
- tot += diff
- pos -= self.inc
- count += 1
- if count > maxcount:
- # fixme: replace with proper warning
- print 'sum did not converge'
- return tot/invfac
-
-
# Binomial
class binom_gen(rv_discrete):
@@ -5303,13 +4491,11 @@
def _argcheck(self, n, pr):
self.b = n
return (n>=0) & (pr >= 0) & (pr <= 1)
- def _logpmf(self, x, n, pr):
- k = floor(x)
- combiln = (gamln(n+1) - (gamln(k+1) +
- gamln(n-k+1)))
- return combiln + k*np.log(pr) + (n-k)*np.log(1-pr)
def _pmf(self, x, n, pr):
- return exp(self._logpmf(x, n, pr))
+ k = floor(x)
+ combiln = (special.gammaln(n+1) - (special.gammaln(k+1) +
+ special.gammaln(n-k+1)))
+ return np.exp(combiln + k*np.log(pr) + (n-k)*np.log(1-pr))
def _cdf(self, x, n, pr):
k = floor(x)
vals = special.bdtr(k,n,pr)
@@ -5352,18 +4538,16 @@
return binom_gen._rvs(self, 1, pr)
def _argcheck(self, pr):
return (pr >=0 ) & (pr <= 1)
- def _logpmf(self, x, pr):
- return binom._logpmf(x, 1, pr)
def _pmf(self, x, pr):
- return binom._pmf(x, 1, pr)
+ return binom_gen._pmf(self, x, 1, pr)
def _cdf(self, x, pr):
- return binom._cdf(x, 1, pr)
+ return binom_gen._cdf(self, x, 1, pr)
def _sf(self, x, pr):
- return binom._sf(x, 1, pr)
+ return binom_gen._sf(self, x, 1, pr)
def _ppf(self, q, pr):
- return binom._ppf(q, 1, pr)
+ return binom_gen._ppf(self, q, 1, pr)
def _stats(self, pr):
- return binom._stats(1, pr)
+ return binom_gen._stats(self, 1, pr)
def _entropy(self, pr):
return -pr*log(pr)-(1-pr)*log(1-pr)
bernoulli = bernoulli_gen(b=1,name='bernoulli',shapes="pr",extradoc="""
@@ -5397,11 +4581,8 @@
def _argcheck(self, n, pr):
return (n >= 0) & (pr >= 0) & (pr <= 1)
def _pmf(self, x, n, pr):
- coeff = exp(gamln(n+x) - gamln(x+1) - gamln(n))
+ coeff = exp(special.gammaln(n+x) - special.gammaln(x+1) - special.gammaln(n))
return coeff * power(pr,n) * power(1-pr,x)
- def _logpmf(self, x, n, pr):
- coeff = gamln(n+x) - gamln(x+1) - gamln(n)
- return coeff + n*log(pr) + x*log(1-pr)
def _cdf(self, x, n, pr):
k = floor(x)
return special.betainc(n, k+1, pr)
@@ -5441,8 +4622,6 @@
return (pr<=1) & (pr >= 0)
def _pmf(self, k, pr):
return (1-pr)**(k-1) * pr
- def _logpmf(self, k, pr):
- return (k-1)*log(1-pr) + pr
def _cdf(self, x, pr):
k = floor(x)
return (1.0-(1.0-pr)**k)
@@ -5481,16 +4660,14 @@
self.a = N-(M-n)
self.b = min(n,N)
return cond
- def _logpmf(self, k, M, n, N):
+ def _pmf(self, k, M, n, N):
tot, good = M, n
bad = tot - good
- return gamln(good+1) - gamln(good-k+1) - gamln(k+1) + gamln(bad+1) \
- - gamln(bad-N+k+1) - gamln(N-k+1) - gamln(tot+1) + gamln(tot-N+1) \
- + gamln(N+1)
- def _pmf(self, k, M, n, N):
+ return np.exp(lgam(good+1) - lgam(good-k+1) - lgam(k+1) + lgam(bad+1)
+ - lgam(bad-N+k+1) - lgam(N-k+1) - lgam(tot+1) + lgam(tot-N+1)
+ + lgam(N+1))
#same as the following but numerically more precise
#return comb(good,k) * comb(bad,N-k) / comb(tot,N)
- return exp(self._logpmf(k, M, n, N))
def _stats(self, M, n, N):
tot, good = M, n
n = good*1.0
@@ -5570,7 +4747,7 @@
def _rvs(self, mu):
return mtrand.poisson(mu, self._size)
def _pmf(self, k, mu):
- Pk = k*log(mu)-gamln(k+1) - mu
+ Pk = k*log(mu)-special.gammaln(k+1) - mu
return exp(Pk)
def _cdf(self, x, mu):
k = floor(x)
Modified: branches/0.8.x/scipy/stats/morestats.py
===================================================================
--- branches/0.8.x/scipy/stats/morestats.py 2010-06-03 02:41:25 UTC (rev 6481)
+++ branches/0.8.x/scipy/stats/morestats.py 2010-06-03 14:00:33 UTC (rev 6482)
@@ -18,7 +18,7 @@
from numpy.testing.decorators import setastest
import warnings
-__all__ = ['find_repeats', 'mvsdist',
+__all__ = ['find_repeats',
'bayes_mvs', 'kstat', 'kstatvar', 'probplot', 'ppcc_max', 'ppcc_plot',
'boxcox_llf', 'boxcox', 'boxcox_normmax', 'boxcox_normplot',
'shapiro', 'anderson', 'ansari', 'bartlett', 'levene', 'binom_test',
@@ -100,7 +100,7 @@
return _gauss_mvs(x, n, alpha)
xbar = x.mean()
C = x.var()
- # mean
+ # mean
fac = sqrt(C/(n-1))
tval = distributions.t.ppf((1+alpha)/2.0,n-1)
delta = fac*tval
@@ -136,40 +136,6 @@
return (mp,(ma,mb)),(vp,(va,vb)),(stp,(sta,stb))
-def mvsdist(data):
- """Return 'frozen' distributions for mean, variance, and standard deviation of data.
-
- Parameters
- ----------
- data : array-like (raveled to 1-d)
-
- Returns
- -------
- mdist : "frozen" distribution object
- Distribution object representing the mean of the data
- vdist : "frozen" distribution object
- Distribution object representing the variance of the data
- sdist : "frozen" distribution object
- Distribution object representing the standard deviation of the data
- """
- x = ravel(data)
- n = len(x)
- if (n < 2):
- raise ValueError, "Need at least 2 data-points."
- xbar = x.mean()
- C = x.var()
- if (n > 1000): # gaussian approximations for large n
- mdist = distributions.norm(loc=xbar, scale=math.sqrt(C/n))
- sdist = distributions.norm(loc=math.sqrt(C), scale=math.sqrt(C/(2.*n)))
- vdist = distributions.norm(loc=C, scale=math.sqrt(2.0/n)*C)
- else:
- nm1 = n-1
- fac = n*C/2.
- val = nm1/2.
- mdist = distributions.t(nm1,loc=xbar,scale=math.sqrt(C/nm1))
- sdist = distributions.gengamma(val,-2,scale=math.sqrt(fac))
- vdist = distributions.invgamma(val,scale=fac)
- return mdist, vdist, sdist
################################
Modified: branches/0.8.x/scipy/stats/stats.py
===================================================================
--- branches/0.8.x/scipy/stats/stats.py 2010-06-03 02:41:25 UTC (rev 6481)
+++ branches/0.8.x/scipy/stats/stats.py 2010-06-03 14:00:33 UTC (rev 6482)
@@ -2,7 +2,7 @@
#
# Disclaimer
#
-# This software is provided "as-is". There are no exprgoessed or implied
+# This software is provided "as-is". There are no expressed or implied
# warranties of any kind, including, but not limited to, the warranties
# of merchantability and fittness for a given application. In no event
# shall Gary Strangman be liable for any direct, indirect, incidental,
@@ -1777,6 +1777,18 @@
+def zmap(scores, compare, axis=0):
+ """
+Returns an array of z-scores the shape of scores (e.g., [x,y]), compared to
+array passed to compare (e.g., [time,x,y]). Assumes collapsing over dim 0
+of the compare array.
+
+"""
+ mns = np.mean(compare,axis)
+ sstd = samplestd(compare,0)
+ return (scores - mns) / sstd
+
+
#####################################
####### TRIMMING FUNCTIONS #######
#####################################
Modified: branches/0.8.x/scipy/stats/tests/test_continuous_basic.py
===================================================================
--- branches/0.8.x/scipy/stats/tests/test_continuous_basic.py 2010-06-03 02:41:25 UTC (rev 6481)
+++ branches/0.8.x/scipy/stats/tests/test_continuous_basic.py 2010-06-03 14:00:33 UTC (rev 6482)
@@ -175,14 +175,11 @@
yield check_cdf_ppf, distfn, arg, distname
yield check_sf_isf, distfn, arg, distname
yield check_pdf, distfn, arg, distname
- if distname in ['wald']: continue
- yield check_pdf_logpdf, distfn, arg, distname
- yield check_cdf_logcdf, distfn, arg, distname
- yield check_sf_logsf, distfn, arg, distname
if distname in distmissing:
alpha = 0.01
- # yield check_distribution_rvs, dist, args, alpha, rvs
+ yield check_distribution_rvs, dist, args, alpha, rvs
+
@npt.dec.slow
def test_cont_basic_slow():
# same as above for slow distributions
@@ -205,14 +202,14 @@
yield check_cdf_ppf, distfn, arg, distname
yield check_sf_isf, distfn, arg, distname
yield check_pdf, distfn, arg, distname
- yield check_pdf_logpdf, distfn, arg, distname
- yield check_cdf_logcdf, distfn, arg, distname
- yield check_sf_logsf, distfn, arg, distname
#yield check_oth, distfn, arg # is still missing
if distname in distmissing:
alpha = 0.01
yield check_distribution_rvs, dist, args, alpha, rvs
+
+
+
def check_moment(distfn, arg, m, v, msg):
m1 = distfn.moment(1,*arg)
m2 = distfn.moment(2,*arg)
@@ -317,37 +314,7 @@
npt.assert_almost_equal(pdfv, cdfdiff,
decimal=DECIMAL, err_msg= msg + ' - cdf-pdf relationship')
-def check_pdf_logpdf(distfn, args, msg):
- # compares pdf at several points with the log of the pdf
- points = np.array([0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8])
- vals = distfn.ppf(points, *args)
- pdf = distfn.pdf(vals, *args)
- logpdf = distfn.logpdf(vals, *args)
- pdf = pdf[pdf != 0]
- logpdf = logpdf[np.isfinite(logpdf)]
- npt.assert_almost_equal(np.log(pdf), logpdf, decimal=7, err_msg=msg + " - logpdf-log(pdf) relationship")
-def check_sf_logsf(distfn, args, msg):
- # compares sf at several points with the log of the sf
- points = np.array([0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8])
- vals = distfn.ppf(points, *args)
- sf = distfn.sf(vals, *args)
- logsf = distfn.logsf(vals, *args)
- sf = sf[sf != 0]
- logsf = logsf[np.isfinite(logsf)]
- npt.assert_almost_equal(np.log(sf), logsf, decimal=7, err_msg=msg + " - logsf-log(sf) relationship")
-
-def check_cdf_logcdf(distfn, args, msg):
- # compares cdf at several points with the log of the cdf
- points = np.array([0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8])
- vals = distfn.ppf(points, *args)
- cdf = distfn.cdf(vals, *args)
- logcdf = distfn.logcdf(vals, *args)
- cdf = cdf[cdf != 0]
- logcdf = logcdf[np.isfinite(logcdf)]
- npt.assert_almost_equal(np.log(cdf), logcdf, decimal=7, err_msg=msg + " - logcdf-log(cdf) relationship")
-
-
def check_distribution_rvs(dist, args, alpha, rvs):
#test from scipy.stats.tests
#this version reuses existing random variables
Modified: branches/0.8.x/scipy/stats/tests/test_distributions.py
===================================================================
--- branches/0.8.x/scipy/stats/tests/test_distributions.py 2010-06-03 02:41:25 UTC (rev 6481)
+++ branches/0.8.x/scipy/stats/tests/test_distributions.py 2010-06-03 14:00:33 UTC (rev 6482)
@@ -380,47 +380,6 @@
assert_array_equal(b, a)
assert_array_equal(c, [2] * numpy.size(a))
-import sys
-class TestFitMethod(TestCase):
- skip = ['ncf']
- def test_fit(self):
- for func, dist, args, alpha in test_all_distributions():
- if dist in self.skip:
- continue
- distfunc = getattr(stats, dist)
- res = distfunc.rvs(*args, size=200)
- vals = distfunc.fit(res)
- if dist in ['erlang', 'frechet']:
- assert(len(vals)==len(args))
- else:
- assert(len(vals) == 2+len(args))
- def test_fix_fit(self):
- for func, dist, args, alpha in test_all_distributions():
- # Not sure why 'ncf', and 'beta' are failing
- # erlang and frechet have different len(args) than distfunc.numargs
- if dist in self.skip + ['erlang', 'frechet', 'beta']:
- continue
- distfunc = getattr(stats, dist)
- res = distfunc.rvs(*args, size=200)
- vals = distfunc.fit(res,floc=0)
- vals2 = distfunc.fit(res,fscale=1)
- assert(len(vals) == 2+len(args))
- assert(vals[-2] == 0)
- assert(vals2[-1] == 1)
- assert(len(vals2) == 2+len(args))
- if len(args) > 0:
- vals3 = distfunc.fit(res, f0=args[0])
- assert(len(vals3) == 2+len(args))
- assert(vals3[0] == args[0])
- if len(args) > 1:
- vals4 = distfunc.fit(res, f1=args[1])
- assert(len(vals4) == 2+len(args))
- assert(vals4[1] == args[1])
- if len(args) > 2:
- vals5 = distfunc.fit(res, f2=args[2])
- assert(len(vals5) == 2+len(args))
- assert(vals5[2] == args[2])
-
if __name__ == "__main__":
run_module_suite()
From scipy-svn at scipy.org Thu Jun 3 10:00:53 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Thu, 3 Jun 2010 09:00:53 -0500 (CDT)
Subject: [Scipy-svn] r6483 - branches/0.8.x/doc/release
Message-ID: <20100603140053.A7FAB39CB09@scipy.org>
Author: rgommers
Date: 2010-06-03 09:00:53 -0500 (Thu, 03 Jun 2010)
New Revision: 6483
Modified:
branches/0.8.x/doc/release/0.8.0-notes.rst
Log:
REF: Remove mention of changes to scipy.stats from release notes.
Modified: branches/0.8.x/doc/release/0.8.0-notes.rst
===================================================================
--- branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-03 14:00:33 UTC (rev 6482)
+++ branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-03 14:00:53 UTC (rev 6483)
@@ -180,22 +180,6 @@
argument to `scipy.io.savemat` and friends.
-Improvements to scipy.stats
----------------------------
-
-* addition of mvsdist function which returns distribution objects
- providing full information about mean, variance, and standard deviation
- of a data-set
-* addition of 'median', 'mean', 'std', 'var', 'interval', 'logpdf',
- 'logcdf', 'logsf', 'expect'
-* addition of 'fit_loc_scale' (deprecation of 'est_loc_scale')
-* improvement to 'fit' method of distribution objects so that sub-classes
- can add a _fitstart method to fix the starting position of the arguments.
- Also, some parameters can be fixed and the data-fitting proceed over the
- remaining free parameters using f0..fn and floc and fscale keywords to the
- fit function.
-
-
Removed features
================
From scipy-svn at scipy.org Fri Jun 4 11:02:05 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Fri, 4 Jun 2010 10:02:05 -0500 (CDT)
Subject: [Scipy-svn] r6484 - branches/0.8.x/scipy/signal/tests
Message-ID: <20100604150205.ACE2339CAE7@scipy.org>
Author: rgommers
Date: 2010-06-04 10:02:05 -0500 (Fri, 04 Jun 2010)
New Revision: 6484
Modified:
branches/0.8.x/scipy/signal/tests/test_ltisys.py
Log:
BUG: Fix signal.ltisys test that crashes interpreter on Windows.
Modified: branches/0.8.x/scipy/signal/tests/test_ltisys.py
===================================================================
--- branches/0.8.x/scipy/signal/tests/test_ltisys.py 2010-06-03 14:00:53 UTC (rev 6483)
+++ branches/0.8.x/scipy/signal/tests/test_ltisys.py 2010-06-04 15:02:05 UTC (rev 6484)
@@ -14,7 +14,7 @@
def test_basic(self):
for p, q, r in [
(3, 3, 3),
- (0, 3, 3),
+ (1, 3, 3),
(1, 1, 1)]:
yield self.tst_matrix_shapes, p, q, r
@@ -64,7 +64,7 @@
# This test triggers a "BadCoefficients" warning from scipy.signal.filter_design,
# but the test passes. I think the warning is related to the incomplete handling
# of multi-input systems in scipy.signal.
-
+
# A system with two state variables, two inputs, and one output.
A = np.array([[-1.0, 0.0], [0.0, -2.0]])
B = np.array([[1.0, 0.0], [0.0, 1.0]])
@@ -116,7 +116,7 @@
def test_03(self):
"""Specify an initial condition as a scalar."""
-
+
# First order system: x'(t) + x(t) = u(t), x(0)=3.0
# Exact impulse response is x(t) = 4*exp(-t).
system = ([1.0],[1.0,1.0])
@@ -175,7 +175,7 @@
def test_03(self):
"""Specify an initial condition as a scalar."""
-
+
# First order system: x'(t) + x(t) = u(t), x(0)=3.0
# Exact step response is x(t) = 1 + 2*exp(-t).
system = ([1.0],[1.0,1.0])
From scipy-svn at scipy.org Fri Jun 4 12:47:49 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Fri, 4 Jun 2010 11:47:49 -0500 (CDT)
Subject: [Scipy-svn] r6485 - tags
Message-ID: <20100604164749.BA2EE39CAED@scipy.org>
Author: rgommers
Date: 2010-06-04 11:47:49 -0500 (Fri, 04 Jun 2010)
New Revision: 6485
Added:
tags/0.8.0b1/
Log:
Create tag 0.8.0b1
Copied: tags/0.8.0b1 (from rev 6484, branches/0.8.x)
From scipy-svn at scipy.org Sat Jun 5 22:57:59 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Sat, 5 Jun 2010 21:57:59 -0500 (CDT)
Subject: [Scipy-svn] r6486 - branches/0.8.x
Message-ID: <20100606025759.D3EE839CAEF@scipy.org>
Author: rgommers
Date: 2010-06-05 21:57:59 -0500 (Sat, 05 Jun 2010)
New Revision: 6486
Modified:
branches/0.8.x/setup.py
Log:
REL: reset version tag after beta release.
Modified: branches/0.8.x/setup.py
===================================================================
--- branches/0.8.x/setup.py 2010-06-04 16:47:49 UTC (rev 6485)
+++ branches/0.8.x/setup.py 2010-06-06 02:57:59 UTC (rev 6486)
@@ -43,8 +43,8 @@
MAJOR = 0
MINOR = 8
MICRO = 0
-ISRELEASED = True
-VERSION = '%d.%d.%db1' % (MAJOR, MINOR, MICRO)
+ISRELEASED = False
+VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
# update it when the contents of directories change.
From scipy-svn at scipy.org Mon Jun 7 02:20:43 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Mon, 7 Jun 2010 01:20:43 -0500 (CDT)
Subject: [Scipy-svn] r6487 - trunk/scipy/sparse/linalg/dsolve
Message-ID: <20100607062043.27BEC39CAF8@scipy.org>
Author: cdavid
Date: 2010-06-07 01:20:42 -0500 (Mon, 07 Jun 2010)
New Revision: 6487
Modified:
trunk/scipy/sparse/linalg/dsolve/SConscript
Log:
BUG: attempt at fixing #1176.
Modified: trunk/scipy/sparse/linalg/dsolve/SConscript
===================================================================
--- trunk/scipy/sparse/linalg/dsolve/SConscript 2010-06-06 02:57:59 UTC (rev 6486)
+++ trunk/scipy/sparse/linalg/dsolve/SConscript 2010-06-07 06:20:42 UTC (rev 6487)
@@ -1,4 +1,5 @@
-from os.path import join as pjoin
+import os
+import glob
import sys
from numscons import GetNumpyEnvironment
@@ -29,46 +30,22 @@
if sys.platform == 'win32':
superlu_def.append((('NO_TIMER'), 1))
superlu_def.append((('USE_VENDOR_BLAS'), 2))
-superlu_env.Append(CPPDEFINES = superlu_def)
+superlu_env.Append(CPPDEFINES=superlu_def)
+superlu_env.Append(CPPPATH=[os.path.join('SuperLU', 'SRC')])
-superlu_src = [pjoin('SuperLU', 'SRC', s) for s in [ "ccolumn_bmod.c",
-"ccolumn_dfs.c", "ccopy_to_ucol.c", "cgscon.c", "cgsequ.c", "cgsrfs.c",
-"cgssv.c", "cgssvx.c", "cgstrf.c", "cgstrs.c", "clacon.c", "clangs.c",
-"claqgs.c", "cmemory.c", "colamd.c", "cpanel_bmod.c", "cpanel_dfs.c",
-"cpivotL.c", "cpivotgrowth.c", "cpruneL.c", "creadhb.c", "csnode_bmod.c",
-"csnode_dfs.c", "csp_blas2.c", "csp_blas3.c", "cutil.c", "dGetDiagU.c",
-"dcolumn_bmod.c", "dcolumn_dfs.c", "dcomplex.c", "dcopy_to_ucol.c", "dgscon.c",
-"dgsequ.c", "dgsrfs.c", "dgssv.c", "dgssvx.c", "dgstrf.c", "dgstrs.c",
-"dgstrsL.c", "dlacon.c", "dlamch.c", "dlangs.c", "dlaqgs.c", "dmemory.c",
-"dpanel_bmod.c", "dpanel_dfs.c", "dpivotL.c", "dpivotgrowth.c", "dpruneL.c",
-"dreadhb.c", "dsnode_bmod.c", "dsnode_dfs.c", "dsp_blas2.c", "dsp_blas3.c",
-"dutil.c", "dzsum1.c", "get_perm_c.c", "heap_relax_snode.c", "icmax1.c",
-"izmax1.c", "memory.c", "mmd.c", "relax_snode.c", "scolumn_bmod.c",
-"scolumn_dfs.c", "scomplex.c", "scopy_to_ucol.c", "scsum1.c", "sgscon.c",
-"sgsequ.c", "sgsrfs.c", "sgssv.c", "sgssvx.c", "sgstrf.c", "sgstrs.c",
-"slacon.c", "slamch.c", "slangs.c", "slaqgs.c", "smemory.c", "sp_coletree.c",
-"sp_ienv.c", "sp_preorder.c", "spanel_bmod.c", "spanel_dfs.c", "spivotL.c",
-"spivotgrowth.c", "spruneL.c", "sreadhb.c", "ssnode_bmod.c", "ssnode_dfs.c",
-"ssp_blas2.c", "ssp_blas3.c", "superlu_timer.c", "sutil.c", "util.c",
-"xerbla.c", "zcolumn_bmod.c", "zcolumn_dfs.c", "zcopy_to_ucol.c", "zgscon.c",
-"zgsequ.c", "zgsrfs.c", "zgssv.c", "zgssvx.c", "zgstrf.c", "zgstrs.c",
-"zlacon.c", "zlangs.c", "zlaqgs.c", "zmemory.c", "zpanel_bmod.c",
-"zpanel_dfs.c", "zpivotL.c", "zpivotgrowth.c", "zpruneL.c", "zreadhb.c",
-"zsnode_bmod.c", "zsnode_dfs.c", "zsp_blas2.c", "zsp_blas3.c", "zutil.c"]]
+superlu_src = env.Glob(os.path.join('SuperLU', 'SRC', "*.c"))
# XXX: we should detect whether lsame is already defined in BLAS/LAPACK. Here,
# when using MSVC + MKL, lsame is already in MKL
if not (built_with_mstools(env) and (not built_with_gnu_f77(env))):
- superlu_src.append(pjoin("SuperLU", "SRC", "lsame.c"))
-superlu = superlu_env.DistutilsStaticExtLibrary('superlu_src', source = superlu_src)
+ superlu_src.append(os.path.join("SuperLU", "SRC", "lsame.c"))
+superlu = superlu_env.DistutilsStaticExtLibrary('superlu_src', source=superlu_src)
# Build python extensions
pyenv = env.Clone()
-pyenv.Append(CPPPATH = [pjoin('SuperLU', 'SRC')])
-pyenv.Prepend(LIBS = superlu)
+pyenv.Append(CPPPATH=[os.path.join('SuperLU', 'SRC')])
+pyenv.Prepend(LIBPATH=["."])
+pyenv.Prepend(LIBS=["superlu_src"])
common_src = ['_superlu_utils.c', '_superluobject.c']
-for prec in ['z', 'd', 'c', 's']:
- pyenv.NumpyPythonExtension('_%ssuperlu' % prec,
- source = common_src + \
- ['_%ssuperlumodule.c' % prec])
+pyenv.NumpyPythonExtension('_superlu', source=common_src + ['_superlumodule.c'])
From scipy-svn at scipy.org Mon Jun 7 07:42:24 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Mon, 7 Jun 2010 06:42:24 -0500 (CDT)
Subject: [Scipy-svn] r6488 - branches/0.8.x
Message-ID: <20100607114224.7DAB239CAEB@scipy.org>
Author: rgommers
Date: 2010-06-07 06:42:24 -0500 (Mon, 07 Jun 2010)
New Revision: 6488
Modified:
branches/0.8.x/pavement.py
Log:
REL: update Changelog generation for 0.8.x branch.
Modified: branches/0.8.x/pavement.py
===================================================================
--- branches/0.8.x/pavement.py 2010-06-07 06:20:42 UTC (rev 6487)
+++ branches/0.8.x/pavement.py 2010-06-07 11:42:24 UTC (rev 6488)
@@ -110,7 +110,7 @@
# Start/end of the log (from git)
LOG_START = 'svn/tags/0.7.0'
-LOG_END = 'master'
+LOG_END = '0.8.x'
# Virtualenv bootstrap stuff
BOOTSTRAP_DIR = "bootstrap"
From scipy-svn at scipy.org Mon Jun 7 07:50:47 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Mon, 7 Jun 2010 06:50:47 -0500 (CDT)
Subject: [Scipy-svn] r6489 - branches/0.8.x/doc/release
Message-ID: <20100607115047.588A339CAEB@scipy.org>
Author: rgommers
Date: 2010-06-07 06:50:47 -0500 (Mon, 07 Jun 2010)
New Revision: 6489
Modified:
branches/0.8.x/doc/release/0.8.0-notes.rst
Log:
REL: update release notes for 0.8.0 release.
Modified: branches/0.8.x/doc/release/0.8.0-notes.rst
===================================================================
--- branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-07 11:42:24 UTC (rev 6488)
+++ branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-07 11:50:47 UTC (rev 6489)
@@ -4,7 +4,7 @@
.. contents::
-SciPy 0.8.0 is the culmination of XXX months of hard work. It contains
+SciPy 0.8.0 is the culmination of 17 months of hard work. It contains
many new features, numerous bug-fixes, improved test coverage and
better documentation. There have been a number of deprecations and
API changes in this release, which are documented below. All users
@@ -12,16 +12,14 @@
of bug-fixes and optimizations. Moreover, our development attention
will now shift to bug-fix releases on the 0.8.x branch, and on adding
new features on the development trunk. This release requires Python
-2.4 - 2.6 and NumPy 1.3 or greater.
+2.4 - 2.6 and NumPy 1.4.1 or greater.
Please note that SciPy is still considered to have "Beta" status, as
we work toward a SciPy 1.0.0 release. The 1.0.0 release will mark a
major milestone in the development of SciPy, after which changing the
package structure or API will be much more difficult. Whilst these
pre-1.0 releases are considered to have "Beta" status, we are
-committed to making them as bug-free as possible. For example, in
-addition to fixing numerous bugs in this release, we have also doubled
-the number of unit tests since the last release.
+committed to making them as bug-free as possible.
However, until the 1.0 release, we are aggressively reviewing and
refining the functionality, organization, and interface. This is being
@@ -37,7 +35,8 @@
Python 3 compatibility is planned and is currently technically
feasible, since Numpy has been ported. However, since the Python 3
compatible Numpy 2.0 has not been released yet, support for Python 3
-in Scipy might not yet be included in Scipy 0.8.
+in Scipy is not yet included in Scipy 0.8. SciPy 0.9, planned for fall
+2010, will very likely include experimental support for Python 3.
Major documentation improvements
================================
From scipy-svn at scipy.org Mon Jun 7 08:20:19 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Mon, 7 Jun 2010 07:20:19 -0500 (CDT)
Subject: [Scipy-svn] r6490 - trunk/scipy/stats
Message-ID: <20100607122019.5260439CAEB@scipy.org>
Author: rgommers
Date: 2010-06-07 07:20:19 -0500 (Mon, 07 Jun 2010)
New Revision: 6490
Modified:
trunk/scipy/stats/distributions.py
Log:
DOC: merge wiki edits for stats.distributions.rv_continuous and rv_discrete.
Those docstrings are not complete yet, but it's an improvement on what's
currently in trunk.
Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py 2010-06-07 11:50:47 UTC (rev 6489)
+++ trunk/scipy/stats/distributions.py 2010-06-07 12:20:19 UTC (rev 6490)
@@ -694,23 +694,32 @@
class rv_continuous(rv_generic):
- """A generic continuous random variable class meant for subclassing.
+ """
+ A generic continuous random variable class meant for subclassing.
`rv_continuous` is a base class to construct specific distribution classes
- and instances from for continuous random variables.
+ and instances from for continuous random variables. It cannot be used
+ directly as a distribution.
Parameters
----------
- momtype :
- a :
- b :
- xa :
- xb :
+ momtype : int, optional
+ The type of generic moment calculation to use (check this).
+ a : float, optional
+ Lower bound of the support of the distribution, default is minus
+ infinity.
+ b : float, optional
+ Upper bound of the support of the distribution, default is plus
+ infinity.
+ xa : float, optional
+ Lower bound for fixed point calculation for generic ppf.
+ xb : float, optional
+ Upper bound for fixed point calculation for generic ppf.
xtol : float, optional
- The tolerance ....
+ The tolerance for fixed point calculation for generic ppf.
badvalue : object, optional
- The value in (masked) arrays that indicates a value that should be
- ignored.
+ The value in a result arrays that indicates a value that for which
+ some argument restriction is violated, default is np.nan.
name : str, optional
The name of the instance. This string is used to construct the default
example for distributions.
@@ -720,7 +729,7 @@
for backwards compatibility, do not use for new subclasses.
shapes : str, optional
The shape of the distribution. For example ``"m, n"`` for a
- distribution that takes two integers as the first two arguments for all
+ distribution that takes two integers as the two shape arguments for all
its methods.
extradoc : str, optional
This string is used as the last part of the docstring returned when a
@@ -729,8 +738,135 @@
Methods
-------
- ...
+ rvs(, loc=0, scale=1, size=1)
+ random variates
+ pdf(x, , loc=0, scale=1)
+ probability density function
+
+ cdf(x, , loc=0, scale=1)
+ cumulative density function
+
+ sf(x, , loc=0, scale=1)
+ survival function (1-cdf --- sometimes more accurate)
+
+ ppf(q, , loc=0, scale=1)
+ percent point function (inverse of cdf --- quantiles)
+
+ isf(q, , loc=0, scale=1)
+ inverse survival function (inverse of sf)
+
+ moments(n, )
+ non-central n-th moment of the standard distribution (oc=0, scale=1)
+
+ stats(, loc=0, scale=1, moments='mv')
+ mean('m'), variance('v'), skew('s'), and/or kurtosis('k')
+
+ entropy(, loc=0, scale=1)
+ (differential) entropy of the RV.
+
+ fit(data, , loc=0, scale=1)
+ Parameter estimates for generic data
+
+ __call__(, loc=0, scale=1)
+ calling a distribution instance creates a frozen RV object with the
+ same methods but holding the given shape, location, and scale fixed.
+ see Notes section
+
+ **Parameters for Methods**
+
+ x : array-like
+ quantiles
+ q : array-like
+ lower or upper tail probability
+ : array-like
+ shape parameters
+ loc : array-like, optional
+ location parameter (default=0)
+ scale : array-like, optional
+ scale parameter (default=1)
+ size : int or tuple of ints, optional
+ shape of random variates (default computed from input arguments )
+ moments : string, optional
+ composed of letters ['mvsk'] specifying which moments to compute where
+ 'm' = mean, 'v' = variance, 's' = (Fisher's) skew and
+ 'k' = (Fisher's) kurtosis. (default='mv')
+ n : int
+ order of moment to calculate in method moments
+
+
+ **Methods that can be overwritten by subclasses**
+ ::
+
+ _rvs
+ _pdf
+ _cdf
+ _sf
+ _ppf
+ _isf
+ _stats
+ _munp
+ _entropy
+ _argcheck
+
+ There are additional (internal and private) generic methods that can
+ be useful for cross-checking and for debugging, but might work in all
+ cases when directly called.
+
+
+ Notes
+ -----
+
+ **Frozen Distribution**
+
+ Alternatively, the object may be called (as a function) to fix the shape,
+ location, and scale parameters returning a "frozen" continuous RV object:
+
+ rv = generic(, loc=0, scale=1)
+ frozen RV object with the same methods but holding the given shape,
+ location, and scale fixed
+
+ **Subclassing**
+
+ New random variables can be defined by subclassing rv_continuous class
+ and re-defining at least the
+
+ _pdf or the cdf method which will be given clean arguments (in between a
+ and b) and passing the argument check method
+
+ If postive argument checking is not correct for your RV
+ then you will also need to re-define ::
+
+ _argcheck
+
+ Correct, but potentially slow defaults exist for the remaining
+ methods but for speed and/or accuracy you can over-ride ::
+
+ _cdf, _ppf, _rvs, _isf, _sf
+
+ Rarely would you override _isf and _sf but you could.
+
+ Statistics are computed using numerical integration by default.
+ For speed you can redefine this using
+
+ _stats
+ - take shape parameters and return mu, mu2, g1, g2
+ - If you can't compute one of these, return it as None
+ - Can also be defined with a keyword argument moments=
+ where is a string composed of 'm', 'v', 's',
+ and/or 'k'. Only the components appearing in string
+ should be computed and returned in the order 'm', 'v',
+ 's', or 'k' with missing values returned as None
+
+ OR
+
+ You can override
+
+ _munp
+ takes n and shape parameters and returns
+ the nth non-central moment of the distribution.
+
+
Examples
--------
To create a new Gaussian distribution, we would do the following::
@@ -740,6 +876,7 @@
def _pdf:
...
...
+
"""
def __init__(self, momtype=1, a=None, b=None, xa=-10.0, xb=10.0,
@@ -4444,20 +4581,28 @@
# x_k, p(x_k) lists in initialization
class rv_discrete(rv_generic):
- """A generic discrete random variable class meant for subclassing.
+ """
+ A generic discrete random variable class meant for subclassing.
`rv_discrete` is a base class to construct specific distribution classes
- and instances from for discrete random variables.
+ and instances from for discrete random variables. rv_discrete can be used
+ to construct an arbitrary distribution with defined by a list of support
+ points and the corresponding probabilities.
Parameters
----------
- momtype :
- a :
- b :
- xa :
- xb :
- xtol : float, optional
- The tolerance ....
+ a : float, optional
+ Lower bound of the support of the distribution, default: 0
+ b : float, optional
+ Upper bound of the support of the distribution, default: plus infinity
+ moment_tol : float, optional
+ The tolerance for the generic calculation of moments
+ values : tuple of two array_like
+ (xk, pk) where xk are points (integers) with positive probability pk
+ with sum(pk) = 1
+ inc : integer
+ increment for the support of the distribution, default: 1
+ other values have not been tested
badvalue : object, optional
The value in (masked) arrays that indicates a value that should be
ignored.
@@ -4477,20 +4622,95 @@
subclass has no docstring of its own. Note: `extradoc` exists for
backwards compatibility, do not use for new subclasses.
+
Methods
-------
- ...
+ generic.rvs(, loc=0, size=1)
+ random variates
+
+ generic.pmf(x, , loc=0)
+ probability mass function
+
+ generic.cdf(x, , loc=0)
+ cumulative density function
+
+ generic.sf(x, , loc=0)
+ survival function (1-cdf --- sometimes more accurate)
+
+ generic.ppf(q, , loc=0)
+ percent point function (inverse of cdf --- percentiles)
+
+ generic.isf(q, , loc=0)
+ inverse survival function (inverse of sf)
+
+ generic.stats(, loc=0, moments='mv')
+ mean('m', axis=0), variance('v'), skew('s'), and/or kurtosis('k')
+
+ generic.entropy(, loc=0)
+ entropy of the RV
+
+ generic(, loc=0)
+ calling a distribution instance returns a frozen distribution
+
+ Notes
+ -----
+
+ Alternatively, the object may be called (as a function) to fix
+ the shape and location parameters returning a
+ "frozen" discrete RV object:
+
+ myrv = generic(, loc=0)
+ - frozen RV object with the same methods but holding the given shape
+ and location fixed.
+
+ You can construct an aribtrary discrete rv where P{X=xk} = pk
+ by passing to the rv_discrete initialization method (through the
+ values=keyword) a tuple of sequences (xk, pk) which describes only those
+ values of X (xk) that occur with nonzero probability (pk).
+
+ To create a new discrete distribution, we would do the following::
+
+ class poisson_gen(rv_continuous):
+ #"Poisson distribution"
+ def _pmf(self, k, mu):
+ ...
+
+ and create an instance
+
+ poisson = poisson_gen(name="poisson", shapes="mu", longname='A Poisson')
+
+ The docstring can be created from a template.
+
+
Examples
--------
- To create a new Gaussian distribution, we would do the following::
- class gaussian_gen(rv_continuous):
- "Gaussian distribution"
- def _pdf:
- ...
- ...
+ >>> import matplotlib.pyplot as plt
+ >>> numargs = generic.numargs
+ >>> [ ] = ['Replace with resonable value', ]*numargs
+ Display frozen pmf:
+
+ >>> rv = generic()
+ >>> x = np.arange(0, np.min(rv.dist.b, 3)+1)
+ >>> h = plt.plot(x, rv.pmf(x))
+
+ Check accuracy of cdf and ppf:
+
+ >>> prb = generic.cdf(x, )
+ >>> h = plt.semilogy(np.abs(x-generic.ppf(prb, ))+1e-20)
+
+ Random number generation:
+
+ >>> R = generic.rvs(, size=100)
+
+ Custom made discrete distribution:
+
+ >>> vals = [arange(7), (0.1, 0.2, 0.3, 0.1, 0.1, 0.1, 0.1)]
+ >>> custm = rv_discrete(name='custm', values=vals)
+ >>> h = plt.plot(vals[0], custm.pmf(vals[0]))
+
"""
def __init__(self, a=0, b=inf, name=None, badvalue=None,
From scipy-svn at scipy.org Mon Jun 7 08:22:06 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Mon, 7 Jun 2010 07:22:06 -0500 (CDT)
Subject: [Scipy-svn] r6491 - branches/0.8.x/scipy/stats
Message-ID: <20100607122206.66A6039CAEB@scipy.org>
Author: rgommers
Date: 2010-06-07 07:22:06 -0500 (Mon, 07 Jun 2010)
New Revision: 6491
Modified:
branches/0.8.x/scipy/stats/distributions.py
Log:
DOC: merge wiki edits for stats.distributions.rv_continuous and rv_discrete.
Those docstrings are not complete yet, but it's an improvement on what's
currently in trunk.
Modified: branches/0.8.x/scipy/stats/distributions.py
===================================================================
--- branches/0.8.x/scipy/stats/distributions.py 2010-06-07 12:20:19 UTC (rev 6490)
+++ branches/0.8.x/scipy/stats/distributions.py 2010-06-07 12:22:06 UTC (rev 6491)
@@ -537,23 +537,32 @@
class rv_continuous(rv_generic):
- """A generic continuous random variable class meant for subclassing.
+ """
+ A generic continuous random variable class meant for subclassing.
`rv_continuous` is a base class to construct specific distribution classes
- and instances from for continuous random variables.
+ and instances from for continuous random variables. It cannot be used
+ directly as a distribution.
Parameters
----------
- momtype :
- a :
- b :
- xa :
- xb :
+ momtype : int, optional
+ The type of generic moment calculation to use (check this).
+ a : float, optional
+ Lower bound of the support of the distribution, default is minus
+ infinity.
+ b : float, optional
+ Upper bound of the support of the distribution, default is plus
+ infinity.
+ xa : float, optional
+ Lower bound for fixed point calculation for generic ppf.
+ xb : float, optional
+ Upper bound for fixed point calculation for generic ppf.
xtol : float, optional
- The tolerance ....
+ The tolerance for fixed point calculation for generic ppf.
badvalue : object, optional
- The value in (masked) arrays that indicates a value that should be
- ignored.
+ The value in a result arrays that indicates a value that for which
+ some argument restriction is violated, default is np.nan.
name : str, optional
The name of the instance. This string is used to construct the default
example for distributions.
@@ -563,7 +572,7 @@
for backwards compatibility, do not use for new subclasses.
shapes : str, optional
The shape of the distribution. For example ``"m, n"`` for a
- distribution that takes two integers as the first two arguments for all
+ distribution that takes two integers as the two shape arguments for all
its methods.
extradoc : str, optional
This string is used as the last part of the docstring returned when a
@@ -572,8 +581,135 @@
Methods
-------
- ...
+ rvs(, loc=0, scale=1, size=1)
+ random variates
+ pdf(x, , loc=0, scale=1)
+ probability density function
+
+ cdf(x, , loc=0, scale=1)
+ cumulative density function
+
+ sf(x, , loc=0, scale=1)
+ survival function (1-cdf --- sometimes more accurate)
+
+ ppf(q, , loc=0, scale=1)
+ percent point function (inverse of cdf --- quantiles)
+
+ isf(q, , loc=0, scale=1)
+ inverse survival function (inverse of sf)
+
+ moments(n, )
+ non-central n-th moment of the standard distribution (oc=0, scale=1)
+
+ stats(, loc=0, scale=1, moments='mv')
+ mean('m'), variance('v'), skew('s'), and/or kurtosis('k')
+
+ entropy(, loc=0, scale=1)
+ (differential) entropy of the RV.
+
+ fit(data, , loc=0, scale=1)
+ Parameter estimates for generic data
+
+ __call__(, loc=0, scale=1)
+ calling a distribution instance creates a frozen RV object with the
+ same methods but holding the given shape, location, and scale fixed.
+ see Notes section
+
+ **Parameters for Methods**
+
+ x : array-like
+ quantiles
+ q : array-like
+ lower or upper tail probability
+ : array-like
+ shape parameters
+ loc : array-like, optional
+ location parameter (default=0)
+ scale : array-like, optional
+ scale parameter (default=1)
+ size : int or tuple of ints, optional
+ shape of random variates (default computed from input arguments )
+ moments : string, optional
+ composed of letters ['mvsk'] specifying which moments to compute where
+ 'm' = mean, 'v' = variance, 's' = (Fisher's) skew and
+ 'k' = (Fisher's) kurtosis. (default='mv')
+ n : int
+ order of moment to calculate in method moments
+
+
+ **Methods that can be overwritten by subclasses**
+ ::
+
+ _rvs
+ _pdf
+ _cdf
+ _sf
+ _ppf
+ _isf
+ _stats
+ _munp
+ _entropy
+ _argcheck
+
+ There are additional (internal and private) generic methods that can
+ be useful for cross-checking and for debugging, but might work in all
+ cases when directly called.
+
+
+ Notes
+ -----
+
+ **Frozen Distribution**
+
+ Alternatively, the object may be called (as a function) to fix the shape,
+ location, and scale parameters returning a "frozen" continuous RV object:
+
+ rv = generic(, loc=0, scale=1)
+ frozen RV object with the same methods but holding the given shape,
+ location, and scale fixed
+
+ **Subclassing**
+
+ New random variables can be defined by subclassing rv_continuous class
+ and re-defining at least the
+
+ _pdf or the cdf method which will be given clean arguments (in between a
+ and b) and passing the argument check method
+
+ If postive argument checking is not correct for your RV
+ then you will also need to re-define ::
+
+ _argcheck
+
+ Correct, but potentially slow defaults exist for the remaining
+ methods but for speed and/or accuracy you can over-ride ::
+
+ _cdf, _ppf, _rvs, _isf, _sf
+
+ Rarely would you override _isf and _sf but you could.
+
+ Statistics are computed using numerical integration by default.
+ For speed you can redefine this using
+
+ _stats
+ - take shape parameters and return mu, mu2, g1, g2
+ - If you can't compute one of these, return it as None
+ - Can also be defined with a keyword argument moments=
+ where is a string composed of 'm', 'v', 's',
+ and/or 'k'. Only the components appearing in string
+ should be computed and returned in the order 'm', 'v',
+ 's', or 'k' with missing values returned as None
+
+ OR
+
+ You can override
+
+ _munp
+ takes n and shape parameters and returns
+ the nth non-central moment of the distribution.
+
+
Examples
--------
To create a new Gaussian distribution, we would do the following::
@@ -583,6 +719,7 @@
def _pdf:
...
...
+
"""
def __init__(self, momtype=1, a=None, b=None, xa=-10.0, xb=10.0,
@@ -3866,20 +4003,28 @@
# x_k, p(x_k) lists in initialization
class rv_discrete(rv_generic):
- """A generic discrete random variable class meant for subclassing.
+ """
+ A generic discrete random variable class meant for subclassing.
`rv_discrete` is a base class to construct specific distribution classes
- and instances from for discrete random variables.
+ and instances from for discrete random variables. rv_discrete can be used
+ to construct an arbitrary distribution with defined by a list of support
+ points and the corresponding probabilities.
Parameters
----------
- momtype :
- a :
- b :
- xa :
- xb :
- xtol : float, optional
- The tolerance ....
+ a : float, optional
+ Lower bound of the support of the distribution, default: 0
+ b : float, optional
+ Upper bound of the support of the distribution, default: plus infinity
+ moment_tol : float, optional
+ The tolerance for the generic calculation of moments
+ values : tuple of two array_like
+ (xk, pk) where xk are points (integers) with positive probability pk
+ with sum(pk) = 1
+ inc : integer
+ increment for the support of the distribution, default: 1
+ other values have not been tested
badvalue : object, optional
The value in (masked) arrays that indicates a value that should be
ignored.
@@ -3899,20 +4044,95 @@
subclass has no docstring of its own. Note: `extradoc` exists for
backwards compatibility, do not use for new subclasses.
+
Methods
-------
- ...
+ generic.rvs(, loc=0, size=1)
+ random variates
+
+ generic.pmf(x, , loc=0)
+ probability mass function
+
+ generic.cdf(x, , loc=0)
+ cumulative density function
+
+ generic.sf(x, , loc=0)
+ survival function (1-cdf --- sometimes more accurate)
+
+ generic.ppf(q, , loc=0)
+ percent point function (inverse of cdf --- percentiles)
+
+ generic.isf(q, , loc=0)
+ inverse survival function (inverse of sf)
+
+ generic.stats(, loc=0, moments='mv')
+ mean('m', axis=0), variance('v'), skew('s'), and/or kurtosis('k')
+
+ generic.entropy(, loc=0)
+ entropy of the RV
+
+ generic(, loc=0)
+ calling a distribution instance returns a frozen distribution
+
+ Notes
+ -----
+
+ Alternatively, the object may be called (as a function) to fix
+ the shape and location parameters returning a
+ "frozen" discrete RV object:
+
+ myrv = generic(, loc=0)
+ - frozen RV object with the same methods but holding the given shape
+ and location fixed.
+
+ You can construct an aribtrary discrete rv where P{X=xk} = pk
+ by passing to the rv_discrete initialization method (through the
+ values=keyword) a tuple of sequences (xk, pk) which describes only those
+ values of X (xk) that occur with nonzero probability (pk).
+
+ To create a new discrete distribution, we would do the following::
+
+ class poisson_gen(rv_continuous):
+ #"Poisson distribution"
+ def _pmf(self, k, mu):
+ ...
+
+ and create an instance
+
+ poisson = poisson_gen(name="poisson", shapes="mu", longname='A Poisson')
+
+ The docstring can be created from a template.
+
+
Examples
--------
- To create a new Gaussian distribution, we would do the following::
- class gaussian_gen(rv_continuous):
- "Gaussian distribution"
- def _pdf:
- ...
- ...
+ >>> import matplotlib.pyplot as plt
+ >>> numargs = generic.numargs
+ >>> [ ] = ['Replace with resonable value', ]*numargs
+ Display frozen pmf:
+
+ >>> rv = generic()
+ >>> x = np.arange(0, np.min(rv.dist.b, 3)+1)
+ >>> h = plt.plot(x, rv.pmf(x))
+
+ Check accuracy of cdf and ppf:
+
+ >>> prb = generic.cdf(x, )
+ >>> h = plt.semilogy(np.abs(x-generic.ppf(prb, ))+1e-20)
+
+ Random number generation:
+
+ >>> R = generic.rvs(, size=100)
+
+ Custom made discrete distribution:
+
+ >>> vals = [arange(7), (0.1, 0.2, 0.3, 0.1, 0.1, 0.1, 0.1)]
+ >>> custm = rv_discrete(name='custm', values=vals)
+ >>> h = plt.plot(vals[0], custm.pmf(vals[0]))
+
"""
def __init__(self, a=0, b=inf, name=None, badvalue=None,
From scipy-svn at scipy.org Mon Jun 7 13:04:45 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Mon, 7 Jun 2010 12:04:45 -0500 (CDT)
Subject: [Scipy-svn] r6492 - branches/0.8.x/doc/release
Message-ID: <20100607170445.6ED2B39CAEB@scipy.org>
Author: rgommers
Date: 2010-06-07 12:04:45 -0500 (Mon, 07 Jun 2010)
New Revision: 6492
Modified:
branches/0.8.x/doc/release/0.8.0-notes.rst
Log:
REL: change next NumPy version in release notes from 2.0 to 1.5.
Modified: branches/0.8.x/doc/release/0.8.0-notes.rst
===================================================================
--- branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-07 12:22:06 UTC (rev 6491)
+++ branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-07 17:04:45 UTC (rev 6492)
@@ -34,7 +34,7 @@
Python 3 compatibility is planned and is currently technically
feasible, since Numpy has been ported. However, since the Python 3
-compatible Numpy 2.0 has not been released yet, support for Python 3
+compatible Numpy 1.5 has not been released yet, support for Python 3
in Scipy is not yet included in Scipy 0.8. SciPy 0.9, planned for fall
2010, will very likely include experimental support for Python 3.
From scipy-svn at scipy.org Mon Jun 7 15:01:34 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Mon, 7 Jun 2010 14:01:34 -0500 (CDT)
Subject: [Scipy-svn] r6493 - branches/0.8.x/doc/release
Message-ID: <20100607190134.B2A5739CAEB@scipy.org>
Author: ptvirtan
Date: 2010-06-07 14:01:34 -0500 (Mon, 07 Jun 2010)
New Revision: 6493
Modified:
branches/0.8.x/doc/release/0.8.0-notes.rst
Log:
DOC: release: add scipy.special improvements to release notes
Modified: branches/0.8.x/doc/release/0.8.0-notes.rst
===================================================================
--- branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-07 17:04:45 UTC (rev 6492)
+++ branches/0.8.x/doc/release/0.8.0-notes.rst 2010-06-07 19:01:34 UTC (rev 6493)
@@ -178,7 +178,33 @@
of this change; for now we suggest using the ``oned_as='row'`` keyword
argument to `scipy.io.savemat` and friends.
+Faster evaluation of orthogonal polynomials
+-------------------------------------------
+Values of orthogonal polynomials can be evaluated with new vectorized functions
+in ``scipy.special``: ``eval_legendre``, ``eval_chebyt``, ``eval_chebyu``,
+``eval_chebyc``, ``eval_chebys``, ``eval_jacobi``, ``eval_laguerre``,
+``eval_genlaguerre``, ``eval_hermite``, ``eval_hermitenorm``,
+``eval_gegenbauer``, ``eval_sh_legendre``, ``eval_sh_chebyt``,
+``eval_sh_chebyu``, ``eval_sh_jacobi``. This is faster than constructing the
+full coefficient representation of the polynomials, which was previously the
+only available way.
+
+Note that the previous orthogonal polynomial routines will now also invoke this
+feature, when possible.
+
+Lambert W function
+------------------
+
+``scipy.special.lambertw`` can now be used for evaluating the Lambert W
+function.
+
+Improved hypergeometric 2F1 function
+------------------------------------
+
+Implementation of ``scipy.special.hyp2f1`` for real parameters was revised.
+The new version should produce accurate values for all real parameters.
+
Removed features
================
From scipy-svn at scipy.org Wed Jun 9 00:24:45 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 8 Jun 2010 23:24:45 -0500 (CDT)
Subject: [Scipy-svn] r6494 - trunk/scipy/stats/tests
Message-ID: <20100609042445.42B3439C4B4@scipy.org>
Author: oliphant
Date: 2010-06-08 23:24:45 -0500 (Tue, 08 Jun 2010)
New Revision: 6494
Modified:
trunk/scipy/stats/tests/test_distributions.py
Log:
Fix syntax error in test_distributions.py for Python < 2.6
Modified: trunk/scipy/stats/tests/test_distributions.py
===================================================================
--- trunk/scipy/stats/tests/test_distributions.py 2010-06-07 19:01:34 UTC (rev 6493)
+++ trunk/scipy/stats/tests/test_distributions.py 2010-06-09 04:24:45 UTC (rev 6494)
@@ -388,7 +388,7 @@
if dist in self.skip:
continue
distfunc = getattr(stats, dist)
- res = distfunc.rvs(*args, size=200)
+ res = distfunc.rvs(*args, **{'size':200})
vals = distfunc.fit(res)
if dist in ['erlang', 'frechet']:
assert(len(vals)==len(args))
@@ -402,7 +402,7 @@
if dist in self.skip + ['erlang', 'frechet', 'beta']:
continue
distfunc = getattr(stats, dist)
- res = distfunc.rvs(*args, size=200)
+ res = distfunc.rvs(*args, **{'size':200})
vals = distfunc.fit(res,floc=0)
vals2 = distfunc.fit(res,fscale=1)
assert(len(vals) == 2+len(args))
From scipy-svn at scipy.org Wed Jun 9 00:27:20 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Tue, 8 Jun 2010 23:27:20 -0500 (CDT)
Subject: [Scipy-svn] r6495 - trunk/scipy/stats
Message-ID: <20100609042720.97B8239C4B4@scipy.org>
Author: oliphant
Date: 2010-06-08 23:27:20 -0500 (Tue, 08 Jun 2010)
New Revision: 6495
Modified:
trunk/scipy/stats/distributions.py
Log:
Use correct underlying function.
Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py 2010-06-09 04:24:45 UTC (rev 6494)
+++ trunk/scipy/stats/distributions.py 2010-06-09 04:27:20 UTC (rev 6495)
@@ -4360,7 +4360,7 @@
def _logpdf(self, x):
return invnorm._logpdf(x, 1.0)
def _cdf(self, x):
- return invnorm._logcdf(x, 1.0)
+ return invnorm._cdf(x, 1.0)
def _stats(self):
return 1.0, 1.0, 3.0, 15.0
wald = wald_gen(a=0.0, name="wald", extradoc="""
From scipy-svn at scipy.org Wed Jun 9 13:46:03 2010
From: scipy-svn at scipy.org (scipy-svn at scipy.org)
Date: Wed, 9 Jun 2010 12:46:03 -0500 (CDT)
Subject: [Scipy-svn] r6496 - trunk/scipy/io/matlab
Message-ID: <20100609174603.07CF839CB4C@scipy.org>
Author: stefan
Date: 2010-06-09 12:46:02 -0500 (Wed, 09 Jun 2010)
New Revision: 6496
Modified:
trunk/scipy/io/matlab/mio_utils.c
Log:
BUG: Regenerate Cython for io/matlab/mio_utils.
Modified: trunk/scipy/io/matlab/mio_utils.c
===================================================================
--- trunk/scipy/io/matlab/mio_utils.c 2010-06-09 04:27:20 UTC (rev 6495)
+++ trunk/scipy/io/matlab/mio_utils.c 2010-06-09 17:46:02 UTC (rev 6496)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.12.1 on Thu May 27 17:30:06 2010 */
+/* Generated by Cython 0.11.3 on Wed Jun 9 11:39:04 2010 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -6,7 +6,6 @@
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#else
-
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -18,7 +17,6 @@
#define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
#define PyDict_Contains(d,o) PySequence_Contains(d,o)
#endif
-
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
@@ -28,9 +26,7 @@
#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
#define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o)
- #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif
-
#if PY_VERSION_HEX < 0x02060000
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
@@ -38,19 +34,20 @@
#define PyVarObject_HEAD_INIT(type, size) \
PyObject_HEAD_INIT(type) size,
#define PyType_Modified(t)
+ #define PyBytes_CheckExact PyString_CheckExact
typedef struct {
- void *buf;
- PyObject *obj;
- Py_ssize_t len;
- Py_ssize_t itemsize;
- int readonly;
- int ndim;
- char *format;
- Py_ssize_t *shape;
- Py_ssize_t *strides;
- Py_ssize_t *suboffsets;
- void *internal;
+ void *buf;
+ PyObject *obj;
+ Py_ssize_t len;
+ Py_ssize_t itemsize;
+ int readonly;
+ int ndim;
+ char *format;
+ Py_ssize_t *shape;
+ Py_ssize_t *strides;
+ Py_ssize_t *suboffsets;
+ void *internal;
} Py_buffer;
#define PyBUF_SIMPLE 0
@@ -64,32 +61,22 @@
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
#endif
-
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif
-
#if PY_MAJOR_VERSION >= 3
#define Py_TPFLAGS_CHECKTYPES 0
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
-
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyString_Type PyUnicode_Type
#define PyString_CheckExact PyUnicode_CheckExact
-#else
- #define PyBytes_Type PyString_Type
- #define PyBytes_CheckExact PyString_CheckExact
-#endif
-
-#if PY_MAJOR_VERSION >= 3
#define PyInt_Type PyLong_Type
#define PyInt_Check(op) PyLong_Check(op)
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
@@ -104,17 +91,13 @@
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#else
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
-
+ #define PyBytes_Type PyString_Type
#endif
-
#if PY_MAJOR_VERSION >= 3
#define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
#endif
-
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
@@ -128,7 +111,6 @@
#else
#define _USE_MATH_DEFINES
#endif
-
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
@@ -138,7 +120,6 @@
#define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
#define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
#endif
-
#if PY_VERSION_HEX < 0x02050000
#define __Pyx_NAMESTR(n) ((char *)(n))
#define __Pyx_DOCSTR(n) ((char *)(n))
@@ -158,14 +139,12 @@
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
-#ifndef CYTHON_INLINE
- #if defined(__GNUC__)
- #define CYTHON_INLINE __inline__
- #elif defined(_MSC_VER)
- #define CYTHON_INLINE __inline
- #else
- #define CYTHON_INLINE
- #endif
+#ifdef __GNUC__
+#define INLINE __inline__
+#elif _WIN32
+#define INLINE __inline
+#else
+#define INLINE
#endif
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
@@ -187,8 +166,8 @@
#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) __Pyx_PyBytes_AsString(s))
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
#if !defined(T_PYSSIZET)
#if PY_VERSION_HEX < 0x02050000
@@ -252,9 +231,9 @@
#endif
#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
+static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
@@ -302,11 +281,68 @@
#endif
#endif
-#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
- #undef _Complex_I
- #define _Complex_I 1.0fj
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< float > __pyx_t_float_complex;
+ #else
+ typedef float _Complex __pyx_t_float_complex;
+ #endif
+#else
+ typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+ #else
+ static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+ #endif
+#else
+ static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< double > __pyx_t_double_complex;
+ #else
+ typedef double _Complex __pyx_t_double_complex;
+ #endif
+#else
+ typedef struct { double real, imag; } __pyx_t_double_complex;
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+ #else
+ static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+ #endif
+#else
+ static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< long double > __pyx_t_long_double_complex;
+ #else
+ typedef long double _Complex __pyx_t_long_double_complex;
+ #endif
+#else
+ typedef struct { long double real, imag; } __pyx_t_long_double_complex;
+#endif
+
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
+ #else
+ static INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
+ #endif
+#else
+ static INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
+#endif
+
+/* Type declarations */
+
typedef npy_int8 __pyx_t_5numpy_int8_t;
typedef npy_int16 __pyx_t_5numpy_int16_t;
@@ -327,14 +363,14 @@
typedef npy_float64 __pyx_t_5numpy_float64_t;
+typedef __pyx_t_float_complex __pyx_t_5numpy_complex64_t;
+
+typedef __pyx_t_double_complex __pyx_t_5numpy_complex128_t;
+
typedef npy_long __pyx_t_5numpy_int_t;
typedef npy_longlong __pyx_t_5numpy_long_t;
-typedef npy_intp __pyx_t_5numpy_intp_t;
-
-typedef npy_uintp __pyx_t_5numpy_uintp_t;
-
typedef npy_ulong __pyx_t_5numpy_uint_t;
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
@@ -345,28 +381,6 @@
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- typedef ::std::complex< float > __pyx_t_float_complex;
- #else
- typedef float _Complex __pyx_t_float_complex;
- #endif
-#else
- typedef struct { float real, imag; } __pyx_t_float_complex;
-#endif
-
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- typedef ::std::complex< double > __pyx_t_double_complex;
- #else
- typedef double _Complex __pyx_t_double_complex;
- #endif
-#else
- typedef struct { double real, imag; } __pyx_t_double_complex;
-#endif
-
-/* Type declarations */
-
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
@@ -375,54 +389,38 @@
typedef npy_cdouble __pyx_t_5numpy_complex_t;
-#ifndef CYTHON_REFNANNY
- #define CYTHON_REFNANNY 0
-#endif
-
-#if CYTHON_REFNANNY
- typedef struct {
- void (*INCREF)(void*, PyObject*, int);
- void (*DECREF)(void*, PyObject*, int);
- void (*GOTREF)(void*, PyObject*, int);
- void (*GIVEREF)(void*, PyObject*, int);
- void* (*SetupContext)(const char*, int, const char*);
- void (*FinishContext)(void**);
- } __Pyx_RefNannyAPIStruct;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
- static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
- PyObject *m = NULL, *p = NULL;
- void *r = NULL;
- m = PyImport_ImportModule((char *)modname);
- if (!m) goto end;
- p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
- if (!p) goto end;
- r = PyLong_AsVoidPtr(p);
- end:
- Py_XDECREF(p);
- Py_XDECREF(m);
- return (__Pyx_RefNannyAPIStruct *)r;
- }
- #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
- #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
- #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
+#ifdef CYTHON_REFNANNY
+typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*NewContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+} __Pyx_RefnannyAPIStruct;
+static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
+#define __Pyx_ImportRefcountAPI(name) (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI")
+#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__)
+#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__)
+#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__)
+#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__)
+#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
+#define __Pyx_SetupRefcountContext(name) void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__)
+#define __Pyx_FinishRefcountContext() __Pyx_Refnanny->FinishContext(&__pyx_refchk)
#else
- #define __Pyx_RefNannySetupContext(name)
- #define __Pyx_RefNannyFinishContext()
- #define __Pyx_INCREF(r) Py_INCREF(r)
- #define __Pyx_DECREF(r) Py_DECREF(r)
- #define __Pyx_GOTREF(r)
- #define __Pyx_GIVEREF(r)
- #define __Pyx_XDECREF(r) Py_XDECREF(r)
+#define __Pyx_INCREF(r) Py_INCREF(r)
+#define __Pyx_DECREF(r) Py_DECREF(r)
+#define __Pyx_GOTREF(r)
+#define __Pyx_GIVEREF(r)
+#define __Pyx_XDECREF(r) Py_XDECREF(r)
+#define __Pyx_SetupRefcountContext(name)
+#define __Pyx_FinishRefcountContext()
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
@@ -435,7 +433,7 @@
__Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
+static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
if (likely(o != Py_None)) {
if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -455,7 +453,7 @@
__Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
+static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
if (likely(o != Py_None)) {
if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -476,7 +474,7 @@
__Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
+static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
PyObject *r;
if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
r = PyList_GET_ITEM(o, i);
@@ -495,16 +493,16 @@
return r;
}
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void);
+static INLINE void __Pyx_RaiseTooManyValuesError(void);
static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+static INLINE void __Pyx_RaiseNoneNotIterableError(void);
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/
@@ -515,7 +513,7 @@
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp);
+static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp);
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
@@ -530,16 +528,6 @@
#define __Pyx_CIMAG(z) ((z).imag)
#endif
-#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
- #define __Pyx_SET_CREAL(z,x) ((z).real(x))
- #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
-#else
- #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
- #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
-#endif
-
-static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
-
#if CYTHON_CCOMPLEX
#define __Pyx_c_eqf(a, b) ((a)==(b))
#define __Pyx_c_sumf(a, b) ((a)+(b))
@@ -548,7 +536,7 @@
#define __Pyx_c_quotf(a, b) ((a)/(b))
#define __Pyx_c_negf(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zerof(z) ((z)==(float)0)
+ #define __Pyx_c_is_zerof(z) ((z)==0.0)
#define __Pyx_c_conjf(z) (::std::conj(z))
/*#define __Pyx_c_absf(z) (::std::abs(z))*/
#else
@@ -557,19 +545,17 @@
/*#define __Pyx_c_absf(z) (cabsf(z))*/
#endif
#else
- static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
- static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
- /*static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);*/
+ static INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
+ static INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
+ static INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
+ static INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
+ static INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
+ /*static INLINE float __Pyx_c_absf(__pyx_t_float_complex);*/
#endif
-static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
-
#if CYTHON_CCOMPLEX
#define __Pyx_c_eq(a, b) ((a)==(b))
#define __Pyx_c_sum(a, b) ((a)+(b))
@@ -578,7 +564,7 @@
#define __Pyx_c_quot(a, b) ((a)/(b))
#define __Pyx_c_neg(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zero(z) ((z)==(double)0)
+ #define __Pyx_c_is_zero(z) ((z)==0.0)
#define __Pyx_c_conj(z) (::std::conj(z))
/*#define __Pyx_c_abs(z) (::std::abs(z))*/
#else
@@ -587,55 +573,83 @@
/*#define __Pyx_c_abs(z) (cabs(z))*/
#endif
#else
- static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
- static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
- /*static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/
+ static INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
+ static INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
+ static INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
+ static INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
+ static INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
+ static INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
+ static INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
+ static INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
+ /*static INLINE double __Pyx_c_abs(__pyx_t_double_complex);*/
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eql(a, b) ((a)==(b))
+ #define __Pyx_c_suml(a, b) ((a)+(b))
+ #define __Pyx_c_diffl(a, b) ((a)-(b))
+ #define __Pyx_c_prodl(a, b) ((a)*(b))
+ #define __Pyx_c_quotl(a, b) ((a)/(b))
+ #define __Pyx_c_negl(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zerol(z) ((z)==0.0)
+ #define __Pyx_c_conjl(z) (::std::conj(z))
+ /*#define __Pyx_c_absl(z) (::std::abs(z))*/
+ #else
+ #define __Pyx_c_is_zerol(z) ((z)==0)
+ #define __Pyx_c_conjl(z) (conjl(z))
+ /*#define __Pyx_c_absl(z) (cabsl(z))*/
+ #endif
+#else
+ static INLINE int __Pyx_c_eql(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
+ static INLINE __pyx_t_long_double_complex __Pyx_c_suml(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
+ static INLINE __pyx_t_long_double_complex __Pyx_c_diffl(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
+ static INLINE __pyx_t_long_double_complex __Pyx_c_prodl(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
+ static INLINE __pyx_t_long_double_complex __Pyx_c_quotl(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
+ static INLINE __pyx_t_long_double_complex __Pyx_c_negl(__pyx_t_long_double_complex);
+ static INLINE int __Pyx_c_is_zerol(__pyx_t_long_double_complex);
+ static INLINE __pyx_t_long_double_complex __Pyx_c_conjl(__pyx_t_long_double_complex);
+ /*static INLINE long double __Pyx_c_absl(__pyx_t_long_double_complex);*/
+#endif
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
+static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
+static INLINE char __Pyx_PyInt_AsChar(PyObject *);
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
+static INLINE short __Pyx_PyInt_AsShort(PyObject *);
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+static INLINE int __Pyx_PyInt_AsInt(PyObject *);
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
+static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+static INLINE long __Pyx_PyInt_AsLong(PyObject *);
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+
static void __Pyx_WriteUnraisable(const char *name); /*proto*/
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size); /*proto*/
static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
@@ -644,7 +658,7 @@
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from python_buffer */
-/* Module declarations from python_ref */
+/* Module declarations from python_object */
/* Module declarations from stdlib */
@@ -659,14 +673,12 @@
static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *, PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *, PyObject *, PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
-static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
-static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *, PyObject *); /*proto*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *); /*proto*/
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *); /*proto*/
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *, PyObject *); /*proto*/
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *, PyObject *, PyObject *); /*proto*/
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
+static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
/* Module declarations from scipy.io.matlab.mio_utils */
static size_t __pyx_f_5scipy_2io_6matlab_9mio_utils_cproduct(PyObject *, int __pyx_skip_dispatch); /*proto*/
@@ -681,13 +693,15 @@
static PyObject *__pyx_builtin_RuntimeError;
static char __pyx_k_1[] = "ndarray is not C contiguous";
static char __pyx_k_2[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_3[] = "Non-native byte order not supported";
-static char __pyx_k_4[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_5[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_6[] = "Format string allocated too short.";
-static char __pyx_k_7[] = " Utilities for generic processing of return arrays from read\n";
-static char __pyx_k_8[] = "squeeze_element (line 17)";
-static char __pyx_k_9[] = "chars_to_strings (line 30)";
+static char __pyx_k_3[] = ">";
+static char __pyx_k_4[] = "<";
+static char __pyx_k_5[] = "Non-native byte order not supported";
+static char __pyx_k_6[] = "unknown dtype code in numpy.pxd (%d)";
+static char __pyx_k_7[] = "Format string allocated too short, see comment in numpy.pxd";
+static char __pyx_k_8[] = "Format string allocated too short.";
+static char __pyx_k_9[] = " Utilities for generic processing of return arrays from read\n";
+static char __pyx_k_10[] = "squeeze_element (line 17)";
+static char __pyx_k_11[] = "chars_to_strings (line 30)";
static char __pyx_k__B[] = "B";
static char __pyx_k__H[] = "H";
static char __pyx_k__I[] = "I";
@@ -709,7 +723,6 @@
static char __pyx_k__buf[] = "buf";
static char __pyx_k__obj[] = "obj";
static char __pyx_k__str[] = "str";
-static char __pyx_k__base[] = "base";
static char __pyx_k__item[] = "item";
static char __pyx_k__ndim[] = "ndim";
static char __pyx_k__size[] = "size";
@@ -740,20 +753,21 @@
static char __pyx_k__chars_to_strings[] = "chars_to_strings";
static char __pyx_k__ascontiguousarray[] = "ascontiguousarray";
static PyObject *__pyx_kp_u_1;
+static PyObject *__pyx_kp_u_10;
+static PyObject *__pyx_kp_u_11;
static PyObject *__pyx_kp_u_2;
-static PyObject *__pyx_kp_u_3;
-static PyObject *__pyx_kp_u_4;
+static PyObject *__pyx_kp_s_3;
+static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_u_5;
static PyObject *__pyx_kp_u_6;
+static PyObject *__pyx_kp_u_7;
static PyObject *__pyx_kp_u_8;
-static PyObject *__pyx_kp_u_9;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__array;
static PyObject *__pyx_n_s__ascontiguousarray;
-static PyObject *__pyx_n_s__base;
static PyObject *__pyx_n_s__buf;
static PyObject *__pyx_n_s__byteorder;
static PyObject *__pyx_n_s__chars_to_strings;
@@ -783,7 +797,7 @@
static PyObject *__pyx_n_s__view;
static PyObject *__pyx_int_15;
-/* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":9
+/* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":9
*
*
* cpdef size_t cproduct(tup): # <<<<<<<<<<<<<<
@@ -800,10 +814,10 @@
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
size_t __pyx_t_4;
- __Pyx_RefNannySetupContext("cproduct");
+ __Pyx_SetupRefcountContext("cproduct");
__Pyx_INCREF(__pyx_v_tup);
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":10
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":10
*
* cpdef size_t cproduct(tup):
* cdef size_t res = 1 # <<<<<<<<<<<<<<
@@ -812,7 +826,7 @@
*/
__pyx_v_res = 1;
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":12
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":12
* cdef size_t res = 1
* cdef int i
* for i in range(len(tup)): # <<<<<<<<<<<<<<
@@ -823,7 +837,7 @@
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":13
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":13
* cdef int i
* for i in range(len(tup)):
* res *= tup[i] # <<<<<<<<<<<<<<
@@ -837,7 +851,7 @@
__pyx_v_res *= __pyx_t_4;
}
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":14
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":14
* for i in range(len(tup)):
* res *= tup[i]
* return res # <<<<<<<<<<<<<<
@@ -855,11 +869,11 @@
__pyx_r = 0;
__pyx_L0:;
__Pyx_DECREF(__pyx_v_tup);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":9
+/* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":9
*
*
* cpdef size_t cproduct(tup): # <<<<<<<<<<<<<<
@@ -871,7 +885,7 @@
static PyObject *__pyx_pf_5scipy_2io_6matlab_9mio_utils_cproduct(PyObject *__pyx_self, PyObject *__pyx_v_tup) {
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("cproduct");
+ __Pyx_SetupRefcountContext("cproduct");
__pyx_self = __pyx_self;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_5scipy_2io_6matlab_9mio_utils_cproduct(__pyx_v_tup, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -888,11 +902,11 @@
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":17
+/* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":17
*
*
* cpdef object squeeze_element(cnp.ndarray arr): # <<<<<<<<<<<<<<
@@ -909,10 +923,10 @@
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
- __Pyx_RefNannySetupContext("squeeze_element");
+ __Pyx_SetupRefcountContext("squeeze_element");
__Pyx_INCREF((PyObject *)__pyx_v_arr);
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":22
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":22
* The returned object may not be an ndarray - for example if we do
* ``arr.item`` to return a ``mat_struct`` object from a struct array '''
* if not arr.size: # <<<<<<<<<<<<<<
@@ -926,7 +940,7 @@
__pyx_t_3 = (!__pyx_t_2);
if (__pyx_t_3) {
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":23
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":23
* ``arr.item`` to return a ``mat_struct`` object from a struct array '''
* if not arr.size:
* return np.array([]) # <<<<<<<<<<<<<<
@@ -957,7 +971,7 @@
}
__pyx_L3:;
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":24
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":24
* if not arr.size:
* return np.array([])
* arr = np.squeeze(arr) # <<<<<<<<<<<<<<
@@ -978,12 +992,12 @@
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_v_arr));
__pyx_v_arr = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":25
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":25
* return np.array([])
* arr = np.squeeze(arr)
* if not arr.shape and arr.dtype.isbuiltin: # 0d coverted to scalar # <<<<<<<<<<<<<<
@@ -1005,7 +1019,7 @@
}
if (__pyx_t_6) {
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":26
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":26
* arr = np.squeeze(arr)
* if not arr.shape and arr.dtype.isbuiltin: # 0d coverted to scalar
* return arr.item() # <<<<<<<<<<<<<<
@@ -1025,7 +1039,7 @@
}
__pyx_L4:;
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":27
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":27
* if not arr.shape and arr.dtype.isbuiltin: # 0d coverted to scalar
* return arr.item()
* return arr # <<<<<<<<<<<<<<
@@ -1048,11 +1062,11 @@
__pyx_L0:;
__Pyx_DECREF((PyObject *)__pyx_v_arr);
__Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":17
+/* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":17
*
*
* cpdef object squeeze_element(cnp.ndarray arr): # <<<<<<<<<<<<<<
@@ -1065,7 +1079,7 @@
static PyObject *__pyx_pf_5scipy_2io_6matlab_9mio_utils_squeeze_element(PyObject *__pyx_self, PyObject *__pyx_v_arr) {
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("squeeze_element");
+ __Pyx_SetupRefcountContext("squeeze_element");
__pyx_self = __pyx_self;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arr), __pyx_ptype_5numpy_ndarray, 1, "arr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XDECREF(__pyx_r);
@@ -1083,11 +1097,11 @@
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":30
+/* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":30
*
*
* cpdef cnp.ndarray chars_to_strings(in_arr): # <<<<<<<<<<<<<<
@@ -1107,22 +1121,22 @@
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- __Pyx_RefNannySetupContext("chars_to_strings");
+ __Pyx_SetupRefcountContext("chars_to_strings");
__Pyx_INCREF(__pyx_v_in_arr);
__pyx_v_new_dt_str = Py_None; __Pyx_INCREF(Py_None);
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":44
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":44
* ``arr``
* '''
* cdef cnp.ndarray arr = in_arr # <<<<<<<<<<<<<<
* cdef int ndim = arr.ndim
* cdef cnp.npy_intp *dims = arr.shape
*/
- if (!(likely(((__pyx_v_in_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_in_arr, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(__Pyx_TypeTest(__pyx_v_in_arr, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_INCREF(__pyx_v_in_arr);
__pyx_v_arr = ((PyArrayObject *)__pyx_v_in_arr);
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":45
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":45
* '''
* cdef cnp.ndarray arr = in_arr
* cdef int ndim = arr.ndim # <<<<<<<<<<<<<<
@@ -1131,7 +1145,7 @@
*/
__pyx_v_ndim = __pyx_v_arr->nd;
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":46
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":46
* cdef cnp.ndarray arr = in_arr
* cdef int ndim = arr.ndim
* cdef cnp.npy_intp *dims = arr.shape # <<<<<<<<<<<<<<
@@ -1140,7 +1154,7 @@
*/
__pyx_v_dims = __pyx_v_arr->dimensions;
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":47
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":47
* cdef int ndim = arr.ndim
* cdef cnp.npy_intp *dims = arr.shape
* cdef cnp.npy_intp last_dim = dims[ndim-1] # <<<<<<<<<<<<<<
@@ -1149,7 +1163,7 @@
*/
__pyx_v_last_dim = (__pyx_v_dims[(__pyx_v_ndim - 1)]);
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":49
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":49
* cdef cnp.npy_intp last_dim = dims[ndim-1]
* cdef object new_dt_str
* if last_dim == 0: # deal with empty array case # <<<<<<<<<<<<<<
@@ -1159,7 +1173,7 @@
__pyx_t_1 = (__pyx_v_last_dim == 0);
if (__pyx_t_1) {
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":50
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":50
* cdef object new_dt_str
* if last_dim == 0: # deal with empty array case
* new_dt_str = arr.dtype.str # <<<<<<<<<<<<<<
@@ -1178,7 +1192,7 @@
}
/*else*/ {
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":52
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":52
* new_dt_str = arr.dtype.str
* else: # make new dtype string with N appended
* new_dt_str = arr.dtype.str[:-1] + str(last_dim) # <<<<<<<<<<<<<<
@@ -1213,7 +1227,7 @@
}
__pyx_L3:;
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":54
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":54
* new_dt_str = arr.dtype.str[:-1] + str(last_dim)
* # Copy to deal with F ordered arrays
* arr = np.ascontiguousarray(arr) # <<<<<<<<<<<<<<
@@ -1234,12 +1248,12 @@
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_v_arr));
__pyx_v_arr = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":55
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":55
* # Copy to deal with F ordered arrays
* arr = np.ascontiguousarray(arr)
* arr = arr.view(new_dt_str) # <<<<<<<<<<<<<<
@@ -1256,12 +1270,12 @@
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_v_arr));
__pyx_v_arr = ((PyArrayObject *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":56
+ /* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":56
* arr = np.ascontiguousarray(arr)
* arr = arr.view(new_dt_str)
* return arr.reshape(in_arr.shape[:-1]) # <<<<<<<<<<<<<<
@@ -1283,7 +1297,7 @@
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = ((PyArrayObject *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
@@ -1301,11 +1315,11 @@
__Pyx_DECREF(__pyx_v_new_dt_str);
__Pyx_DECREF(__pyx_v_in_arr);
__Pyx_XGIVEREF((PyObject *)__pyx_r);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\home\matthew\dev_trees\scipy-work\scipy\io\matlab\mio_utils.pyx":30
+/* "/Users/stefan/src/scipy/scipy/io/matlab/mio_utils.pyx":30
*
*
* cpdef cnp.ndarray chars_to_strings(in_arr): # <<<<<<<<<<<<<<
@@ -1318,7 +1332,7 @@
static PyObject *__pyx_pf_5scipy_2io_6matlab_9mio_utils_chars_to_strings(PyObject *__pyx_self, PyObject *__pyx_v_in_arr) {
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("chars_to_strings");
+ __Pyx_SetupRefcountContext("chars_to_strings");
__pyx_self = __pyx_self;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((PyObject *)__pyx_f_5scipy_2io_6matlab_9mio_utils_chars_to_strings(__pyx_v_in_arr, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -1335,11 +1349,11 @@
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":187
+/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":158
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -1361,21 +1375,21 @@
int __pyx_v_hasfields;
int __pyx_r;
int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_t_5;
int __pyx_t_6;
int __pyx_t_7;
int __pyx_t_8;
char *__pyx_t_9;
- __Pyx_RefNannySetupContext("__getbuffer__");
+ __Pyx_SetupRefcountContext("__getbuffer__");
if (__pyx_v_info == NULL) return 0;
__pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
__Pyx_GIVEREF(__pyx_v_info->obj);
__Pyx_INCREF((PyObject *)__pyx_v_self);
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":193
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":164
* # of flags
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
@@ -1384,7 +1398,7 @@
*/
__pyx_v_endian_detector = 1;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":194
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":165
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1
* cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
@@ -1393,7 +1407,7 @@
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":196
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":167
* cdef bint little_endian = ((&endian_detector)[0] != 0)
*
* ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
@@ -1402,7 +1416,7 @@
*/
__pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self));
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":198
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":169
* ndim = PyArray_NDIM(self)
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -1412,7 +1426,7 @@
__pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
if (__pyx_t_1) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":199
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":170
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* copy_shape = 1 # <<<<<<<<<<<<<<
@@ -1424,7 +1438,7 @@
}
/*else*/ {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":201
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":172
* copy_shape = 1
* else:
* copy_shape = 0 # <<<<<<<<<<<<<<
@@ -1435,63 +1449,60 @@
}
__pyx_L5:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":203
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":174
* copy_shape = 0
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
* raise ValueError(u"ndarray is not C contiguous")
*/
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
- if (__pyx_t_1) {
+ if (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS)) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":204
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":175
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
* raise ValueError(u"ndarray is not C contiguous")
*
*/
- __pyx_t_2 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
- __pyx_t_3 = __pyx_t_2;
+ __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
} else {
- __pyx_t_3 = __pyx_t_1;
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
}
- if (__pyx_t_3) {
+ if (__pyx_t_1) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":205
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":176
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
* raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_kp_u_1));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_1));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_u_1));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_u_1));
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_Raise(__pyx_t_5, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":207
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":178
* raise ValueError(u"ndarray is not C contiguous")
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
* raise ValueError(u"ndarray is not Fortran contiguous")
*/
- __pyx_t_3 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
- if (__pyx_t_3) {
+ if (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS)) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":208
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":179
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -1499,35 +1510,34 @@
*
*/
__pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS));
- __pyx_t_2 = __pyx_t_1;
} else {
- __pyx_t_2 = __pyx_t_3;
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
}
- if (__pyx_t_2) {
+ if (__pyx_t_1) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":209
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":180
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
* raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
*
* info.buf = PyArray_DATA(self)
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_kp_u_2));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_2));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_2));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_u_2));
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_Raise(__pyx_t_4, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L7;
}
__pyx_L7:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":211
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":182
* raise ValueError(u"ndarray is not Fortran contiguous")
*
* info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
@@ -1536,7 +1546,7 @@
*/
__pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self));
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":212
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":183
*
* info.buf = PyArray_DATA(self)
* info.ndim = ndim # <<<<<<<<<<<<<<
@@ -1545,17 +1555,17 @@
*/
__pyx_v_info->ndim = __pyx_v_ndim;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":213
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":184
* info.buf = PyArray_DATA(self)
* info.ndim = ndim
* if copy_shape: # <<<<<<<<<<<<<<
* # Allocate new buffer for strides and shape info. This is allocated
* # as one block, strides first.
*/
- __pyx_t_6 = __pyx_v_copy_shape;
- if (__pyx_t_6) {
+ __pyx_t_4 = __pyx_v_copy_shape;
+ if (__pyx_t_4) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":216
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":187
* # Allocate new buffer for strides and shape info. This is allocated
* # as one block, strides first.
* info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<<
@@ -1564,7 +1574,7 @@
*/
__pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2)));
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":217
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":188
* # as one block, strides first.
* info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
* info.shape = info.strides + ndim # <<<<<<<<<<<<<<
@@ -1573,18 +1583,18 @@
*/
__pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":218
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":189
* info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
* info.shape = info.strides + ndim
* for i in range(ndim): # <<<<<<<<<<<<<<
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i]
*/
- __pyx_t_6 = __pyx_v_ndim;
- for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
- __pyx_v_i = __pyx_t_7;
+ __pyx_t_4 = __pyx_v_ndim;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":219
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":190
* info.shape = info.strides + ndim
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
@@ -1593,7 +1603,7 @@
*/
(__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":220
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":191
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
@@ -1606,7 +1616,7 @@
}
/*else*/ {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":222
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":193
* info.shape[i] = PyArray_DIMS(self)[i]
* else:
* info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<<
@@ -1615,7 +1625,7 @@
*/
__pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":223
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":194
* else:
* info.strides = PyArray_STRIDES(self)
* info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<<
@@ -1626,7 +1636,7 @@
}
__pyx_L8:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":224
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":195
* info.strides = PyArray_STRIDES(self)
* info.shape = PyArray_DIMS(self)
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -1635,7 +1645,7 @@
*/
__pyx_v_info->suboffsets = NULL;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":225
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":196
* info.shape = PyArray_DIMS(self)
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
@@ -1644,7 +1654,7 @@
*/
__pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self));
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":226
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":197
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
@@ -1653,7 +1663,7 @@
*/
__pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self)));
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":229
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":200
*
* cdef int t
* cdef char* f = NULL # <<<<<<<<<<<<<<
@@ -1662,7 +1672,7 @@
*/
__pyx_v_f = NULL;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":230
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":201
* cdef int t
* cdef char* f = NULL
* cdef dtype descr = self.descr # <<<<<<<<<<<<<<
@@ -1672,7 +1682,7 @@
__Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr));
__pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":234
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":205
* cdef int offset
*
* cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
@@ -1681,23 +1691,21 @@
*/
__pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":236
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":207
* cdef bint hasfields = PyDataType_HASFIELDS(descr)
*
* if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
* # do not call releasebuffer
* info.obj = None
*/
- __pyx_t_2 = (!__pyx_v_hasfields);
- if (__pyx_t_2) {
- __pyx_t_3 = (!__pyx_v_copy_shape);
- __pyx_t_1 = __pyx_t_3;
+ if ((!__pyx_v_hasfields)) {
+ __pyx_t_1 = (!__pyx_v_copy_shape);
} else {
- __pyx_t_1 = __pyx_t_2;
+ __pyx_t_1 = (!__pyx_v_hasfields);
}
if (__pyx_t_1) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":238
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":209
* if not hasfields and not copy_shape:
* # do not call releasebuffer
* info.obj = None # <<<<<<<<<<<<<<
@@ -1713,7 +1721,7 @@
}
/*else*/ {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":241
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":212
* else:
* # need to call releasebuffer
* info.obj = self # <<<<<<<<<<<<<<
@@ -1728,7 +1736,7 @@
}
__pyx_L11:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":243
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":214
* info.obj = self
*
* if not hasfields: # <<<<<<<<<<<<<<
@@ -1738,7 +1746,7 @@
__pyx_t_1 = (!__pyx_v_hasfields);
if (__pyx_t_1) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":244
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":215
*
* if not hasfields:
* t = descr.type_num # <<<<<<<<<<<<<<
@@ -1747,64 +1755,77 @@
*/
__pyx_v_t = __pyx_v_descr->type_num;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":245
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":216
* if not hasfields:
* t = descr.type_num
* if ((descr.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<<
* (descr.byteorder == '<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
*/
- __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_descr->byteorder); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_s_3), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
- __pyx_t_2 = __pyx_v_little_endian;
+ __pyx_t_6 = __pyx_v_little_endian;
+ __pyx_t_7 = __pyx_t_6;
} else {
- __pyx_t_2 = __pyx_t_1;
+ __pyx_t_7 = __pyx_t_1;
}
- if (!__pyx_t_2) {
+ if (!__pyx_t_7) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":246
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":217
* t = descr.type_num
* if ((descr.byteorder == '>' and little_endian) or
* (descr.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<<
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
*/
- __pyx_t_1 = (__pyx_v_descr->byteorder == '<');
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_descr->byteorder); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_s_4), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_1) {
- __pyx_t_3 = (!__pyx_v_little_endian);
- __pyx_t_8 = __pyx_t_3;
+ __pyx_t_6 = (!__pyx_v_little_endian);
+ __pyx_t_8 = __pyx_t_6;
} else {
__pyx_t_8 = __pyx_t_1;
}
__pyx_t_1 = __pyx_t_8;
} else {
- __pyx_t_1 = __pyx_t_2;
+ __pyx_t_1 = __pyx_t_7;
}
if (__pyx_t_1) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":247
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":218
* if ((descr.byteorder == '>' and little_endian) or
* (descr.byteorder == '<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_kp_u_3));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_u_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_3));
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_Raise(__pyx_t_5, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_u_5));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_u_5));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_5));
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L13;
}
__pyx_L13:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":248
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":219
* (descr.byteorder == '<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
@@ -1817,7 +1838,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":249
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":220
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
@@ -1830,7 +1851,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":250
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":221
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
@@ -1843,7 +1864,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":251
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":222
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
@@ -1856,7 +1877,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":252
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":223
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
@@ -1869,7 +1890,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":253
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":224
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
@@ -1882,7 +1903,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":254
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":225
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
@@ -1895,7 +1916,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":255
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":226
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
@@ -1908,7 +1929,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":256
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":227
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
@@ -1921,7 +1942,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":257
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":228
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
@@ -1934,7 +1955,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":258
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":229
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
@@ -1947,7 +1968,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":259
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":230
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
@@ -1960,7 +1981,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":260
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":231
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
@@ -1973,7 +1994,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":261
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":232
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
@@ -1986,7 +2007,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":262
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":233
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
@@ -1999,7 +2020,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":263
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":234
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
@@ -2012,7 +2033,7 @@
goto __pyx_L14;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":264
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":235
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg"
* elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
@@ -2026,33 +2047,33 @@
}
/*else*/ {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":266
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":237
* elif t == NPY_OBJECT: f = "O"
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
* info.format = f
* return
*/
- __pyx_t_5 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_Raise(__pyx_t_4, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_6), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L14:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":267
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":238
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f # <<<<<<<<<<<<<<
@@ -2061,7 +2082,7 @@
*/
__pyx_v_info->format = __pyx_v_f;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":268
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":239
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f
* return # <<<<<<<<<<<<<<
@@ -2074,7 +2095,7 @@
}
/*else*/ {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":270
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":241
* return
* else:
* info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
@@ -2083,7 +2104,7 @@
*/
__pyx_v_info->format = ((char *)malloc(255));
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":271
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":242
* else:
* info.format = stdlib.malloc(_buffer_format_string_len)
* info.format[0] = '^' # Native data types, manual alignment # <<<<<<<<<<<<<<
@@ -2092,7 +2113,7 @@
*/
(__pyx_v_info->format[0]) = '^';
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":272
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":243
* info.format = stdlib.malloc(_buffer_format_string_len)
* info.format[0] = '^' # Native data types, manual alignment
* offset = 0 # <<<<<<<<<<<<<<
@@ -2101,17 +2122,17 @@
*/
__pyx_v_offset = 0;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":275
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":246
* f = _util_dtypestring(descr, info.format + 1,
* info.format + _buffer_format_string_len,
* &offset) # <<<<<<<<<<<<<<
* f[0] = 0 # Terminate format string
*
*/
- __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f = __pyx_t_9;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":276
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":247
* info.format + _buffer_format_string_len,
* &offset)
* f[0] = 0 # Terminate format string # <<<<<<<<<<<<<<
@@ -2125,8 +2146,8 @@
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("numpy.ndarray.__getbuffer__");
__pyx_r = -1;
__Pyx_GOTREF(__pyx_v_info->obj);
@@ -2140,11 +2161,11 @@
__pyx_L2:;
__Pyx_XDECREF((PyObject *)__pyx_v_descr);
__Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":278
+/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":249
* f[0] = 0 # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -2155,10 +2176,10 @@
static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
int __pyx_t_1;
- __Pyx_RefNannySetupContext("__releasebuffer__");
+ __Pyx_SetupRefcountContext("__releasebuffer__");
__Pyx_INCREF((PyObject *)__pyx_v_self);
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":279
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":250
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
@@ -2168,7 +2189,7 @@
__pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self));
if (__pyx_t_1) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":280
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":251
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format) # <<<<<<<<<<<<<<
@@ -2180,7 +2201,7 @@
}
__pyx_L5:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":281
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":252
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -2190,7 +2211,7 @@
__pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
if (__pyx_t_1) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":282
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":253
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* stdlib.free(info.strides) # <<<<<<<<<<<<<<
@@ -2203,10 +2224,10 @@
__pyx_L6:;
__Pyx_DECREF((PyObject *)__pyx_v_self);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
}
-/* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":755
+/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":704
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -2214,12 +2235,12 @@
*
*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew1");
+ __Pyx_SetupRefcountContext("PyArray_MultiIterNew1");
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":756
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":705
*
* cdef inline object PyArray_MultiIterNew1(a):
* return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<<
@@ -2227,7 +2248,7 @@
* cdef inline object PyArray_MultiIterNew2(a, b):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -2241,11 +2262,11 @@
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":758
+/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":707
* return PyArray_MultiIterNew(1, a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -2253,12 +2274,12 @@
*
*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew2");
+ __Pyx_SetupRefcountContext("PyArray_MultiIterNew2");
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":759
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":708
*
* cdef inline object PyArray_MultiIterNew2(a, b):
* return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<<
@@ -2266,7 +2287,7 @@
* cdef inline object PyArray_MultiIterNew3(a, b, c):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -2280,11 +2301,11 @@
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":761
+/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":710
* return PyArray_MultiIterNew(2, a, b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -2292,12 +2313,12 @@
*
*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew3");
+ __Pyx_SetupRefcountContext("PyArray_MultiIterNew3");
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":762
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":711
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
* return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<<
@@ -2305,7 +2326,7 @@
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -2319,11 +2340,11 @@
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":764
+/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":713
* return PyArray_MultiIterNew(3, a, b, c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -2331,12 +2352,12 @@
*
*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew4");
+ __Pyx_SetupRefcountContext("PyArray_MultiIterNew4");
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":765
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":714
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
* return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<<
@@ -2344,7 +2365,7 @@
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -2358,11 +2379,11 @@
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":767
+/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":716
* return PyArray_MultiIterNew(4, a, b, c, d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -2370,12 +2391,12 @@
*
*/
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
+static INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew5");
+ __Pyx_SetupRefcountContext("PyArray_MultiIterNew5");
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":768
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":717
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
* return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<<
@@ -2383,7 +2404,7 @@
* cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -2397,11 +2418,11 @@
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":770
+/* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":719
* return PyArray_MultiIterNew(5, a, b, c, d, e)
*
* cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
@@ -2409,7 +2430,7 @@
* # string. The new location in the format string is returned.
*/
-static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
+static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
PyArray_Descr *__pyx_v_child;
int __pyx_v_endian_detector;
int __pyx_v_little_endian;
@@ -2428,7 +2449,7 @@
int __pyx_t_8;
int __pyx_t_9;
char *__pyx_t_10;
- __Pyx_RefNannySetupContext("_util_dtypestring");
+ __Pyx_SetupRefcountContext("_util_dtypestring");
__Pyx_INCREF((PyObject *)__pyx_v_descr);
__pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None);
__pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
@@ -2436,7 +2457,7 @@
__pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None);
__pyx_v_t = Py_None; __Pyx_INCREF(Py_None);
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":777
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":726
* cdef int delta_offset
* cdef tuple i
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
@@ -2445,7 +2466,7 @@
*/
__pyx_v_endian_detector = 1;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":778
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":727
* cdef tuple i
* cdef int endian_detector = 1
* cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
@@ -2454,7 +2475,7 @@
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":781
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":730
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -2464,7 +2485,7 @@
if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) {
__pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2);
} else {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
for (;;) {
if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
@@ -2473,21 +2494,21 @@
__pyx_v_childname = __pyx_t_3;
__pyx_t_3 = 0;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":782
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":731
*
* for childname in descr.names:
* fields = descr.fields[childname] # <<<<<<<<<<<<<<
* child, new_offset = fields
*
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(PyTuple_CheckExact(__pyx_t_3)) || (__pyx_t_3) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_v_fields));
__pyx_v_fields = ((PyObject *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":783
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":732
* for childname in descr.names:
* fields = descr.fields[childname]
* child, new_offset = fields # <<<<<<<<<<<<<<
@@ -2497,7 +2518,7 @@
if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) {
PyObject* tuple = ((PyObject *)__pyx_v_fields);
__pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3);
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_v_child));
__pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
@@ -2507,114 +2528,127 @@
__pyx_t_4 = 0;
} else {
__Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":785
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":734
* child, new_offset = fields
*
* if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
*
*/
- __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":786
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":735
*
* if (end - f) - (new_offset - offset[0]) < 15:
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
*
* if ((child.byteorder == '>' and little_endian) or
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_kp_u_5));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_5));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_5));
- __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(((PyObject *)__pyx_kp_u_7));
+ PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_u_7));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_7));
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":788
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":737
* raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
*
* if ((child.byteorder == '>' and little_endian) or # <<<<<<<<<<<<<<
* (child.byteorder == '<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported")
*/
- __pyx_t_6 = (__pyx_v_child->byteorder == '>');
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_child->byteorder); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_s_3), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
__pyx_t_7 = __pyx_v_little_endian;
+ __pyx_t_8 = __pyx_t_7;
} else {
- __pyx_t_7 = __pyx_t_6;
+ __pyx_t_8 = __pyx_t_6;
}
- if (!__pyx_t_7) {
+ if (!__pyx_t_8) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":789
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":738
*
* if ((child.byteorder == '>' and little_endian) or
* (child.byteorder == '<' and not little_endian)): # <<<<<<<<<<<<<<
* raise ValueError(u"Non-native byte order not supported")
* # One could encode it in the format string and have Cython
*/
- __pyx_t_6 = (__pyx_v_child->byteorder == '<');
+ __pyx_t_5 = PyInt_FromLong(__pyx_v_child->byteorder); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, ((PyObject *)__pyx_kp_s_4), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- __pyx_t_8 = (!__pyx_v_little_endian);
- __pyx_t_9 = __pyx_t_8;
+ __pyx_t_7 = (!__pyx_v_little_endian);
+ __pyx_t_9 = __pyx_t_7;
} else {
__pyx_t_9 = __pyx_t_6;
}
__pyx_t_6 = __pyx_t_9;
} else {
- __pyx_t_6 = __pyx_t_7;
+ __pyx_t_6 = __pyx_t_8;
}
if (__pyx_t_6) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":790
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":739
* if ((child.byteorder == '>' and little_endian) or
* (child.byteorder == '<' and not little_endian)):
* raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
* # One could encode it in the format string and have Cython
* # complain instead, BUT: < and > in format strings also imply
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(((PyObject *)__pyx_kp_u_3));
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_3));
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(((PyObject *)__pyx_kp_u_5));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_5));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_5));
+ __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":800
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":749
*
* # Output padding bytes
* while offset[0] < new_offset: # <<<<<<<<<<<<<<
@@ -2622,16 +2656,16 @@
* f += 1
*/
while (1) {
- __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!__pyx_t_6) break;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":801
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":750
* # Output padding bytes
* while offset[0] < new_offset:
* f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
@@ -2640,7 +2674,7 @@
*/
(__pyx_v_f[0]) = 120;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":802
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":751
* while offset[0] < new_offset:
* f[0] = 120 # "x"; pad byte
* f += 1 # <<<<<<<<<<<<<<
@@ -2649,7 +2683,7 @@
*/
__pyx_v_f += 1;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":803
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":752
* f[0] = 120 # "x"; pad byte
* f += 1
* offset[0] += 1 # <<<<<<<<<<<<<<
@@ -2659,7 +2693,7 @@
(__pyx_v_offset[0]) += 1;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":805
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":754
* offset[0] += 1
*
* offset[0] += child.itemsize # <<<<<<<<<<<<<<
@@ -2668,7 +2702,7 @@
*/
(__pyx_v_offset[0]) += __pyx_v_child->elsize;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":807
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":756
* offset[0] += child.itemsize
*
* if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
@@ -2678,20 +2712,20 @@
__pyx_t_6 = (!PyDataType_HASFIELDS(__pyx_v_child));
if (__pyx_t_6) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":808
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":757
*
* if not PyDataType_HASFIELDS(child):
* t = child.type_num # <<<<<<<<<<<<<<
* if end - f < 5:
* raise RuntimeError(u"Format string allocated too short.")
*/
- __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_v_t);
__pyx_v_t = __pyx_t_3;
__pyx_t_3 = 0;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":809
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":758
* if not PyDataType_HASFIELDS(child):
* t = child.type_num
* if end - f < 5: # <<<<<<<<<<<<<<
@@ -2701,288 +2735,288 @@
__pyx_t_6 = ((__pyx_v_end - __pyx_v_f) < 5);
if (__pyx_t_6) {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":810
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":759
* t = child.type_num
* if end - f < 5:
* raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
*
* # Until ticket #99 is fixed, use integers to avoid warnings
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(((PyObject *)__pyx_kp_u_6));
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_6));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_6));
- __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(((PyObject *)__pyx_kp_u_8));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_8));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_8));
+ __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L10;
}
__pyx_L10:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":813
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":762
*
* # Until ticket #99 is fixed, use integers to avoid warnings
* if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
* elif t == NPY_UBYTE: f[0] = 66 #"B"
* elif t == NPY_SHORT: f[0] = 104 #"h"
*/
- __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 98;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":814
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":763
* # Until ticket #99 is fixed, use integers to avoid warnings
* if t == NPY_BYTE: f[0] = 98 #"b"
* elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
* elif t == NPY_SHORT: f[0] = 104 #"h"
* elif t == NPY_USHORT: f[0] = 72 #"H"
*/
- __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 66;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":815
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":764
* if t == NPY_BYTE: f[0] = 98 #"b"
* elif t == NPY_UBYTE: f[0] = 66 #"B"
* elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
* elif t == NPY_USHORT: f[0] = 72 #"H"
* elif t == NPY_INT: f[0] = 105 #"i"
*/
- __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 104;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":816
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":765
* elif t == NPY_UBYTE: f[0] = 66 #"B"
* elif t == NPY_SHORT: f[0] = 104 #"h"
* elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
* elif t == NPY_INT: f[0] = 105 #"i"
* elif t == NPY_UINT: f[0] = 73 #"I"
*/
- __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 72;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":817
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":766
* elif t == NPY_SHORT: f[0] = 104 #"h"
* elif t == NPY_USHORT: f[0] = 72 #"H"
* elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
* elif t == NPY_UINT: f[0] = 73 #"I"
* elif t == NPY_LONG: f[0] = 108 #"l"
*/
- __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 105;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":818
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":767
* elif t == NPY_USHORT: f[0] = 72 #"H"
* elif t == NPY_INT: f[0] = 105 #"i"
* elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
* elif t == NPY_LONG: f[0] = 108 #"l"
* elif t == NPY_ULONG: f[0] = 76 #"L"
*/
- __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 73;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":819
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":768
* elif t == NPY_INT: f[0] = 105 #"i"
* elif t == NPY_UINT: f[0] = 73 #"I"
* elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
* elif t == NPY_ULONG: f[0] = 76 #"L"
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
*/
- __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 108;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":820
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":769
* elif t == NPY_UINT: f[0] = 73 #"I"
* elif t == NPY_LONG: f[0] = 108 #"l"
* elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
*/
- __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 76;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":821
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":770
* elif t == NPY_LONG: f[0] = 108 #"l"
* elif t == NPY_ULONG: f[0] = 76 #"L"
* elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
* elif t == NPY_FLOAT: f[0] = 102 #"f"
*/
- __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 113;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":822
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":771
* elif t == NPY_ULONG: f[0] = 76 #"L"
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
* elif t == NPY_FLOAT: f[0] = 102 #"f"
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
*/
- __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 81;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":823
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":772
* elif t == NPY_LONGLONG: f[0] = 113 #"q"
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
* elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
*/
- __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 102;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":824
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":773
* elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
* elif t == NPY_FLOAT: f[0] = 102 #"f"
* elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
*/
- __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 100;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":825
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":774
* elif t == NPY_FLOAT: f[0] = 102 #"f"
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
*/
- __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 103;
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":826
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":775
* elif t == NPY_DOUBLE: f[0] = 100 #"d"
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
*/
- __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 90;
@@ -2991,19 +3025,19 @@
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":827
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":776
* elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
* elif t == NPY_OBJECT: f[0] = 79 #"O"
*/
- __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 90;
@@ -3012,19 +3046,19 @@
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":828
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":777
* elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
* elif t == NPY_OBJECT: f[0] = 79 #"O"
* else:
*/
- __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 90;
@@ -3033,19 +3067,19 @@
goto __pyx_L11;
}
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":829
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":778
* elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
* elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
* elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
*/
- __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
(__pyx_v_f[0]) = 79;
@@ -3053,30 +3087,30 @@
}
/*else*/ {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":831
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":780
* elif t == NPY_OBJECT: f[0] = 79 #"O"
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
* f += 1
* else:
*/
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_4), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_6), __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L11:;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":832
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":781
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* f += 1 # <<<<<<<<<<<<<<
@@ -3088,21 +3122,21 @@
}
/*else*/ {
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":836
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":785
* # Cython ignores struct boundary information ("T{...}"),
* # so don't output it
* f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
* return f
*
*/
- __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f = __pyx_t_10;
}
__pyx_L9:;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":837
+ /* "/Users/stefan/lib/python2.6/site-packages/Cython/Includes/numpy.pxd":786
* # so don't output it
* f = _util_dtypestring(child, f, end, offset)
* return f # <<<<<<<<<<<<<<
@@ -3128,149 +3162,10 @@
__Pyx_DECREF(__pyx_v_new_offset);
__Pyx_DECREF(__pyx_v_t);
__Pyx_DECREF((PyObject *)__pyx_v_descr);
- __Pyx_RefNannyFinishContext();
+ __Pyx_FinishRefcountContext();
return __pyx_r;
}
-/* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":952
- *
- *
- * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
- * cdef PyObject* baseptr
- * if base is None:
- */
-
-static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
- PyObject *__pyx_v_baseptr;
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("set_array_base");
- __Pyx_INCREF((PyObject *)__pyx_v_arr);
- __Pyx_INCREF(__pyx_v_base);
-
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":954
- * cdef inline void set_array_base(ndarray arr, object base):
- * cdef PyObject* baseptr
- * if base is None: # <<<<<<<<<<<<<<
- * baseptr = NULL
- * else:
- */
- __pyx_t_1 = (__pyx_v_base == Py_None);
- if (__pyx_t_1) {
-
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":955
- * cdef PyObject* baseptr
- * if base is None:
- * baseptr = NULL # <<<<<<<<<<<<<<
- * else:
- * Py_INCREF(base) # important to do this before decref below!
- */
- __pyx_v_baseptr = NULL;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":957
- * baseptr = NULL
- * else:
- * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
- * baseptr = base
- * Py_XDECREF(arr.base)
- */
- Py_INCREF(__pyx_v_base);
-
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":958
- * else:
- * Py_INCREF(base) # important to do this before decref below!
- * baseptr = base # <<<<<<<<<<<<<<
- * Py_XDECREF(arr.base)
- * arr.base = baseptr
- */
- __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
- }
- __pyx_L3:;
-
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":959
- * Py_INCREF(base) # important to do this before decref below!
- * baseptr = base
- * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
- * arr.base = baseptr
- *
- */
- Py_XDECREF(__pyx_v_arr->base);
-
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":960
- * baseptr = base
- * Py_XDECREF(arr.base)
- * arr.base = baseptr # <<<<<<<<<<<<<<
- *
- * cdef inline object get_array_base(ndarray arr):
- */
- __pyx_v_arr->base = __pyx_v_baseptr;
-
- __Pyx_DECREF((PyObject *)__pyx_v_arr);
- __Pyx_DECREF(__pyx_v_base);
- __Pyx_RefNannyFinishContext();
-}
-
-/* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":962
- * arr.base = baseptr
- *
- * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
- * if arr.base is NULL:
- * return None
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
- PyObject *__pyx_r = NULL;
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("get_array_base");
- __Pyx_INCREF((PyObject *)__pyx_v_arr);
-
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":963
- *
- * cdef inline object get_array_base(ndarray arr):
- * if arr.base is NULL: # <<<<<<<<<<<<<<
- * return None
- * else:
- */
- __pyx_t_1 = (__pyx_v_arr->base == NULL);
- if (__pyx_t_1) {
-
- /* "C:\Python25\lib\site-packages\cython-0.12.1-py2.5-win32.egg\Cython\Includes\numpy.pxd":964
- * cdef inline object get_array_base(ndarray arr):
- * if arr.base is NULL:
- * return None # <<<<<<<<<<<<<<
- * else:
- * return