|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object numal.lowprecision.test.TestMarquardt
public class TestMarquardt
Test the least-square fit method AnalyticProblems.marquardt(int, int, float[], float[], float[][], numal.lowprecision.Function, float[])
.
Should return the following results :
Parameters:
5.23219E2 -1.56833E2 -1.99784E-1
OUT:
7.22065E7
1.15716E2
1.74713E-3
1.65459E2
2.30000E1
2.20000E1
0.00000E0
Last residual vector:
-29.6 86.6 -47.3 -26.2 -22.9 39.5
Constructor Summary | |
---|---|
TestMarquardt(float[] x,
float[] y)
|
Method Summary | |
---|---|
void |
computeJacobian(int m,
int n,
float[] parameter,
float[] rv,
float[][] jac)
Get the partial derivatives jac[i][j] = drv[i]/dpar[j], obtained with the current values of the parameters. |
boolean |
computeResidualVector(int m,
int n,
float[] parameter,
float[] rv)
Get residual vector rv[i] = f(x[i],par) - y[i]. |
static float |
f(float x,
float[] parameter)
Get the value of this function for a given abcissa and parameters. |
float |
getAbsoluteTolerance()
Absolute tolerance for the difference between the Euclidian norm of the ultimate and penultimate residual vector (value of epsilon_a) the process is terminated if the improvement of the sum of the squares is less than relativeTolerance*(sum of the squares)+absoluteTolerance*absoluteTolerance |
float[] |
getAnalyticValues(int m,
float[] parameter)
Get the analytic values of the function for the given set of parameters and for all abcissa. |
int |
getInvocations()
Maximum allowed number of invocations of Function.computeResidualVector(int, int, float[], float[]) |
float |
getMachinePrecision()
Machine precision |
float |
getRelativeTolerance()
Relative tolerance for the difference between the Euclidian norm of the ultimate and penultimate residual vector (value of epsilon_re) (see absoluteTolerance) |
float |
getStartingValue()
Starting value used for the relation between the gradient and the Gauss-Newton direction (value of ξ); if the problem is well conditioned then a suitable value for startingValue will be 0.01; if the problem is ill conditioned then startingValue should be greater, but the value of startingValue must satisfy : machinePrecision < startingValue ≤ 1 / machinePrecision |
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TestMarquardt(float[] x, float[] y)
Method Detail |
---|
public static void main(String[] args)
public static float f(float x, float[] parameter)
x
- the abcissa at which this function is to be evaluatedparameter
- an array of function parameters
public float[] getAnalyticValues(int m, float[] parameter)
Function
getAnalyticValues
in interface Function
m
- number of sample points used in the fittingparameter
- an array of function parameters
public boolean computeResidualVector(int m, int n, float[] parameter, float[] rv)
Function
computeResidualVector
in interface Function
m
- number of sample points used in the fittingn
- number of parameters, must be less than or equal to mparameter
- input: current values of parameters (shouldn't be altered by funct)rv
- output: residual vector obtained with current value of parameters; i.e f(x[i],par) - y[i]
public void computeJacobian(int m, int n, float[] parameter, float[] rv, float[][] jac)
Function
AnalyticProblems.marquardt(int, int, float[], float[], float[][], numal.lowprecision.Function, float[])
.
POSTCONDITION: parameter array must not be altered.
computeJacobian
in interface Function
m
- number of sample points used in the fittingn
- number of parameters, must be less than or equal to the number of sample pointsparameter
- input: current values of parametersrv
- output: residual vector obtained with current value of parameters; i.e f(x[i],parameter) - y[i]jac
- output: partial derivatives drv[i]/dparameter[j], obtained with the current values of the parameterspublic int getInvocations()
Function
Function.computeResidualVector(int, int, float[], float[])
getInvocations
in interface Function
public float getMachinePrecision()
Function
getMachinePrecision
in interface Function
public float getRelativeTolerance()
Function
getRelativeTolerance
in interface Function
public float getAbsoluteTolerance()
Function
getAbsoluteTolerance
in interface Function
public float getStartingValue()
Function
getStartingValue
in interface Function
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |