|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.esa.beam.util.math.Approximator
public class Approximator
A utility class which can be used to find approximation functions for a given dataset.
| Constructor Summary | |
|---|---|
Approximator()
|
|
| Method Summary | |
|---|---|
static void |
approximateFX(double[][] data,
int[] indices,
FX[] f,
double[] c)
Solves a linear equation system with each term having the form c * f(x). |
static void |
approximateFXY(double[][] data,
int[] indices,
FXY[] f,
double[] c)
Solves a linear equation system with each term having the form c * f(x,y). |
static double[] |
computeErrorStatistics(double[][] data,
int[] indices,
FXY[] f,
double[] c)
Returns the root mean square error (RMSE) for the approximation of the given data with a function given by z(x,y) = c[0]*f[0](x,y) + c[1]*f[1](x,y) + c[2]*f[2](x,y) + ... + c[n-1]*f[n-1](x,y). |
static double |
computeRMSE(double[][] data,
int[] indices,
FXY[] f,
double[] c)
Returns the root mean square error (RMSE) for the approximation of the given data with a function given by z(x,y) = c[0]*f[0](x,y) + c[1]*f[1](x,y) + c[2]*f[2](x,y) + ... + c[n-1]*f[n-1](x,y). |
static double |
computeY(FX[] f,
double[] c,
double x)
Computes y(x) = sum(c[i] * f[i](x), i = 0, n - 1). |
static double |
computeZ(FXY[] f,
double[] c,
double x,
double y)
Computes z(x,y) = sum(c[i] * f[i](x,y), i = 0, n - 1). |
static double |
getRMSE(double[][] data,
int[] indices,
FX[] f,
double[] c)
Returns the root mean square error (RMSE) for the approximation of the given data with a function given by y'(x) = c[0]*f[0](x) + c[1]*f[1](x) + c[2]*f[2](x) + ... + c[n-1]*f[n-1](x). |
static void |
solve1(double[][] a,
double[] b,
double[] c)
Solves the matrix equation A * C = B for given A,B by performing the operation C = A.solve(B). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Approximator()
| Method Detail |
|---|
public static void approximateFX(double[][] data,
int[] indices,
FX[] f,
double[] c)
c[0] to c[n-1] with n = f.length for an approximation function y'(x) =
c[0]*f[0](x) + c[1]*f[1](x) + c[2]*f[2](x) + ... + c[n-1]*f[n-1](x) which approximates the given
data vector xi=data[i][0], yi=data[i][1] with i = 0
to data.length-1.
data - an array of values of the form {{x1,y1}, {x2,y2}, {x3,y3}, ...} indices - the co-ordinate indices vector, determining the indices of x,y within data. If null
then indices defaults to {0, 1}.f - the function vector, each function has the form y=f(x)c - the resulting coefficient vector, must have the same size as the function vector
public static void approximateFXY(double[][] data,
int[] indices,
FXY[] f,
double[] c)
c[0] to c[n-1] with n = f.length for an approximation function z'(x,y) =
c[0]*f[0](x,y) + c[1]*f[1](x,y) + c[2]*f[2](x,y) + ... + c[n-1]*f[n-1](x,y) which approximates the
given data vector xi=data[i][0], yi=data[i][1],
zi=data[i][2] with i = 0 to data.length-1.
data - an array of values of the form {{x1,y1,z1}, {x2,y2,z2}, {x3,y3,z3}, ...} indices - the co-ordinate indices vector, determining the indices of x,y,z within data. If
null then indices defaults to {0, 1, 2}.f - the function vector, each function has the form z=f(x,y)c - the resulting coefficient vector, must have the same size as the function vector
public static double getRMSE(double[][] data,
int[] indices,
FX[] f,
double[] c)
c[0]*f[0](x) + c[1]*f[1](x) + c[2]*f[2](x) + ... + c[n-1]*f[n-1](x).
data - an array of values of the form {{x1,y1}, {x2,y2}, {x3,y3}, ...} indices - the co-ordinate indices vector, determining the indices of x,y within data. If
null then indices defaults to {0, 1}.f - the function vector, each function has the form y=f(x)c - the coefficient vector, must have the same size as the function vector
public static double computeRMSE(double[][] data,
int[] indices,
FXY[] f,
double[] c)
c[0]*f[0](x,y) + c[1]*f[1](x,y) + c[2]*f[2](x,y) + ... + c[n-1]*f[n-1](x,y).
data - an array of values of the form {{x1,y1,z1}, {x2,y2,z1}, {x3,y3,z1}, ...} indices - the co-ordinate indices vector, determining the indices of x,y,z within data. If
null then indices defaults to {0, 1, 2}.f - the function vector, each function has the form z=f(x,y)c - the coefficient vector, must have the same size as the function vector
public static double[] computeErrorStatistics(double[][] data,
int[] indices,
FXY[] f,
double[] c)
c[0]*f[0](x,y) + c[1]*f[1](x,y) + c[2]*f[2](x,y) + ... + c[n-1]*f[n-1](x,y).
data - an array of values of the form {{x1,y1,z1}, {x2,y2,z1}, {x3,y3,z1}, ...} indices - the co-ordinate indices vector, determining the indices of x,y,z within data. If
null then indices defaults to {0, 1, 2}.f - the function vector, each function has the form z=f(x,y)c - the coefficient vector, must have the same size as the function vector
public static double computeY(FX[] f,
double[] c,
double x)
f - the function vectorc - the coeffcient vectorx - the x value
public static double computeZ(FXY[] f,
double[] c,
double x,
double y)
f - the function vectorc - the coeffcient vectorx - the x valuey - the y value
public static void solve1(double[][] a,
double[] b,
double[] c)
a - matrix Ab - matrix Bc - result matrix C
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||