-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjacobi_expand.m
More file actions
33 lines (30 loc) · 1.17 KB
/
jacobi_expand.m
File metadata and controls
33 lines (30 loc) · 1.17 KB
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
function jchaos = jacobi_expand(x, coef, alpha, beta, order)
%
% jacobi_expand.m - Evaluates the Jacobi-chaos expansion at given data points
%
% Syntax: jchaos = jacobi_expand(x, coef, alpha, beta, order)
%
% Input : x = data points in matrix form where expansion to be evaluated
% coef = array with length (P+1) containning expansion coeffcients
% of P-th order Jacobi-chaos
% alpha, beta = parameters > -1 of Jacobi-chaos
% order = specified order for the expansion to be evaluated;
% if order is not in the range defined by coef (1,P), i.e.,
% order>P or <=0, then the full order P from coef will be
% used. (in a word, 'order' provides a way to evaluate
% the chaos at expansion order lower than P.)
%
% Output: jchaos = values of expansion at x, stored in the same format as x
%
% NO WARNING MESSAGE IS GIVEN WHEN PAPAMETERS ARE OUT OF RANGE.
%
% Code generated by Dongbin Xiu 01/24/2002.
%
P = length(coef)-1;
if ((order <= 0) | (order > P))
order = P;
end
jchaos = zeros(size(x));
for i=1:(order+1)
jchaos = jchaos + coef(i)*JacobiF(x, i-1, alpha, beta);
end