Learn R Programming

Dark (version 0.9.9)

P6c: A six parameter model

Description

An exponential decay followed by a second exponential decay.

Usage

P6c(a, X)

Value

The output depends upon the input. If the input is an array of length 1L or a boolean then a list is returned

Pn

number of parameters

Mod

name of the model

If a parameter array is passed then the sum of residuals squared is calculated. This is used by optim to optimise the parameter estimates.

Passing a parameter array and a series of putative times causes the function to return predicted thresholds.

Arguments

a

An array of parameters;

a:parameterUnits
a[1]:absolute (rod) threshold
(log lum)a[2]:cone coefficient
(log10 lum)a[3]:1/cone time constant
(1/minutes)a[4]:alpha point
(minutes)a[5]:absolute threshold offset
(log10 lum)a[6]:1/rod time constant

note that the cone threshold is a[1] + a[5] log10(lum)

X

The times in minutes when the model predicts thresholds.

Author

Jeremiah MF Kelly

Mumac Ltd, SK7 6NR, GB

Details

This function has three roles, to calculate the thresholds for given parameters a and times X. If missing X, then the function calls the values x and y from the .Globalenv and calculates the sum of residuals squared error (SSE) for a. If a is an array of length 1L or boolean then a description of the model is returned.

The use of the function H rather than an impulse function gives a three-fold increase is speed for the optim function.

References

O. Mahroo and T. Lamb. Recovery of the human photopic electroretinogram after bleaching exposures: estimation of pigment regeneration kinetics. The Journal of Physiology, 554(2):417, 2004.

T. Lamb and E. Pugh. Dark adaptation and the retinoid cycle of vision. Progress in Retinal and Eye Research, 23(3):307-380, 2004.

See Also

P3,P5c,P6c

Examples

Run this code
set.seed(1234)
x <- 0:20
a <- c(-2, 2, 1/2, 10, 3, 1/8)

# P6c(TRUE)
# Describes the model

# P6c(a)
# The sum of squared residuals

# P6c(a,x)
# The fitted thresholds for given parameters 'a' and times 'x'

Run the code above in your browser using DataLab