case2.b.initial: Initial Estimates of Parameter Functions

Description Usage Arguments Details Value See Also Examples

View source: R/Package_HAC_RAC_SHAC.r

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

1
2
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'

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:

Value

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

See Also

cSFM.est

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(data.simulation)
## Not run: 
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")

## End(Not run)

cSFM documentation built on May 29, 2017, 6:10 p.m.

Related to case2.b.initial in cSFM...