Learn R Programming

TIMP (version 1.5)

fitModel: Performs optimization of (possibly multidataset) models.

Description

Performs optimization of (possibly multidataset) models and outputs plots and files representing the fit of the model to the data.

Usage

fitModel(data, modspec=list(), datasetind = vector(), modeldiffs = list(), 
		opt = opt() )

Arguments

data
list of objects of class dat containing the data to be modeled
modspec
list whose elements are models of class dat describing the models as results from a call to the function initModel
datasetind
vector that has the same length as data; for each dataset in data specify the model it should have as an index into modspec; default mapping is that all datasets use the first model given in modspec
modeldiffs
list whose elements specify any dataset-specific model differences.
  • linkclp
{list of vectors containing the indices of datasets. If the two dataset indices are in the same vector, their conditionally linear parameters will be
add
list of lists specifying individual parameters to add to parameter groups for a given dataset. each sublist has named elements
  • what
{character string naming parameter type, e.g., "kinpar"} dataset{dataset index i

Value

  • A list is returned containing the following elements:
    • currTheta
    {is a list of objects of class theta whose elements contain the parameter estimates associated with each dataset modeled.}
  • currModelis an object of class multimodel containing the results of fitting as well as the model specification
  • toPlotteris a list containing all arguments used by the plotting function; it is used to regenerate plots and other output by the examineFit function

item

  • change
  • dataset
  • spec
  • rel
  • what2
  • ind1
  • ind2
  • dataset1
  • dataset2
  • rel
  • start
  • weightlist
  • opt

itemize

  • what1

code

specopt

Details

This function applies the nls function internally to optimize nonlinear parameters and to solve for conditionally linear parameters (clp) via the partitioned variable projection algorithm.

References

Mullen KM, van Stokkum IHM (2007). ``TIMP: an R package for modeling multi-way spectroscopic measurements.'' Journal of Statistical Software, 18(3). http://www.jstatsoft.org/v18/i03/.

See Also

readData, initModel, examineFit