FLModel-class: Class FLModel for statistical models

Description Slots Extends Constructor Methods Author(s) See Also Examples

Description

The FLModel class provides a virtual class that developers of various statistical models can use to implement classes that allow those models to be tested, fitted and presented.

Slots in this class attempt to map all the usual outputs for a modelling exercise, together with the standard inputs. Input data is stored in slots created by each of those classes based on FLModel.See, for example FLSR for a class used for stock-recruitment models.

Various fitting algorithms, similar to those present in the basic R packages are currently available for FLModel, including fmle, nls-FLCore and glm.

Slots

name

Name of the object. character.

desc

Description of the object. character.

range

Range. numeric.

fitted

Estimated values for rec. FLQuant.

residuals

Residuals obtained from the model fit. FLQuant.

model

Model formula. formula.

gr

Function returning the gradient of the likelihood. function.

logl

Log-likelihood function. function.

initial

Function returning initial parameter values for the optimizer, as an object of class FLPar. function.

params

Estimated parameter values. FLPar.

logLik

Value of the log-likelihood. logLik.

vcov

Variance-covariance matrix. array.

hessian

Hessian matrix obtained from the parameter fitting. array.

details

extra information on the model fit procedure. list.

Extends

FLComp

Constructor

Constructor method for objects of class FLModel. This method is to be called by the constructor methods of classes extending FLModel.

An argument class instructs the constructor about the exact class of the returned object. Constructor methods for FLModel-based class should simply invoke this method with the appropriate class argument (See example below).

signature(object=formula) :

First argument is a formula describing the model, to be placed in the model slot.

signature(object=missing) :

Arguments, if given, are parsed and allocated by name to a iven slot. If none if provided, and empty FLModel object is returned.

signature(object=function) :

A function returning a list with names equal to one or more of the slots in the class is called, and elements in that list are allocated by name. See SRModels for uses of this mechanism

signature(object=character) :

A function with his name is called, as above.

Methods

AIC(stats) :

Describe method

signature(object=FLModel,k=numeric)

AIC(stats) :

Describe method

signature(object=FLModel,k=missing)

BIC(stats) :

Describe method

signature(object=missing)

fmle(FLCore) :

Describe method

signature(object=missing,start=missing)

nls(stats) :

Describe method

signature(formula=FLModel,data=missing,start=missing,control=missing,algorithm=missing,trace=missing,subset=missing,weights=missing,na.action=missing,model=missing,lower=missing,upper=missing)

Author(s)

The FLR Team

See Also

AIC, BIC, fmle, nls, FLComp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Normally, FLModel objects won't be created, as class lacks input slots
summary(FLModel(length~width*alpha))

# Objects of FLModel-based classes use their own constructor,
# which internally calls FLModel
fsr <- FLModel(rec~ssb*a, class='FLSR')
is(fsr)
summary(fsr)

# An example constructor method for an FLModel-based class
# create FLGrowth class with a single new slot, 'mass'
setClass('FLGrowth', representation("FLModel",
  mass='FLArray'))

# define creator method, based on FLModel()
setGeneric('FLGrowth', function(object, ...)
		standardGeneric('FLGrowth'))
setMethod('FLGrowth', signature(object='ANY'),
  function(object, ...)
    FLModel(object, class='FLGrowth', ...))

FLCore documentation built on May 2, 2019, 5:46 p.m.