|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvec_math.ExpressionFit.AmoebaModel
protected static class ExpressionFit.AmoebaModel
A multidimensional that evaluates a function f given as a string like
a0*cos(a1*$t+a2)
on all input data, such that it returns
Σ(y_i-y_av-f_i)&pow2;
The independet variable is always at index zero in the input data,
and the dependent y_i is at the index provided at construct.
| Field Summary | |
|---|---|
private VectorG[] |
data
Input data, on each VectorG only zero and yindex is used. |
private ExpressionNode |
fit
The expression that is the model. |
static String |
TIME
The name of the independant variable in the expression. |
private double |
yav
The average of the dependant variable. |
private int |
yindex
The index of the dependant variable. |
| Constructor Summary | |
|---|---|
protected |
ExpressionFit.AmoebaModel(String model)
Only constructs with an expression node. |
|
ExpressionFit.AmoebaModel(String model,
VectorG[] mag,
int y)
Constructs a new Amoeba Model. |
| Method Summary | |
|---|---|
double |
evaluateModel(VectorG a,
VectorG time)
Returns the model at a single point. |
int |
getMeasureCount()
The number of dimensions is the variables count minus one. |
double[] |
getMeasurementErrors()
Returns null. |
double[] |
getMeasures()
Returns the measures. |
double[] |
getModel(VectorG a)
The model |
private double[] |
getModelAtData(VectorG a)
Returns the current model fit at all data points. |
int |
getParameterCount()
The number of dimensions is the variables count minus one. |
double[] |
getResiduals(VectorG a)
Returns the residuals of the measures to the data model. |
VectorG[] |
getTimes()
Returns the times, this is an array of 1-d vectors initialized to data[].0. |
double[] |
getTotalErrors()
Returns null. |
private String |
printModel(VectorG a)
We convert the expression parsed for printing, and during evaluate. |
protected boolean |
setModelData(VectorG[] matrix)
Sets the model data and the model index. |
protected boolean |
setModelIndex(int yi)
Sets the model data index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TIME
private VectorG[] data
private int yindex
private double yav
private ExpressionNode fit
| Constructor Detail |
|---|
public ExpressionFit.AmoebaModel(String model,
VectorG[] mag,
int y)
throws ParseException
ParseException
protected ExpressionFit.AmoebaModel(String model)
throws ParseException
setModelData(vec_math.VectorG[]) and
setModelIndex(int) before this multidimensional is used.
ParseException| Method Detail |
|---|
protected boolean setModelData(VectorG[] matrix)
setModelIndex(int), the amoeba model may be
used.
protected boolean setModelIndex(int yi)
setModelData(vec_math.VectorG[]), the amoeba model may be
used.
public int getParameterCount()
getParameterCount in interface DataModelDataModel.getModel(vec_math.VectorG).public int getMeasureCount()
getMeasureCount in interface DataModelDataModel.getModel(vec_math.VectorG).public double[] getMeasures()
getMeasures in interface DataModelpublic double[] getTotalErrors()
getTotalErrors in interface DataModelpublic double[] getMeasurementErrors()
getMeasurementErrors in interface DataModelpublic VectorG[] getTimes()
getTimes in interface DataModelDataModel.getMeasureCount().public double[] getModel(VectorG a)
getModel in interface DataModela - The model parameters
public double[] getResiduals(VectorG a)
getMeasures() and getModel(vec_math.VectorG) and returning the
difference between both.
getResiduals in interface DataModela - The model parameters, not necessarily the best fit.
private double[] getModelAtData(VectorG a)
throws ParseException
ParseException
public double evaluateModel(VectorG a,
VectorG time)
evaluateModel in interface DataModela - The model parameterstime - The (one)dimensional vector of independant variables.private String printModel(VectorG a)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||