vareq: A function to return expected values of an SAT curve

Description Usage Arguments Details Value See Also Examples

Description

A function to return expected values of an SAT curve given the speficified parameter at given time points

Usage

1
2
vareq(par, lags, condition, 
  par.cond = list(asym = condition, rate = condition, incp = condition))

Arguments

par

a numeric vector of parameters that determine the shape of SAT curve. Should be ordered as follows: parameter(s) for asymptote, rate and then intercept. If there is more than one parameter in any of the three gruop, the values should be ordered within the group according to the condition to which the values belong (See Details).

lags

a numeric vector of time points at which expected values need be calculated.

condition

vector specifying condition to which the curve(s) belong. Must be the same length as length(lags).

par.cond

list or matrix, containing following named elements (in case of list) or columns (in case of matrix): asym, rate, and incp. The supplied list/matrix should specify the configuration of each parameter for different conditions speficied in condition (See 'Details'). Default to have all the parameters different for each of the conditions specified in condition|.

Details

The SAT curve in this function is given by the following equation:

d'(t) = λ (1 - exp(-β (t - δ)), for t < δ else 0

where λ serves to estimate the asymptotic level of performance, δ represent the intercept of the curve on x axes, and β indexes the rate at which curve turns to asymptote.

If there are more than one condition, then both condition and par.cond need to be specified so that values in par are applied to the equation appropriately.

The argument par.cond specifies whether or not and how certain parameter(s) are shared across conditions. The argument par.cond can take either list or matrix, as long as it meets following specification. If it is a list, then it should be a named list containing following elements: asym, rate, and incp. Each element of the list must be of same length, being equal either to length(condition) or to length(levels(condition)) (or length(unique(condition)) if condition is not a factor). If it is a matrix, then it should have asym, rate, and incp as its columns, and rows should represent different condiitons.

As an example, there are three elements in par (i.e., length(par) = 3), and there are three conditions so that the three conditions share all of λ (asymptote), β (rate) and δ (intercept). In this case, par.cond should be specified as list(asym=c(1,1,1), rate=c(1,1,1), incp=c(1,1,1)).

As another example, there are six elements in par, consisting of three λ (asymptote; one for each condition) , two β (rate; one for condition 1 and anothor for condition 2 and 3), and one δ (intercept; for all the conditions). Here, par.cond = list(asym=c(1,2,3), rate=c(1,2,2), incp=c(1,1,1))

Value

a numeric vector of length equal to length(lags). The values represent the expected values at time points specified in lags, given the curves speficied with the parameter in par.

See Also

fit.SATcurve

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#3 conditions, 10 time points from 0.1 to 5
my.cond <- rep(1:3, each=10)
my.lags <- rep(seq(0.1,5, length.out=10), 3)

#some random parameters with 6 elewments for the purpose of demo
my.par <- c(4, 3, 2, 2, 2, 1)

#par.cond configuration according to the second example in the 'Detail'
my.pc <- list(asym=c(1,2,3), rate=c(1,2,2), incp=c(1,1,1))

#then get the expected value

vareq(par=my.par, lags = my.lags, condition = my.cond, par.cond=my.pc)

matsukik/mrsat documentation built on May 21, 2019, 12:57 p.m.