|
WebCab Portfolio Demo v4.2 (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Local interface of Interpolation. This interface provides the same functionality as the Interpolation remote interface.
Interpolation| Method Summary | |
double[] |
coefficientsInterpolatingPolynomial(double[] tabulatedValues,
double[] polynomialValues)
Method coefficientsInterpolatingPolynomial(double[], double[]) as defined in the Interpolation remote interface. |
double[] |
coefficientsInterpolatingPolynomialStable(double[] tabulatedValues,
double[] polynomialValues)
Method coefficientsInterpolatingPolynomialStable(double[], double[]) as defined in the Interpolation remote interface. |
double[] |
cubicSpline2ndDifferential(double[] tabulationPointsInX,
double[] functionValuesAtTabulationPoints,
double derivativeInterpolationAt0,
double derivativeInterpolationAtn_1)
Method cubicSpline2ndDifferential(double[], double[], double, double) as defined in the Interpolation remote interface. |
double |
cubicSplinePointwise(double[] tabulationPointsInX,
double[] functionValuesAtTabulationPoints,
double derivativeInterpolationAt0,
double derivativeInterpolationAtn_1,
double interpolationPoint)
Method cubicSplinePointwise(double[], double[], double, double, double) as defined in the Interpolation remote interface. |
double |
cubicSplinePointwisePreEvaluation(double[] tabulationPointsInX,
double[] functionValuesAtTabulationPoints,
double[] secondDifferential,
double interpolationPoint)
Method cubicSplinePointwisePreEvaluation(double[], double[], double[], double) as defined in the Interpolation remote interface. |
double[] |
interpolateExtrapolatePolynomial(double[] tabulationPointsInX,
double[] polynomialValues,
double interpolationPoint)
Method interpolateExtrapolatePolynomial(double[], double[], double) as defined in the Interpolation remote interface. |
| Methods inherited from interface javax.ejb.EJBLocalObject |
getEJBLocalHome, getPrimaryKey, isIdentical, remove |
| Method Detail |
public double[] interpolateExtrapolatePolynomial(double[] tabulationPointsInX,
double[] polynomialValues,
double interpolationPoint)
throws InterpolationException,
InterpolationDemoException
Description copied from the Interpolation interface:
This method interpolates (or extrapolates) a given polynomial in one variable. It returns an array of two values the first being the value of the interpolation function evaluated at the interpolation point and the other being the error estimate.
If P(x) is the polynomial of degree `n-1' such that P(xCoordinates[i])
= yCoordinates[i]; i=0,...,n-1; then if the desired point at which the interpolation
functions value is required is `interpolationPoint'. Then the returned value will
be some double value y, where y = P(interpolationPoint).
The `tabulationPointsInX' array and the `polynomialValues' array should each contain at least one element. If these arrays have different lengths the shorter one will be chosen as reference.
tabulationPointsInX - an array of doubles for which at member we know the corresponding value of the given polynomial. Note, that the corresponding values of the polynomial at these points given by the member of the array yCoordinates which lie in the corresponding position.polynomialValues - an array of doubles which corresponds to the value of the polynomial at the points tabulationPointsInX. The first point of this array is the value of the given polynomial evaluated at the point tabulationPointsInX[0], th second point of the array is the value of the given polynomial at the point tabulationPointsInX[1].interpolationPoint - the value of the point at which the interpolation function is evaluated and a corresponding error estimate is given.
InterpolationException - Thrown when the input values do not meet the requirements mentioned above.
InterpolationDemoExceptionInterpolation.interpolateExtrapolatePolynomial(double[], double[], double)
public double[] coefficientsInterpolatingPolynomialStable(double[] tabulatedValues,
double[] polynomialValues)
throws InterpolationException,
InterpolationDemoException
Description copied from the Interpolation interface:
Evaluates the coefficients of the interpolating polynomial when the tabulation points are known. That is, a set of points in the range and the corresponding values in the domain of the interpolation function are known and we will deduce from this information the coefficients of the corresponding interpolation polynomial assuming the degree of this polynomial is one less than the number of tabulation points used.
Further Explanation
If we are given a set of n points on which the
interpolation function is known then this method evaluates the n coefficients
c_i of the interpolation function c_0 + (c_1 * x) + (c_2 * x * x)+ ....
More explicitly, given a set of tabulation points x = {x[i]: i=0,...,n-1}
and y = {y[i]:i=0,...,n-1}
which defines a function by y[i] = f(x[i]). This method returns an array of
doubles which are the coefficients of the interpolating polynomial where the first term
of the array corresponds to the 0th order term, the second term corresponds to the 1st order
term (i.e. x's coefficient) and so on.
Comparison with coefficientsInterpolatingPolynomial
The method coefficientsInterpolatingPolynomial
differs slightly from this method which is less direct and slower by a
power of the number of tabulation points used. However, we have found this
approach to be more stable. The essential idea in this approach is that it
uses the interpolateExtrapolatePolynomial method with iterative reduction
to arrive at the interpolation polynomial.
Remark: If the two arrays have different lengths the shorter one will be used as reference.
tabulatedValues - an array of doubles which represent the values at which the interpolation polynomial is tabulated. That is, is `f' is the interpolating polynomial then we have f(tabulatedValues[i]) = polynomialValues[i]; where `polynomialValues[i]' is the value of the interpolating polynomial at the `tabulatedValues[i]'.polynomialValues - an array of doubles where the first element `polynomialValues[0]', corresponds to the value of the interpolating polynomial at the first tabulation point `tabulatedValues[0]', and the second values `polynomialValues[1]' corresponds to the value of the interpolating polynomial at the second tabulated point `tabulatedValues[1]', and so on...
InterpolationException - Thrown when any of the two parameters are null.
InterpolationDemoExceptioncoefficientsInterpolatingPolynomial
,
interpolateExtrapolatePolynomial,
Interpolation.coefficientsInterpolatingPolynomialStable(double[], double[])
public double[] coefficientsInterpolatingPolynomial(double[] tabulatedValues,
double[] polynomialValues)
throws InterpolationException,
InterpolationDemoException
Description copied from the Interpolation interface:
Evaluates the coefficients of the interpolating polynomial when the tabulation points are known. That is, a set of points in the range and the corresponding values in the domain of the interpolation function are known and we will deduce from this information the coefficients of the corresponding interpolation polynomial assuming the degree of this polynomial is one less than the number of tabulation points used.
Further Explanation
If we are given a set of n points on which the
interpolation function is known then this method evaluates the n coefficients
c_i of the interpolation function c_0 + (c_1 * x) + (c_2 * x * x)+ ....
More explicitly, given a set of tabulation points x = {x[i]: i=0,...,n-1}
and y = {y[i]:i=0,...,n-1}
which defines a function by y[i] = f(x[i]). This method returns an array of
doubles which are the coefficients of the interpolating polynomial where the first term
of the array corresponds to the 0th order term, the second term corresponds to the 1st order
term (i.e. x's coefficient) and so on.
Comparison with coefficientsInterpolatingPolynomialStable
The method coefficientsInterpolatingPolynomialStable differs slightly
from this method which is more direct, and faster by a power of the number of tabulation
points used. However, we have found this approach to be less stable.
Remark: If the two arrays have different lengths the shorter one will be used as reference.
tabulatedValues - an array of doubles which represent the values at which the interpolation polynomial is tabulated. That is, if `f' is the interpolation polynomial then we have f(tabulatedValues[i]) = polynomialValues[i]; where `polynomialValues[i]' is the value of the interpolation polynomial at the `tabulated values`tabulatedValues[i]'.polynomialValues - an array of double where the first element `polynomialValues[0]', corresponds to the value of the interpolating polynomial at the first tabulation point `tabulatedValues[0]', and the second values `polynomialValues[1]' corresponds to the value of the interpolating polynomial at the second tabulated point `tabulatedValues[1]', and so on...
InterpolationException - Thrown when either of the two parameters is null.
InterpolationDemoExceptionInterpolation.coefficientsInterpolatingPolynomial(double[], double[])
public double[] cubicSpline2ndDifferential(double[] tabulationPointsInX,
double[] functionValuesAtTabulationPoints,
double derivativeInterpolationAt0,
double derivativeInterpolationAtn_1)
throws InterpolationException,
InterpolationDemoException
Description copied from the Interpolation interface:
Evaluates the second derivatives of the cubic spline interpolation polynomial at the given functions tabulation points when the first derivative at the boundary (equivalently the end points) is known. Knowledge of the second derivative is required in order to uniquely determine the cubic spline.
Description of the parameters
Given arrays tabulationPointsInX[0..n-1] and
tabulationPointsInY[0..n-1] containing a tabulated function,
i.e. tabulationPointsInY[i] = f(tabulationPointsInY[i]), with
tabulationPointsInX[0] < tabulationPointsInX[1] < ... < tabulationPointsInX[n-1],
and given values derivativeInterpolationAt0 and derivativeInterpolationAtn_1
for the first derivative of the interpolating function at the points tabulationPointsInX[0]
and tabulationPointsInX[n-1], respectively. This method returns an array
of length n, that contains the second derivatives of the interpolation
function at the tabulation points tabulationPointsInX[i]. If
derivativeInterpolationAt0 and/or derivativeInterpolationAtn_1
are equal to 1030 or larger, then the method sets
the second derivative at the boundary to be zero.
Remark: If the two arrays have different lengths, the shorter one will be used as reference. The two arrays should be at least 2 elements long.
tabulationPointsInX - an array of doubles which are the values at which the function is tabulated, i.e. functionValuesAtTabulationPoints[i] = f(tabulationPointsInX[i])functionValuesAtTabulationPoints - an array of doubles which are the values of the function evaluated at the interpolation points, i.e. functionValuesAtTabulationPoints[i] = f(tabulationPointsInX[i])derivativeInterpolationAt0 - the first derivative of the interpolation function at the point tabulationPointsInX[0]derivativeInterpolationAtn_1 - the first derivative of the interpolation function at the point tabulatedPointInX[n-1]
InterpolationException - Thrown when the input values do not meet the requirements mentioned above.
InterpolationDemoExceptionInterpolation.cubicSpline2ndDifferential(double[], double[], double, double)
public double cubicSplinePointwisePreEvaluation(double[] tabulationPointsInX,
double[] functionValuesAtTabulationPoints,
double[] secondDifferential,
double interpolationPoint)
throws InterpolationException,
InterpolationDemoException
Description copied from the Interpolation interface:
Returns the cubic spline interpolation of a function at a point. We have designed this method so that the
2nd derivatives can be pre-evaluated using the method cubicSpline2ndDifferential.
General Description of Parameters
Given the arrays tabulationPointsInX[0..n-1] and functionValuesAtTabulationPoints[0..n-1],
which tabulate a function where the tabulationPointsInX is an array where the elements are monotonically
increasing. Moreover, given the array secondDifferenttial[0..n-1], which is the output of the method
cubicSpline2ndDifferential, and given a value of the interpolation points interpolationPoint,
this method returns the value of the function at interpolationPoint according to the cubic-spline interpolation
method.
Description of the Parameters in terms of the Efficient Frontier
With direct regards to the Efficient Frontier the points tabulationPointsInX[0..n-1],
will refer to the risk of the portfolios on the Efficient Frontier and be evaluated using
portfolioRisksEfficientFrontier of the Markowitz Enterprise JavaBean.
The values functionValuesAtTabulationPoints[0..n-1]
will refer to the expected returns of the known portfolios on the Efficient Frontier and can be evaluated using
expectedReturnEfficientFrontier of the Markowitz Enterprise JavaBean.
The 2nd derivatives can be thought of as the rate of change of the increase in the expected return for taken
on more risk. That is, the second derivatives express a qualitative property of the Efficient Frontier.
The point at which the cubic spline in interpolated namely, interpolationPoint, will refer to the
value of the portfolio risk for which the value of corresponding expected return will be returned.
Remarks:
cubicSpline2ndDifferential
is used in the evaluation of the 2nd derivatives then all the parameters in both methods
are applied in a consistent fashion.
tabulationPointsInX - the array containing the values at which the function is tabulated, i.e. functionValuesAtTabulationPoints[i] = f(tabulationPointsInX[i])functionValuesAtTabulationPoints - an array of doubles of the values of the function evaluated at the interpolation points, i.e. functionValuesAtTabulationPoints[i] = f(tabulationPointsInX[i])secondDifferential - an array containing the 2nd differential of the cubic spline at the tabulation points. These 2nd differentials can be evaluated using the method cubicSpline2ndDifferential.interpolationPoint - the point at which the interpolation function is evaluated and returned. Note that this is the point at which we wished to find the value of the given function which we only knew at the tabulation points
InterpolationException - Thrown when the input values do not meet the requirements
mentioned above.
InterpolationDemoExceptioncubicSplinePointwise - this is an alternative means by which the value of the cubic spline
can be evaluated at a point. Here rather than providing the 2nd differentials we are required
to provide the values of the differentials at the end points.
,
cubicSpline2ndDifferential - use this method in order to evaluate the 2nd differentials at
the tabulation points which most be provided to this method a parameter.,
Interpolation.cubicSplinePointwisePreEvaluation(double[], double[], double[], double)
public double cubicSplinePointwise(double[] tabulationPointsInX,
double[] functionValuesAtTabulationPoints,
double derivativeInterpolationAt0,
double derivativeInterpolationAtn_1,
double interpolationPoint)
throws InterpolationException,
InterpolationDemoException
Description copied from the Interpolation interface:
Returns the value of the cubic spline interpolation at a given point. In particular, here we apply this method to estimate the value of the Efficient Frontier at a given point when it is only know on a finite set of points.
General Description of Parameters
Given a function which is tabulated at the points tabulationPointsInX[0..n-1]
which has elements was are monotonically increasing and takes the values
functionValuesAtTabulationPoints[0..n-1] at those points, this methods returns
the values of the cubic spline interpolation function evaluated at the
given point interpolationPoint.
Description of the Parameters in terms of the Efficient Frontier
With direct regards to the Efficient Frontier the points tabulationPointsInX[0..n-1],
will refer to the risk of the portfolios on the Efficient Frontier and be evaluated using
portfolioRisksEfficientFrontier of the Markowitz Enterprise JavaBean.
The values functionValuesAtTabulationPoints[0..n-1]
will refer to the expected returns of the known portfolios on the Efficient Frontier and be evaluated using
expectedReturnEfficientFrontier of the Markowitz Enterprise JavaBean.
The point at which the cubic spline in interpolated namely, interpolationPoint, will refer
to the value of the portfolio risk for which the value of corresponding expected return will be returned.
Notes on Estimating the Derivatives
When applying this method you will need to provide values of the derivative of the interpolation function at the end points. A reasonable estimate with regard to approximating the Efficient Frontier could be provided by directed evaluating the slope between either the first or last two known points of the Efficient Frontier.
Remark: If the two arrays have different lengths, the shorter one will be used as reference. The two arrays should be at least 2 elements long.
tabulationPointsInX - the array containing the values at which the function is tabulated, i.e. functionValuesAtTabulationPoints[i] = f(tabulationPointsInX[i])functionValuesAtTabulationPoints - an array of double of the values of the function evaluated at the interpolation points, i.e. functionValuesAtTabulationPoints[i] = f(tabulationPointsInX[i]), where f is the function being consideredderivativeInterpolationAt0 - the first derivative of the interpolation function at the point tabulationPointsInX[0]derivativeInterpolationAtn_1 - the first derivative of the interpolation function at the point tabulatedPointInX[n-1]interpolationPoint - The value of the `x-coordinate' at which the value of the cubic spline interpolation function is evaluated. Note, that in the case of the Efficient Frontier this will refer to the risk of the portfolio.
InterpolationException - Thrown when the input values do not meet the requirements mentioned above.
InterpolationDemoExceptioncubicSplinePointwisePreEvaluation,
Interpolation.cubicSplinePointwise(double[], double[], double, double, double)
|
WebCab Portfolio Demo v4.2 (J2EE Edition) |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||