vec_math
Class ExpressionFit

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by vec_math.AbstractFit
                  extended by vec_math.ExpressionFit
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, ModelFitting

public class ExpressionFit
extends AbstractFit

Analyses a funtion by fitting a non-linear model to it.


Nested Class Summary
protected static class ExpressionFit.AmoebaModel
          A multidimensional that evaluates a function f given as a string like
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  Amoeba crawl
          The Amoeba used for solving.
private  List<Variable> fitted
          After fitting, the parameters.
private  ExpressionFit.AmoebaModel model
          My multidimensional used for solving the crawl.
 
Fields inherited from class vec_math.AbstractFit
KEY_DEFAULTERROR, KEY_DEFAULTFORMAT, KEY_ERRORFORMAT, KEY_PARAMETERFORMAT
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
ExpressionFit(Map<String,String> prop)
           
 
Method Summary
 void estimateStart(VectorG start, double ls)
          Estimates the start for the amoeba.
 void estimateStart(VectorG start, VectorG ls)
          Estimates the start for the amoeba.
 List<Variable> fit()
          Tries to fit the measures to the underlying data model.
 DataModel getDataModel()
          Returns the data model.
 List<Variable> getFittedParameters()
          Fitted parameters.
 DataModel prepareFit(VectorG[] data)
          The data is processed by slowly fitting the amoeba to a minimum.
 double qualityOfFit()
          The simplex approximation is a chi^2, from that we get RMS.
 void setExpression(String node)
          Sets the string expression that is used to evaluate the data model.
 void setFitIndex(int i)
          Sets the data index in the amoeba model.
 
Methods inherited from class vec_math.AbstractFit
formatError, formatValue, getChi2, getModelParameterErrors, getModelParameterValues, getR2, getRms, init, setConstant, setInitialCondition
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

crawl

private Amoeba crawl
The Amoeba used for solving.


model

private ExpressionFit.AmoebaModel model
My multidimensional used for solving the crawl.


fitted

private List<Variable> fitted
After fitting, the parameters.

Constructor Detail

ExpressionFit

public ExpressionFit(Map<String,String> prop)
Method Detail

setExpression

public void setExpression(String node)
                   throws ParseException
Sets the string expression that is used to evaluate the data model. From here, some methods in the model are already accessible.

Throws:
ParseException

setFitIndex

public void setFitIndex(int i)
Sets the data index in the amoeba model.


prepareFit

public DataModel prepareFit(VectorG[] data)
The data is processed by slowly fitting the amoeba to a minimum.

Parameters:
data - An array of measurements. Each vector contains dependant and independant variables and eventually their errors.
Returns:
A Vector3D array of data.0, data.yindex, fit

fit

public List<Variable> fit()
Description copied from interface: ModelFitting
Tries to fit the measures to the underlying data model. The fitter must have been prepared with ModelFitting.prepareFit(vec_math.VectorG[]). The solution returned is also retrievable later via ModelFitting.getFittedParameters()

Returns:
Non-null, if a fit could be obtained.

getDataModel

public DataModel getDataModel()
Returns the data model.


qualityOfFit

public double qualityOfFit()
The simplex approximation is a chi^2, from that we get RMS.

Specified by:
qualityOfFit in interface ModelFitting
Overrides:
qualityOfFit in class AbstractFit

getFittedParameters

public List<Variable> getFittedParameters()
Fitted parameters.


estimateStart

public void estimateStart(VectorG start,
                          double ls)
Estimates the start for the amoeba.


estimateStart

public void estimateStart(VectorG start,
                          VectorG ls)
Estimates the start for the amoeba.