fitModel {arf3DS4} | R Documentation

## Fit an ARF model.

### Description

fitModel performs the fit-procedure of an ARF model to the data. It uses the values in the `options` object to modify the behavior of the fit-procedure. By default `optim` (L-BFGS-B) is used for minimization. fitModel is a wrapper for `fitModelOptim` and `fitSimpleModelOptim`

### Usage

    fitModel(arfmodel, options = loadOptions(arfmodel),
     dat = readData(.model.avgdatfile(arfmodel)),
     weights = readData(.model.avgWfile(arfmodel)),
     printlevel = 0, try.silen = T)
    fitModelOptim(arfmodel, options = loadOptions(arfmodel),
     dat = readData(.model.avgdatfile(arfmodel)),
     weights = readData(.model.avgWfile(arfmodel)),
     printlevel = 0, try.silen = T)
    fitSimpleModelOptim(arfmodel, options = loadOptions(arfmodel),
     dat = readData(.model.avgdatfile(arfmodel)),
     weights = readData(.model.avgWfile(arfmodel)),
     printlevel = 0, try.silen = T)

### Arguments

`arfmodel` | An arf model object (class `model`)
`options` | An "options" object (class `options`).The `options@start.method` slot is used to determine which method to use for starting values. The `arfmodel@modeltype` slot is used to determine whether to fit a full Gaussian model (default) or a simple Gaussian model (with fixed width parameters).
`dat` | An object of class "fmri.data" (`fmri.data` containing the averaged beta-values.)
`weights` | An object of class "fmri.data" (`fmri.data` containing the averaged weights of the beta-values.)
`printlevel` | Number indicating the level of output of the minimization procedure.
`try.silen` | Should errors be printed when they occur or only passed to the `warnings` slot.

### Details

fitModel calls one of the following functions based on the "options" object: `fitModelOptim`, `fitSimpleModelOptim`. These functions can also be called directly. Models can be created by calling `newModel`.

### Value

Returns an object of class "model" with the appropriate slots.

### Author(s)

Wouter D. Weeda - w.d.weeda@gmail.com

### See Also

`model`, `options`, `fmri.data`, `newModel`

[Package arf3DS4 version 2.5-10 Index]