Skip to content

Commit

Permalink
Von Mises and trailing whitespace patches from Andrew Straw
Browse files Browse the repository at this point in the history
git-svn-id: https://pymc.googlecode.com/svn/trunk@1156 15d7aa0b-6f1a-0410-991a-d59f85d14984
  • Loading branch information
anand.prabhakar.patil committed Jan 15, 2009
1 parent b125991 commit e9b3efa
Show file tree
Hide file tree
Showing 133 changed files with 5,739 additions and 4,597 deletions.
8 changes: 4 additions & 4 deletions GUI/ExtremeRainfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from PyMC import data, parameter, Uniform, Beta, gev_like
from numpy import array

# Define the priors for the location (xi), scale (alpha) and shape (kappa)
# parameters.
# Define the priors for the location (xi), scale (alpha) and shape (kappa)
# parameters.

xi = Uniform('xi', rseed=True, lower=0, upper=60, doc='Location parameter')

Expand All @@ -25,9 +25,9 @@ def alpha(value=5):
19.1, 30.2, 20.1, 22. , 21.2, 9.9, 20.8, 44. , 24.6,
35. , 14.8, 26.2, 18.2, 17.1, 27. , 20.2, 20.8, 20.3,
16.6, 17.2, 30.7, 18.6, 17.8, 24.5, 24.6, 35.8])

@data
def D(value=annual_maxima, location=xi, scale=alpha, shape=kappa):
return gev_like(value, shape, location, scale)


4 changes: 2 additions & 2 deletions GUI/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ def on_button2_clicked(self, widget):

elif self.sampler.status == 'paused':
self.sampler.interactive_continue()

widget.set_label('Stop')
widget.set_image(gtk.image_new_from_stock('gtk-stop', gtk.ICON_SIZE_BUTTON))

self.timer = Thread(target=gobject.timeout_add, args= (100, progress_timeout, self))
self.timer.start()

Expand Down
6 changes: 6 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
Copyright (c) 2006 Christopher J. Fonnesbeck
Copyright (c) 2007-2008 Christopher J. Fonnesbeck, Anand.Prabhakar Patil, David Huard
Copyright (c) 2009 PyMC Authors (See CREDITS file)


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Other code in PyMC
------------------

See the file pymc/cephes/README for the BSD license under which the cephes code is distributed.
35 changes: 35 additions & 0 deletions cephes/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
These files were copied from the scipy/special/cephes directory with
the exception of the c2f.c file on 2009-01-13 by Andrew D. Straw.

Accordingly, these files (all but c2f.c) are under the following
license, which was copied from scipy/LICENSE.txt.

Copyright (c) 2001, 2002 Enthought, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

a. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
b. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
c. Neither the name of the Enthought nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.


THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

14 changes: 14 additions & 0 deletions cephes/c2f.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* c2f.c - call C functions from fortran */

/* Fortran and C have different calling conventions. This file does
impedance matching between the two. */

extern double cephes_i0(double);

double i0_(x)
double* x;
{
double result;
result = cephes_i0(*x);
return result;
}
98 changes: 98 additions & 0 deletions cephes/cephes_names.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
#ifndef CEPHES_NAMES_H
#define CEPHES_NAMES_H

