विकी लेख है कि आप पोस्ट के आधार पर, मुझे लगता है कि आप इस कोड है कि मैंने लिखा का उपयोग कर hypergeometric समारोह के मूल्यों का अनुमान लगा सकता:
अगले कदम के रूप में, यह की त्रुटि अनुमान लगाने के लिए संभव हो सकता है सन्निकटन।
/**
* The generalized hypergeometric function is a convergent power series \sum_{i=0}^{\infty} c_i x^i
* where the coefficients satisfy c_{n+1}/c_n = A(n)/B(n) for some polynomials A and B in n.
* It is customary to factor out the leading term, so c_0 is assumed to be 1
*/
public class HypergeometricFunction {
private final int degreeOfApproximation;
private final double[] coefficientsOfA;
private final double[] coefficientsOfB;
private final double[] coefficientsOfHypergeometricFunction;
public HypergeometricFunction(int degreeOfApproximation, double[] coefficientsOfA, double[] coefficientsOfB) {
this.degreeOfApproximation = degreeOfApproximation;
this.coefficientsOfA = coefficientsOfA;
this.coefficientsOfB = coefficientsOfB;
this.coefficientsOfHypergeometricFunction = generateCoefficients();
}
/**
* @param x input
* @return Approximation to the hypergeometric function by taking the first
* {@code degreeOfApproximation} terms from the series.
*/
public double approximate(double x){
return evaluatePolynomial(x, coefficientsOfHypergeometricFunction);
}
private double[] generateCoefficients() {
double[] coefficients = new double[degreeOfApproximation];
coefficients[0] = 1;
for (int i = 1; i < degreeOfApproximation; i++)
coefficients[i] = (evaluatePolynomial(i, coefficientsOfA)/evaluatePolynomial(i, coefficientsOfB)) * coefficients[i - 1];
return coefficients;
}
private double evaluatePolynomial(double n, double[] coefficients) {
int length = coefficients.length;
double out = 0.0D;
for (int i = 0; i < length; i++) {
out += coefficients[i] * pow(n, i);
}
return out;
}
private double pow(double a, int b) {
double out = 1;
for (int i = 0; i < b; i++) out *= a;
return out;
}
}
श्रृंखला और converges (और इसलिए एक उचित hypergeometric समारोह प्रदान करता है), तो lim[c_i*x^i]
शून्य होना चाहिए, तो यह एक उचित सन्निकटन प्रदान करना चाहिए अगर आप degreeOfApproximation
ले इतना बड़ा हो सकता है।
बहुपद ए और बी विकी आलेख में संदर्भित हैं, और इस कोड का उपयोग करने के लिए, आपको उन बहुपदों के लिए गुणांक के सरणी प्रदान करना होगा, साथ ही अनुमानित वांछित डिग्री के साथ।
उम्मीद है कि यह आपकी मदद करता है।
उत्तर के लिए धन्यवाद। मैंने विषय में गलत किया है। सामान्यीकृत हाइपरजैमेट्रिक वितरण के बजाय इसे सामान्यीकृत हाइपरजैमेट्रिक फ़ंक्शन होना चाहिए। उसके लिए खेद है। – longread