Learn R Programming

Dark (version 0.9.9)

ModelSelect: ModelSelect

Description

Returns a list with two elements; an array of AICc scores indexed by the number of parameters in the model considered and a matrix of parameters with three rows, one for each model.

Usage

ModelSelect(obj, P)

Value

Returns a list

AIC

An array of seven values with AIC scores at the index of model parameter count.

param

A three row by seven column matrix. Each row containing the optimised parameters for each model.

Arguments

obj

A 'dark' object.

P

Is a matrix with seven columns and at least one row. The values of each element can be zero.

Author

Jeremiah MF Kelly

Mumac Ltd, SK7 6NR, GB

Details

This is a brute-force method to make a first estimate of the optimal model parameters.

The matrix 'P' holds rows of possible parameter values. Each row is passed to the 3, 5, and 7 parameter models and the sum of residuals squared is calculated for the given times (obj$time) and thresholds (obj$thrs). So for each row in 'P' there is a score for each model. Then for each model the row which yields the lowest SSE is chosen as a starting point for optimisation. The optimised parameters are stored in 'param' and once the three parameter arrays have been found their AICc scores are found and returned as AIC.

References

https://en.wikipedia.org/wiki/Brute-force_search

Examples

Run this code
set.seed(1234)
tmp<- TestData(0:20)
P<-Start(tmp)
ModelSelect(tmp,P)

Run the code above in your browser using DataLab