/usr/lib/python2.7/dist-packages/pymc/gp/cov_funs/bases.py is in python-pymc 2.2+ds-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # Copyright (c) Anand Patil, 2007
from numpy import *
from pymc import six
xrange = six.moves.xrange
__all__ = ['fourier_basis']
def fourier_basis(n):
n_dim = len(n)
basis = []
for i in xrange(n_dim):
def fun(x, xmin, xmax):
return ones(x.shape[0], dtype=float)
basis_now = [fun]
for j in xrange(1,n[i]+1):
def fun(x, xmin, xmax, j=j, i=i):
T = xmax[i] - xmin[i]
return cos(2.*j*pi*(x[:,i] - xmin[i]) / T)
basis_now.append(fun)
def fun(x, xmin, xmax, j=j, i=i):
T = xmax[i] - xmin[i]
return sin(2.*j*pi*(x[:,i] - xmin[i]) / T)
basis_now.append(fun)
basis.append(basis_now)
return basis
|