Title: | Brownian Motion Processes for 'nlme'-Models |
Version: | 0.1.0 |
Description: | Allows Brownian motion, fractional Brownian motion, and integrated Ornstein-Uhlenbeck process components to be added to linear and non-linear mixed effects models using the structures and methods of the 'nlme' package. |
Depends: | nlme (≥ 3.0) |
Imports: | stats |
License: | GPL-3 |
NeedsCompilation: | yes |
LazyData: | true |
Packaged: | 2015-10-14 15:40:55 UTC; rmjlots |
Author: | Oliver Stirrup [aut, cre] |
Maintainer: | Oliver Stirrup <oliverstirrup@googlemail.com> |
Repository: | CRAN |
Date/Publication: | 2015-10-14 18:13:24 |
covBM
Description
This is a constructor function for the "covBM" class, representing a Brownian motion
component in terms of a continuous variable. The object created is a special type of
corStruct
.
covBM
Usage
covBM(value = 1, form = ~1)
Arguments
value |
Numeric argument providing starting value for the scale parameter of Brownian motion process relative to residual error variance for optimisation. |
form |
A one-sided formula of the form ~t|g, where t represents a continuous variable (usually time) and g represents a grouping factor, i.e. with a separate Brownian motion process modelled at each level. |
Value
An object of class "covBM" and inheriting from "corStruct".
Examples
cov1<-covBM(form=~time|group)
Serial CD4 counts in children with HIV.
Description
Dataset used in Data Analysis Using Regression and Multilevel/Hierarchical Models by Andrew Gelman and Jennifer Hill (Cambridge University Press, 2006). Rows with missing values of 'CD4CNT', 'visage' or 'baseage' have been removed.
Usage
cd4
Format
A data frame with 976 rows and 11 variables:
- newpid
Patient ID code.
- t
Time, in years from first visit.
- sqrtcd4
Square root of CD4 count.
- treatmnt
Indicator variable for treatment, 1 represents control group and 2 indicates zinc treatment group.
- CD4CNT
CD4 count on original (untransformed) scale.
- baseage
Age of child in years at initial visit.
- visage
Age of child in years at given visit.
Source
http://www.stat.columbia.edu/~gelman/arm/examples/cd4/
coef.covBM
Description
This is a method function that extracts the scale coefficient associated with a Brownian motion correlation structure object.
Usage
## S3 method for class 'covBM'
coef(object, unconstrained = TRUE, ...)
Arguments
object |
|
unconstrained |
A logical value. If TRUE the coefficients are returned in unconstrained form (as used in the optimization algorithm). If FALSE the coefficients are returned in "natural" form. |
... |
Additional arguments (not used by this method). |
Examples
cov1<-covBM(form=~time|group)
coef(cov1)
coef.covFracBM
Description
This is a method function that extracts the scale coefficient and Hurst parameter associated with a fractional Brownian motion correlation structure object.
Usage
## S3 method for class 'covFracBM'
coef(object, unconstrained = TRUE, ...)
Arguments
object |
|
unconstrained |
A logical value. If TRUE the coefficients are returned in unconstrained form (as used in the optimization algorithm). If FALSE the coefficients are returned in "natural" form. |
... |
Additional arguments (not used by this method). |
Examples
cov2<-covFracBM(form=~time|group)
coef(cov2)
coef.covIOU
Description
This is a method function that extracts the perturbation and Alpha parameters associated with an integrated Ornstein-Uhlenbeck (IOU) process correlation structure object.
Usage
## S3 method for class 'covIOU'
coef(object, unconstrained = TRUE, ...)
Arguments
object |
|
unconstrained |
A logical value. If TRUE the coefficients are returned in unconstrained form (as used in the optimization algorithm). If FALSE the coefficients are returned in "natural" form. |
... |
Additional arguments (not used by this method). |
Examples
cov3<-covIOU(form=~time|group)
coef(cov3)
corMatrix.covBM
Description
This method generates a scaled covariance matrix (or list of matrices), for a "covBM" "corStruct" object.
Usage
## S3 method for class 'covBM'
corMatrix(object, covariate = getCovariate(object), ...)
Arguments
object |
|
covariate |
List of covariate vectors, at which values the correlation matrix,
or list of correlation matrices, are to be evaluated, as for |
... |
Additional arguments (not used by this method). |
corMatrix.covFracBM
Description
This method generates a scaled covariance matrix (or list of matrices), for a "covFracBM" "corStruct" object.
Usage
## S3 method for class 'covFracBM'
corMatrix(object, covariate = getCovariate(object), ...)
Arguments
object |
|
covariate |
List of covariate vectors, at which values the correlation matrix,
or list of correlation matrices, are to be evaluated, as for |
... |
Additional arguments (not used by this method). |
corMatrix.covIOU
Description
This method generates a scaled covariance matrix (or list of matrices), for a "covIOU" "corStruct" object.
Usage
## S3 method for class 'covIOU'
corMatrix(object, covariate = getCovariate(object), ...)
Arguments
object |
|
covariate |
List of covariate vectors, at which values the correlation matrix,
or list of correlation matrices, are to be evaluated, as for |
... |
Additional arguments (not used by this method). |
covFracBM
Description
This is a constructor function for the "covFracBM" class, representing a fractional Brownian
motion component in terms of a continuous variable. The object created is a special type of
corStruct
.
Usage
covFracBM(value = c(1, 0.5), form = ~1)
Arguments
value |
Vector of length 2 providing starting values for optimisation of the scale parameter of fractional Brownian motion process relative to residual error variance and the Hurst parameter, respectively. |
form |
A one-sided formula of the form ~t|g, where t represents a continuous variable (usually time) and g represents a grouping factor, i.e. with a separate fractional Brownian motion process modelled at each level. |
Value
An object of class "covFracBM" and inheriting from "corStruct".
Examples
cov2<-covFracBM(form=~time|group)
covIOU
Description
This is a constructor function for the "covIOU" class, representing an integrated Ornstein-Uhlenbeck (IOU)
process component in terms of a continuous variable. The object created is a special type of
corStruct
.
Usage
covIOU(value = c(1, 1), form = ~1)
Arguments
value |
Vector of length 2 providing starting values for optimisation of the perturbation parameter of integrated Ornstein-Uhlenbeck process relative to residual error variance and the Alpha parameter, respectively. |
form |
A one-sided formula of the form ~t|g, where t represents a continuous variable (usually time) and g represents a grouping factor, i.e. with a separate integrated Ornstein-Uhlenbeck process modelled at each level. |
Value
An object of class "covIOU" and inheriting from "corStruct".
Examples
cov3<-covIOU(form=~time|group)
lmeBM
Description
This function is a wrapper for lme.formula
that allows
Brownian motion, fractional Brownian motion or integrated Ornstein-Uhlenbeck
components to be included in linear mixed models, with related parameter
estimates and confidence intervals returned in their natural parameterisation.
Usage
lmeBM(fixed, data, random, covariance = NULL, method = c("REML", "ML"),
control = list(), keep.data = TRUE)
Arguments
fixed |
This is as specified for |
data |
This is as specified for |
random |
This is as specified for |
covariance |
An optional |
method |
This is as specified for |
control |
This is as specified for |
keep.data |
This is as specified for |
Value
An object of class "lme" representing the linear mixed effects model fit.
Examples
BMmodel<-lmeBM(sqrtcd4~t, data=cd4, random=~t|newpid, covariance=covBM(form=~t|newpid),
method="ML", control=list(opt="link{nlm}"))
nlmeBM
Description
This function is a wrapper for nlme.formula
that allows
Brownian motion, fractional Brownian motion or integrated Ornstein-Uhlenbeck
components to be included in non-linear mixed models, with related parameter
estimates and confidence intervals returned in their natural parameterisation.
Usage
nlmeBM(model, data, fixed, random, start, covariance = NULL,
method = c("ML", "REML"), control = list(), verbose = FALSE)
Arguments
model |
This is as specified for |
data |
This is as specified for |
fixed |
This is as specified for |
random |
This is as specified for |
start |
This is as specified for |
covariance |
An optional |
method |
This is as specified for |
control |
This is as specified for |
verbose |
This is as specified for |
Value
An object of class "nlme" and inheriting from class "lme" representing the non-linear mixed effects model fit.
Examples
data(Milk, package="nlme")
Model_fit<- nlmeBM(protein ~ SSasymp(Time, Asym, R0, lrc), data=Milk,
fixed = Asym + R0 + lrc ~ 1, random = Asym ~ 1|Cow,
covariance=covFracBM(form=~Time|Cow),
start = c(Asym = 3.5, R0 = 4, lrc = -1))
print.summary.corStructBM
Description
print.summary.corStructBM
Usage
## S3 method for class 'summary.corStructBM'
print(x, ...)
Arguments
x |
An object of class "summary.corStructBM", containing information on fitted stochastic process component. |
... |
Additional arguments (not used for this method). |
summary.covBM
Description
summary.covBM
Usage
## S3 method for class 'covBM'
summary(object, structName = class(object)[1], ...)
Arguments
object |
An object of class "covBM", containing information on fitted stochastic process component. |
structName |
An optional character string defining the type of correlation
structure associated with object, as for |
... |
Additional arguments (not used for this method). |
summary.covFracBM
Description
summary.covFracBM
Usage
## S3 method for class 'covFracBM'
summary(object, structName = class(object)[1], ...)
Arguments
object |
An object of class "covFracBM", containing information on fitted stochastic process component. |
structName |
An optional character string defining the type of correlation
structure associated with object, as for |
... |
Additional arguments (not used for this method). |
summary.covIOU
Description
summary.covIOU
Usage
## S3 method for class 'covIOU'
summary(object, structName = class(object)[1], ...)
Arguments
object |
An object of class "covIOU", containing information on fitted stochastic process component. |
structName |
An optional character string defining the type of correlation
structure associated with object, as for |
... |
Additional arguments (not used for this method). |