fitslikDT: Maximum likelihood fits for psychometric functions

Description Usage Arguments Value

View source: R/nlregVL.R

Description

Maximum likelihood fits for psychometric functions

Usage

1
2
3
4
fitslikDT(dataF, cD, cNbS, cNbL, cBy, type = "CG", getPred, loglikfn,
  loglikgr, loglikgr2, fnStart, method = "BFGS", maxN = 100,
  parstart.allow = F, allow.print = F, ctrlL = list(fnscale = -1, reltol =
  .Machine$double.eps))

Arguments

dataF

The data table containing the data to be fitted

cD

name (or position) of the column containing the x-axis data. In the case of a temporal bisection task, this corresponds to the name (or position) of the column containing the duration.

cNbS

name (or position) of the column containing the number of "short" responses.

cBy

name (or position) of the column(s) to group by. If left empty, it will take all other columns.

type

string expliciting which of three available fitting functions will be used. "CG" for cumulative Gaussian, "LN" for lognormal and "PL" for pseudologistic.

getPred

Function that returns the predicted value.

loglikfn

Only used if type is not specified. A function that computes the loglikelihood. It must take the following arguments: par (a vector of numerical values), Dur (a vector of durations), NbS (vector of the number of short respnses), NbL (vector of the number of short respnses). It must return a numerical vector of size 1.

loglikgr

Only used if type is not specified. A function that computes the gradient of the loglikelihood. It must take the following arguments: par (a vector of numerical values), Dur (a vector of durations), NbS (vector of the number of short respnses), NbL (vector of the number of short respnses). It must return a numerical vector of the same size as par.

loglikgr2

Only used if type is not specified. A function that computes the second order gradient of the loglikelihood. It must take the following arguments: par (a vector of numerical values), Dur (a vector of durations), NbS (vector of the number of short respnses), NbL (vector of the number of short respnses). It must return a numerical vector of the same size as par.

fnStart

A function that calculates the starting values for the fitting process. It must take a single argument (Dur).

method

See optim

maxN

Maximum number of iterations.

parstart.allow

If the starting parameters are bad, allows the algorithm to find new ones.

allow.print

Allows the printing of the number of iterations of the fits.

ctrlL

control list for optim. See optim

Value

A data.table containing the parameter estimates, the standard error of those estimates, the log likelihood as well as an information code (see optim)


VinLaflamme/nlregVL documentation built on May 30, 2019, 2:04 a.m.