Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sebastian Steinlechner
pykat
Commits
ca11ad10
Commit
ca11ad10
authored
May 14, 2016
by
Andreas Freise
Browse files
adding jacobi.py
parent
bb3dc798
Changes
1
Hide whitespace changes
Inline
Side-by-side
pykat/math/jacobi.py
0 → 100644
View file @
ca11ad10
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
unicode_literals
import
numpy
as
np
import
scipy.special
def
jacobi
(
n
,
a
,
b
,
x
):
""" Implementation of Jacobi fucntion using binominal coefficients.
This can handle values of alpha, beta < -1 which the special.eval_jacobi
function cannot."""
P
=
0.0
for
s
in
np
.
arange
(
0
,
n
+
1
):
P
=
P
+
scipy
.
special
.
binom
(
n
+
a
,
s
)
*
scipy
.
special
.
binom
(
n
+
b
,
n
-
s
)
*
(
x
-
1.0
)
**
(
n
-
s
)
*
(
x
+
1.0
)
**
s
P
=
P
*
0.5
**
n
return
P
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment