Description Usage Arguments Details Value Note References See Also Examples
View source: R/Package_HAC_RAC_SHAC.r
Calculate the negative loglikelihood function as the objective function to be minimize in terms of coefficients β's. The mean and variance parameters are bivariate, while the skewness parameter is univariate. The gradient is calculated by a closed form.
1 2 | case2.unmll.optim(beta, dataone, Basis.list, cate = 1)
case2.gr(beta, dataone, Basis.list, cate = 1)
|
beta |
smoothing coefficients as a vector |
dataone |
observation as a matrix |
Basis.list |
a list of 3 components corresponding to smooth matrices for (mu, logvar, and skewness), typically generated by |
cate |
category of model to be considered; 1 for full model, 2 for the model when the skewness is fixed at 0 (no skewness) |
The coefficient beta
is a vector by combining all coefficients for the mean, variance and skewness.
case2.unmll.optim |
negative loglikehood at beta when |
case2.gr |
gradient vector of |
This is the negative log Marginal likelihood function of the data assuming independence.
[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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | data(data.simulation)
y <- DST$obs
tp <- DST$tp
cp <- DST$cp
# generate basis
cases = c(2,2,1) # bivariate for mean and variance; univariate for shape
nknots.tp = c(2,2,2) # 2 knots at time direction for each parameter
nknots.cp = c(2,2) # 2 knots at covariate direction for mean and variance
basis.list <- lapply(1:3, function(k)
kpbb(tp, cp, nknots.tp = nknots.tp[k],
nknots.cp= nknots.cp[k], sub.case=cases[k]))
# obtain coefficients randomly
length.beta <- sum(sapply(basis.list, ncol))
beta <- runif(length.beta)
unmll <- case2.unmll.optim(beta, y, basis.list)
gradient <- case2.gr(beta, y, basis.list)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.