Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

initModel

Defines the model to be used in analysis.


Description

Allows definition of a model of class "dat" to be used in analysis. The arguments specify the model.

Usage

initModel(...)

Arguments

...

specify the model class via the character string e.g., kin-class or spec and any of the slots associated with that model type (which is a subclass of class dat, so that all slots in dat may also be specified), e.g., mod_type = "kin" will initialize a model with class kin, for a kinetic model.

Details

For examples, see the help files for dat-class and fitModel

Value

an object of class dat with the sub-class given by the value of the mod_type input.

Author(s)

Katharine M. Mullen, Ivo H. M. van Stokkum

See Also

Examples

##############################
## READ IN PSI 1
##############################

data(denS4)

##############################
## PREPROCESS PSI 1
##############################

denS4<-preProcess(data = denS4, scalx2 = c(3.78, 643.5))

##############################
## READ IN PSI 2
##############################

data(denS5)

##############################
## PREPROCESS PSI 2
##############################

denS5<-preProcess(data = denS5, scalx2 = c(3.78, 643.5))

##############################
## DEFINE INITIAL MODEL
##############################

model1<- initModel(mod_type = "kin", 
kinpar= c(7.9, 1.08, 0.129, .0225, .00156) , 
irfpar=c( -.1018, 0.0434), 
disptau=FALSE, dispmu=TRUE, parmu = list(c(.230)), 
lambdac = 650,
seqmod=TRUE,
positivepar=c("kinpar"),
title="S4", 
cohspec = list( type = "irf"))

## Not run: 

##############################
## FIT INITIAL MODEL
##############################

denRes1 <- fitModel(data=list(denS4, denS5), list(model1), 
opt=kinopt(iter=5, divdrel = TRUE, linrange = .2,
makeps = "den1", selectedtraces = c(1,5,10), plotkinspec =TRUE,
output="pdf", xlab = "time (ps)", ylab = "wavelength"))

##############################
## REFINE INITIAL MODEL, RE-FIT
## adding some per-dataset parameters 
##############################

denRes2 <- fitModel(data = list(denS4, denS5), modspec = list(model1),
modeldiffs = list(dscal = list(list(to=2,from=1,value=.457)), 
free = list(
list(what = "irfpar", ind = 1, dataset = 2, start=-.1932),
list(what = "kinpar", ind = 5, dataset = 2, start=.0004), 
list(what = "kinpar", ind = 4, dataset = 2, start= .0159)
)),
opt=kinopt(iter=5, divdrel = TRUE, linrange = .2,
xlab = "time (ps)", ylab = "wavelength", output="pdf",
makeps = "den2", selectedtraces = c(1,5,10)))

##############################
## REFINE MODEL FURTHER AS NEW MODEL OBJECT 
##############################

model2 <- initModel(mod_type = "kin", 
kinpar= c(7.9, 1.08, 0.129, .0225, .00156), 
irfpar=c( -.1018, 0.0434), 
parmu = list(c(.230)), 
lambdac = 650,
positivepar=c("kinpar", "coh"), 
cohspec = list( type = "seq", start = c(8000, 1800)))

##############################
## FIT NEW MODEL OBJECT
##############################

denRes3 <- fitModel(data = list(denS4, denS5), list(model2),
modeldiffs = list(dscal = list(list(to=2,from=1,value=.457)), 
free = list(
list(what = "irfpar", ind = 1, dataset = 2, start=-.1932),
list(what = "kinpar", ind = 5, dataset = 2, start=.0004), 
list(what = "kinpar", ind = 4, dataset = 2, start= .0159)
)),
opt=kinopt(iter=5, divdrel = TRUE, linrange = .2,
makeps = "den3", selectedtraces = c(1,5,10), plotkinspec =TRUE, 
stderrclp = TRUE, kinspecerr=TRUE, output="pdf",
xlab = "time (ps)", ylab = "wavelength", 
breakdown = list(plot=c(643.50, 658.62, 677.5))))

## End(Not run)

TIMP

Fitting Separable Nonlinear Models in Spectroscopy and Microscopy

v1.13.2
GPL (>= 2)
Authors
Katharine M. Mullen, Joris J. Snellenburg, Sergey P. Laptenok, David Nicolaides, Ivo H.M. van Stokkum
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.