#define airy cephes_airy
#define bdtrc cephes_bdtrc
#define bdtr cephes_bdtr
#define bdtri cephes_bdtri
#define beta cephes_beta
#define lbeta cephes_lbeta
#define btdtr cephes_btdtr
#define cbrt cephes_cbrt
#define chdtrc cephes_chdtrc
#define chdtr cephes_chdtr
#define chdtri cephes_chdtri
#define dawsn cephes_dawsn
#define ellie cephes_ellie
#define ellik cephes_ellik
#define ellpe cephes_ellpe
#define ellpj cephes_ellpj
#define ellpk cephes_ellpk
#define exp10 cephes_exp10
#define exp1m cephes_exp1m
#define exp2 cephes_exp2
#define expn cephes_expn
#define fabs cephes_fabs
#define fdtrc cephes_fdtrc
#define fdtr cephes_fdtr
#define fdtri cephes_fdtri
#define fresnl cephes_fresnl
#define Gamma cephes_Gamma
#define lgam cephes_lgam
#define gdtr cephes_gdtr
#define gdtrc cephes_gdtrc
#define gdtri cephes_gdtri
#define hyp2f1 cephes_hyp2f1
#define hyperg cephes_hyperg
#define hyp2f0 cephes_hyp2f0
#define onef2 cephes_onef2
#define threef0 cephes_threef0
#define i0 cephes_i0
#define i0e cephes_i0e
#define i1 cephes_i1
#define i1e cephes_i1e
#define igamc cephes_igamc
#define igam cephes_igam
#define igami cephes_igami
#define incbet cephes_incbet
#define incbi cephes_incbi
#define iv cephes_iv
#define j0 cephes_j0
#define y0 cephes_y0
#define j1 cephes_j1
#define y1 cephes_y1
#define jn cephes_jn
#define jv cephes_jv
#define k0 cephes_k0
#define k0e cephes_k0e
#define k1 cephes_k1
#define k1e cephes_k1e
#define kn cephes_kn
#define nbdtrc cephes_nbdtrc
#define nbdtr cephes_nbdtr
#define nbdtri cephes_nbdtri
#define ndtr cephes_ndtr
#define erfc cephes_erfc
#define erf cephes_erf
#define ndtri cephes_ndtri
#define pdtrc cephes_pdtrc
#define pdtr cephes_pdtr
#define pdtri cephes_pdtri
#define psi cephes_psi
#define rgamma cephes_rgamma
#define round cephes_round
#define shichi cephes_shichi
#define sici cephes_sici
#define radian cephes_radian
#define sindg cephes_sindg
#define cosdg cephes_cosdg
#define sincos cephes_sincos
#define spence cephes_spence
#define stdtr cephes_stdtr
#define stdtri cephes_stdtri
#define struve cephes_struve
#define yv cephes_yv
#define tandg cephes_tandg
#define cotdg cephes_cotdg
#define log1p cephes_log1p
#define expm1 cephes_expm1
#define cosm1 cephes_cosm1
#define yn cephes_yn
#define zeta cephes_zeta
#define zetac cephes_zetac
#define smirnov cephes_smirnov
#define smirnovi cephes_smirnovi
#define kolmogorov cephes_kolmogorov
#define kolmogi cephes_kolmogi

#endif
89 changes: 89 additions & 0 deletions cephes/chbevl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/* chbevl.c
*
* Evaluate Chebyshev series
*
*
*
* SYNOPSIS:
*
* int N;
* double x, y, coef[N], chebevl();
*
* y = chbevl( x, coef, N );
*
*
*
* DESCRIPTION:
*
* Evaluates the series
*
* N-1
* - '
* y = > coef[i] T (x/2)
* - i
* i=0
*
* of Chebyshev polynomials Ti at argument x/2.
*
* Coefficients are stored in reverse order, i.e. the zero
* order term is last in the array. Note N is the number of
* coefficients, not the order.
*
* If coefficients are for the interval a to b, x must
* have been transformed to x -> 2(2x - b - a)/(b-a) before
* entering the routine. This maps x from (a, b) to (-1, 1),
* over which the Chebyshev polynomials are defined.
*
* If the coefficients are for the inverted interval, in
* which (a, b) is mapped to (1/b, 1/a), the transformation
* required is x -> 2(2ab/x - b - a)/(b-a). If b is infinity,
* this becomes x -> 4a/x - 1.
*
*
*
* SPEED:
*
* Taking advantage of the recurrence properties of the
* Chebyshev polynomials, the routine requires one more
* addition per loop than evaluating a nested polynomial of
* the same degree.
*
*/
/* chbevl.c */

/*
Cephes Math Library Release 2.0: April, 1987
Copyright 1985, 1987 by Stephen L. Moshier
Direct inquiries to 30 Frost Street, Cambridge, MA 02140
*/

#include <stdio.h>

#define ANSIPROT
#ifdef ANSIPROT
double chbevl( double, double [], int );
#endif

double chbevl( x, array, n )
double x;
double array[];
int n;
{
double b0, b1, b2, *p;
int i;

p = array;
b0 = *p++;
b1 = 0.0;
i = n - 1;

do
{
b2 = b1;
b1 = b0;
b0 = x * b1 - b2 + *p++;
}
while( --i );

return( 0.5*(b0-b2) );
}
Loading

0 comments on commit e9b3efa

Please sign in to comment.