dat-class {TIMP} | R Documentation |
dat
is the super-class of other classes representing models and data, so
that other model/data classes (e.g., kin
and spec
for kinetic and spectral
models respectively) also have the slots defined here. These slots may
be specified in the ...
argument of the initModel
function; note that
slots that are usual for a user to input have descriptions prefaced by a star
(*) below.
Objects can be created by calls of the form new("dat", ...)
or
dat(...)
, but
most are most often made by invoking another function such as
readData
or initModel
.
psi.df
:"matrix"
dataset from 1 experimentpsi.weight
:"matrix"
weighted dataset from 1 experimentx
:"vector"
time or other independent
variable. nt
:"integer"
length x
x2
:"vector"
vector of points in
2nd independent dimension, such as wavelengths of wavenumbersnl
:"integer"
length x2
C2
:"matrix"
concentration matrix for
simulated dataE2
:"matrix"
matrix of spectra for
simulated datasigma
:"numeric"
noise level in
simulated data mod_type
:"character"
character string defining the model type, e.g.,
"kin"
or "spec"
parnames
:"vector"
vector of
parameter names, used internallyfinished
:"logical"
describes
whether optimization is completesimdata
:"logical"
* logical that is TRUE
if the data is simulated,
FALSE
otherwise; will determine whether values in C2
and
E2
are plotted with resultsweightpar
:"list"
* list of vectors
c(first_x, last_x, first_x2, last_x2, weight)
,
where each vector is of length 5 and
specifies an interval in which to weight the data.
x
to weightx
to weightx2
to weightx2
to weight
Note that if vector elements 1-4 are NA
(not a number), the firstmost
point of the data is taken for elements 1 and 3, and the lastmost points
are taken for 2 and 4.
For example, weight_par = list(c(40, 1500, 400, 600, .9),
c(NA, NA, 700, 800, .1))
will weight data between times 40 and 1500
picoseconds and 700 and 800 wavelengths by .9, and will weight data at
all times between wavelength 700 and 800 by .1.
Note also that for single photon counting data
weightpar = list(poisson = TRUE)
will apply poisson weighting to all
non-zero elements of the data.
weight
:"logical"
TRUE
when the specification in
weightpar
is to be applied and FALSE
otherwiseweightM
:"matrix"
weights weightsmooth
:"list"
type of smoothing to apply with weighting; not currently
usedfixed
:"list"
list of lists or vectors giving the parameter values
to fix (at their starting values) during optimization. clp0
:"list"
list of lists with elements low
, high
and
comp
, specifying the least value in x2
to constrain
to zero, the greatest value in x2
to
constrain to zero, and the component to which to apply the zero constraint,
respectively. e.g., clp0 = list(list(low=400, high = 600, comp=2),
list(low = 600, high = 650, comp=4))
applies zero constraints to the spectra
associated with components 2 and 4.makeps
:"character"
specifyies the prefix of files written to
postscript
clpequspec
:"list"
list of lists each of which has elements to,
from, low, high
, and optional element dataset
to specify the dataset
from which to get the reference clp (that is, a spectrum for kinetic
models). to
is the component to be fixed in relation to some other
component; from is the reference component. low
and high
are the
least and greatest absolute values of the clp
vector to constrain.
e.g.,
clpequspec = list(list(low = 400, high = 600, to = 1, from = 2))
will constrain the first component to equality to the second component
between wavelengths 400 and 600. lclp0
:"logical"
TRUE
if specification in clp0
is to be applied and FALSE
otherwise lclpequ
:"logical"
TRUE
if specification in clpequspec
is to be applied and FALSE
otherwisetitle
:"character"
displayed on output plotsmhist
:"list"
list describing fitting historydatCall
:"list"
list of calls to functionsdscalspec
:"list"
drel
:"vector"
vector of starting parameters for dataset scaling relationsclpequ
:"vector"
describes the clp
equality constraints for internal usescalx
:"numeric"
numeric by which to scale the x
axis in plottingprel
:"vector"
vector of starting values for the relations described in
prelspecprelspec
:"list"
list of lists to specify the functional
relationship between parameters, each of which has elements
"kinpar"
what1
what1
what2
e.g.,
prelspec = list(list(what1 = "kinpar", what2 = "kinpar", ind1 = 1,
ind2 = 5))
relates the 1st element of kinpar
to the 5th element of
kinpar
. The starting values parameterizing the relationship are
given in the prel
vector
fvecind
:"vector"
vector containing indices of fixed parameterspvecind
:"vector"
used internally to
store indices of related parameters. groups
:"list"
list containing lists of pairs c(x2 index, dataset index).
the x2
values (which are solved for as conditionally linear
parameters) are equated for all pairs in a list.iter
:"numeric"
describing the
number of iterations that is run; this is sometimes
stored after fitting, but has not effect as an argument to
initModel
clpCon
:"list"
used internally to enforce constraints on the clpncomp
:"numeric"
describing the number of components in a modelclpdep
:"logical"
describing whether a model is dependent on the index
of x2
inten
:"matrix"
for use with FLIM data; represents the number of photons
per pixel measured over the course of all
times $t$ represented by the dataset. See the help for the readData
function for more information. positivepar
:"vector"
containing
character strings of those parameter vectors to constrain to positivity,
e.g., positivepar=c("kinpar")
Katharine M. Mullen, Ivo H. M. van Stokkum
# simulate data C <- matrix(nrow = 51, ncol = 2) k <- c(.5, 1) t <- seq(0, 2, by = 2/50) C[, 1] <- exp( - k[1] * t) C[, 2] <- exp( - k[2] * t) E <- matrix(nrow = 51, ncol = 2) wavenum <- seq(18000, 28000, by=200) location <- c(25000, 20000) delta <- c(5000, 7000) amp <- c(1, 2) E[, 1] <- amp[1] * exp( - log(2) * (2 * (wavenum - location[1])/delta[1])^2) E[, 2] <- amp[2] * exp( - log(2) * (2 * (wavenum - location[2])/delta[2])^2) sigma <- .001 Psi_q <- C # initialize an object of class dat Psi_q_data <- dat(psi.df = Psi_q, x = t, nt = length(t), x2 = wavenum, nl = length(wavenum)) # initialize an object of class dat via initModel # this dat object is also a kin object kinetic_model <- initModel(mod_type = "kin", seqmod = FALSE, kinpar = c(.1, 2))