BestFit

Description

This script takes a dark object, a list of parameters and AICc scores from ModelSelect to chose a model and then return optimised values for the parameter estimates. Analysis of the data can be halted here if wished.

However, a MultiStart check can be useful if it is suspected that a local minimum has been found. Furthermore, BootDark will provide confidence intervals for the parameter estimates.

Usage

1
BestFit(obj, MSC, draw)

Arguments

obj

A dark object

MSC

A list from the function ModelSelect

draw

A flag to indicate whether a figure should be drawn.

Value

A list with the following elements:

call

the last function call on the data

time

time of observations

thrs

thresholds

resid

residuals of best model fit

fit

fitted thresholds for the optimal model and parameters

thet

seed parameters of TestData, null if not TestData

sse

sum of squared error used in TestData

val

calculated sum of squared errors

data

source of the data

opt

optimal parameter estimates

Mod

optimal model

Pn

number of parameters required by the model to fit the data

AIC

AICc scores for the three models fitted

R2

an indication of the 'goodness' of fit

Note

This function makes extensive use of optim.

Author(s)

Jeremiah MF Kelly

Faculty of Life Sciences, The University of Manchester, M13 9PL, UK

See Also

optim

Examples

1
2
3
4
tmp <- TestData(0:20)
P<-Start(tmp,100)
MSC<-ModelSelect(tmp, P)
BestFit(tmp, MSC)