tadaAICtable: Fit a set of TADA models for multi-model inference

Description Usage Arguments Details Value print(tadaAICtable) components tadaAICtable components See Also

View source: R/tadaAICtable.R

Description

tadaAICtable takes diffusion data in the form of an nbdaData object (nbdaData) or (dTADAData) or a list of nbdaData/ dTADAData objects (for multiple diffusions). It then fits a set of models using tadaFit and return them in an object of class tadaAICtable. Arguments not listed below are used internally by combineTadaAICtables when making calls to tadaAICtable and can be ignored by the user.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
tadaAICtable(nbdadata, constraintsVectMatrix, typeVect = NULL,
  baselineVect = NULL, offsetVectMatrix = NULL, cores = 1,
  modelsPerCorePerSet = NULL, writeProgressFile = F,
  statusBar = NULL, noHazFunctParsCustom = NULL,
  hazFunct = function() return(NULL), cumHaz = function() return(NULL),
  startValue = NULL, method = "nlminb", gradient = T,
  iterations = 150, aicUse = "aicc", lowerList = NULL,
  combineTables = F, MLEs = NULL, SEs = NULL, MLEilv = NULL,
  SEilv = NULL, MLEint = NULL, SEint = NULL, MLEhaz = NULL,
  SEhaz = NULL, convergence = NULL, loglik = NULL, aic = NULL,
  aicc = NULL, netComboModifierVect = "")

Arguments

nbdadata

an object of class (nbdaData) or (dTADAData) to fit models to a single diffusion or a list of nbdaData/dTADAData objects to fit a model to multiple diffusions.

constraintsVectMatrix

a numerical matrix specifying the constraints, with each row specifiying a model to be fitted. The number of columns is equal to the number of parameters in the (nbdaData) or (dTADAData) object(s) input to argument nbdadata. Each row then specifies the constraintsVect to be passed to the constrainedNBDAdata when creating the data object(s) to which that model is fitted.

typeVect

optional character vector specifying if each model is "asocial" or "social". However, it is not usually necessary to specify, since models with all s parameters constrained =0 are automatically classified as "asocial", and others are assumed to be "social".

baselineVect

optional character vector specifying the baseline function for each model (see tadaFit).

offsetVectMatrix

an optional numerical matrix specifying the offsets, with each row specifiying the offsets for each model to be fitted. The number of columns is equal to the number of parameters in the (nbdaData) or (dTADAData) object(s) input to argument nbdadata. Each row then specifies the offsetVect to be passed to the constrainedNBDAdata when creating the data object(s) to which that model is fitted.

cores

numerical giving the number of computer cores to be used in parallel to fit the models in the set, thus speeding up the process. By default set to 1. For a standard desktop computer at the time of writing 4-6 is advised.

modelsPerCorePerSet

optional numerical. If specified the models can be fit in sets, and a progress file written after each set is completed. This means progress is not completely lost in the case of a crash/ powercut etc. For example, if we have 400 models, we can specify cores=4 and modelsPerCorePerSet=10. This means 10 models are fitted on each core, then progress is saved with the first 40 models, then the next 40 and so on.

writeProgressFile

logical. If set to T, a file is written to the working directory when each set of models have been completed with the tadaAICtable for the models fitted so far. In the event of a crash, the remining models can be fitted as a separate set, then combined using combineTadaAICtables.

statusBar

optional logical. Status bar only works when cores=1.

noHazFunctParsCustom

optional numerical necessary if "custom" is specified for any models in baselineVect. See tadaFit for details.

hazFunct

optional function necessary if "custom" is specified for any models in baselineVect. See tadaFit for details.

cumHaz

optional function necessary if "custom" is specified for any models in baselineVect. See tadaFit for details.

startValue

optional numeric vector giving start values for the maximum likelihood optimization. Length to match the number of parameters fitted in the full model.

method

optional character string passed to tadaFit.

gradient

optional logical passed to tadaFit.

iterations

optional numerical passed to tadaFit.

aicUse

string specifying whether to use "aicc" or "aic".

lowerList

optional numeric matrix giving lower values for the maximum likelihood optimization for each model. Columns to match the number of parameters fitted in the full model, rows matched to the number of models. Can be used if some models have convergence problems or trigger errors.

combineTables

logical used internally by combineTadaAICtables when making calls to tadaAICtable.

upperList

