Description Usage Arguments Details Value References See Also Examples
Function used for model estimation with bivariate (or univariate) B-splines, when the number of knots are given for each parameters (mean, variance and skewness). Kronecker product is used for bivariate case. It returns cSFM objects.
1 2 3 |
data |
The fully observed data matrix n by m. The number of row n is the number of subjects; the number of columns m is the number of time points for each subject. |
tp |
The timepoint vector of length m, shared by each subject |
cp |
The covariate vector of length n corresponding to n subjects |
nknots.tp |
The vector (k1,k2,k3) for the number of knots (mean, variance, skewness) in the time direction |
nknots.cp |
The vector (s1,s2,s3) for the number of knots (mean, variance, skewness) in the covariant direction; the effective length is |
degree.poly |
The vector (d1,d2,d3) for the degree of B-splines (mean, variance, skewness) in both the time and covariant direction; the cubic splines are the default splines. |
method |
Estimation method for the model. See 'Details'. |
bi.level |
Bivariate level taking values at 0, 1, 2, 3. See 'Details'. |
nbasis.mean |
Number of basis functions to smooth the mean; only applicable when |
gam.method |
Method to smooth the mean; only applicable when |
The three methods for the argument method
are all based on skewed normal and corpula, but exploits different approaches to conduct the estimation.
Method "cSFM
" assumes the full model and estimate all the parameter functions (mean, variance, skewness) jointly; Method "cSFM0
" enforces the skewness to be zero,
and estimate the other two parameter functions jointly; Method "2cSFM
" first estimate the mean function via penalized bivariate spline and then estimate the variance and
skewness for the residulas, thus it is a Stepwise approach.
The argument bi.level
indicates the bivariate dependence for all three parameters.
For example, Bi.level = 2 means the parameters are bivariate up to the 2nd momdnet, i.e. the mean and variance are bivariate while the skewness is univariate.
A cSFM object as a list with components:
beta.hat |
Estimated coefficients |
cp.hat |
Estimated parameter functions including the mean, variance and skewness |
copula |
Estimated copula for the data |
corr.est |
Estimated correlation matrix for the copula |
AIC |
AIC for the model |
num.pars |
Number of parameters in the model |
logL1 |
Marginal loglikelihood value |
logL2 |
Loglikelihood value for the corpula |
sm.basis |
Smoothing Matrices used as the basis |
gam.mean |
Results when smoothing the mean, returned by |
[1]. Meng Li, Ana-Maria Staicu and Howard D. Bondell (2013), Incorporating Covariates in Skewed Functional Data Models. http://www.stat.ncsu.edu/information/library/papers/mimeo2654_Li.pdf.
print.cSFM
, predict.cSFM
, fitted.cSFM
, gam
, data.simulation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | data(data.simulation) # load benchmark data
y <- DST$obs # matrix of observation
tp <- DST$tp; cp <- DST$cp
# fixed number of knots
# bivariate for mean and variance, univrariate for shape
nknots.tp <- c(2,2,2)
nknots.cp <- c(2,2)
## Not run:
fit.cSFM <- cSFM.est(y, tp, cp, nknots.tp, nknots.cp, method = "cSFM")
fit.cSFM #print out the results briefly
# fitted mean, logvar and skewness; fitted quantiles
fitted.value <- fitted(fit.cSFM)
# visualize the parameter function and the estimated function
par(mfrow = c(1,2))
persp(DST$cp, DST$tp, DST$pars$mean, theta=60, phi=15,
ticktype = "detailed", col="lightblue",
xlab = "covariate", ylab = "time",
zlab="data", main="parameter surface")
persp(DST$cp, DST$tp, fit.cSFM$cp.hat$mean, theta=60, phi=15,
ticktype = "detailed", col="lightblue",
xlab = "covariate", ylab = "time",
zlab="data", main="estimated surface via 'cSFM' method")
# predication for missing data
y.valid <- DSV$obs # matrix of training data; include missing values
tp.valid <- DSV$tp; cp.valid <- DSV$cp
#predication for training data
yhat.predict <- predict(fit.cSFM, y.valid, cp.valid, tp.valid)
# visualize the data and predicted surface
par(mfrow = c(1,2))
persp(DSV$cp, DSV$tp, y.valid, theta=60, phi=15,
ticktype = "detailed", col="lightblue",
xlab = "covariate", ylab = "time",
zlab="data", main="data surface (partically observed)")
persp(DSV$cp, DSV$tp, yhat.predict, theta=60, phi=15,
ticktype = "detailed", col="lightblue",
xlab = "covariate", ylab = "time",
zlab="data", main="predicted surface via 'cSFM' method")
# predication error
mean(((yhat.predict - DSV$obs.full)[!is.na(DSV$obs)])^2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.