Learn R Programming

cSFM (version 1.1)

case2.b.initial: Initial Estimates of Parameter Functions

Description

Obtain the initial estimates of functional parameters (mean, var, shape and skewness) when both the mean and variance are covariate depedent but the skewness is covariate independent.

Usage

case2.b.initial(y, tp, cp, nbasis.mean = 10, gam.method = "REML", 
                bin = 10, skew.method = "mle", cate = 1)

Arguments

y
observed data matrix
tp
timepoint vector with length = ncol(y)
cp
covariate vector with length = nrow{y}
nbasis.mean
number of bases when smoothing the mean
gam.method
smoothing method for the mean
bin
the length of bin to estimate the variance
skew.method
estimation method for skewness; See 'Details'
cate
method category, taking values as 1,2,3; See 'Details'

Value

  • A list of initial estimate of parmeters (length 4: mean, variance, shape and skewness).

Details

The variance is estimated using binning method with length = bin. The skewness can be estimated by method of moment mome or maximum likelihood mle. Stepwise estimates are used here: the variance is based on the residuals after removing the mean effect; the skewness is based on the scaled residuals after removing both the mean and variance effect.

cate indiates the method cateory as follows:

  • cate = 1
{ all three parameter functions are to be estimated} cate = 2{ the skewnewss parameter is fixed as 0} cate = 3{ the mean to be fixed at 0; typically used when a stepwise estimation procedure is used, e.g. 2cSFM in cSFM.est}

See Also

cSFM.est

Examples

Run this code
data(data.simulation)
cp.hat <- case2.b.initial(y = DST$obs, tp= DST$tp, cp=DST$cp)
# visulize the parameter function and the estimated function
par(mfrow = c(1,2))
persp(DST$cp, DST$tp, exp(DST$pars$logvar), theta=60, phi=15,
      ticktype = "detailed", col="lightblue", 
      xlab = "covariate", ylab = "time",
      zlab="data", main="variance surface")
persp(DST$cp, DST$tp, cp.hat$var, theta=60, phi=15,
      ticktype = "detailed", col="lightblue", 
      xlab = "covariate", ylab = "time",
      zlab="data", main="initial estiamtes")

Run the code above in your browser using DataLab