optional numeric matrix giving upper values for the maximum likelihood optimization for each model. Columns to match the number of parameters fitted in the full model, rows matched to the number of models. Can be used if some models have convergence problems or trigger errors.

Details

Each row of constraintsVectMatrix, offsetVectMatrix, and baselineVect determines a model to be fitted. For each row, constrained nbdaData objects are created using (constrainedNBDAdata) with constraintsVect=constraintsVectMatrix[i,] and offsetVect=offsetVectMatrix[i,]. A model is then fitted to the nbdaData object(s) using tadaFit with a baseline determined by offsetVect=baselineVect[i].

Value

An object of class tadaAICtable.

print(tadaAICtable) components

A data.frame giving a summary of models ordered by AIC can be obtained using print(<name of tadaAICtable>). This has the following columns, listed in order:

model

Model number, i.e. the row of constraintsVectMatrix used to generate the model.

type

Type of model. noILVs, additive (ILV effects on asocial learning only), multiplicative (all ILVs have same effect on asocial and social learning), unconstrained (differing effects on asocial and social learning for at least one ILV), asocial

netcombo

A representaion of the network effects present in the model, i.e. the constraints on the s parameters. See constrainedNBDAdata.

baseline

The baseline function used for each model.

CONS.

The constraint on each parameter, as taken from constraintsVectMatrix

OFF

The offset on each parameter, as taken from offsetVectMatrix

convergence

Was convergence reported by the optimization algorithm?

loglik

-log-likelihood for the model.

s...

Maximum likelihood estimates for s parameters.

ASOCIAL...

Maximum likelihood estimates for effects of ILVs on asocial learning.

SOCIAL...

Maximum likelihood estimates for effects of ILVs on social learning.

ASOCIAL:SOCIAL...

Maximum likelihood estimates for multiplicative effects of ILVs see tadaFit.

SE...

Standard errors for each parameter, set to 0 when a parameter was constrained. See tadaFit.

aic

AIC for the model.

aicc

AICc for the model.

deltaAICc

Difference in AICc or AIC from the best model.

RelSupport

Relative support for the model compared to the best model, calculated as exp(-0.5*deltaAICc).

AkaikeWeight

Akaike weight for the model. Can be interpretted as the probability that model has the highest predictive power (K-L information) out of the set of models considered.

tadaAICtable components

@nbdadata

The unconstrained data the model is fitted to, as a list of nbdaData objects.

@convergence

Was convergence reported by the optimization algorithm? (Ordered by constraintsVectMatrix).

@logLik

-log-likeihood for models (ordered by constraintsVectMatrix).

@aicc

AICc for models (ordered by constraintsVectMatrix).

@aic

AIC for models (ordered by constraintsVectMatrix).

@constraintsVectMatrix

constraintsVectMatrix input to the function.

@offsetVectMatrix

offsetVectMatrix input to the function.

@MLEs

Maximum likelihood estimates for s parameters (ordered by constraintsVectMatrix).

@SEs

Standard errors for s parameters (ordered by constraintsVectMatrix).

@MLEilv

Maximum likelihood estimates for effect of ILs on asocial learning (ordered by constraintsVectMatrix).

@SEilv

Standard errors for effect of ILs on asocial learning (ordered by constraintsVectMatrix).

@MLEint

Maximum likelihood estimates for effect of ILs on social learning (ordered by constraintsVectMatrix).

@SEint

Standard errors for effect of ILs on social learning (ordered by constraintsVectMatrix).

@MLEhaz

Maximum likelihood estimates for baseline rate/hazard function (ordered by constraintsVectMatrix).

@SEhaz

Standard errors for baseline rate/hazard function (ordered by constraintsVectMatrix).

@typeVect

Type of models (ordered by constraintsVectMatrix).

@baselineVect

The baseline function used for each model. (ordered by constraintsVectMatrix).

@deltaAICc

Difference in AICc or AIC from the best model. (ordered by constraintsVectMatrix).

@RelSupport

Relative support for the model compared to the best model, calculated as exp(-0.5*deltaAICc). (ordered by constraintsVectMatrix).

@RelSupport

Akaike weight for the model. (ordered by constraintsVectMatrix).

@printTable

data.frame to be output by the print method for tadaAICtable (see above).

See Also

networksSupport, typeByNetworksSupport, modelAverageEstimates, variableSupport, unconditionalStdErr,baselineSupport, combineTadaAICtables. For OADA models use oadaAICtable.


whoppitt/NBDA documentation built on April 25, 2021, 7:55 a.m.