peer_old | R Documentation |
Implements functional model with structured penalties (Randolph et al., 2012) with scalar outcome and single functional predictor through mixed model equivalence.
peer_old(
Y,
funcs,
argvals = NULL,
pentype = "Ridge",
L.user = NULL,
Q = NULL,
phia = 10^3,
se = FALSE,
...
)
Y |
vector of all outcomes |
funcs |
matrix containing observed functional predictors as rows. Rows
with |
argvals |
matrix (or vector) of indices of evaluations of |
pentype |
type of penalty. It can be either decomposition based
penalty ( |
L.user |
penalty matrix. Need to be specified with
|
Q |
Q matrix to derive decomposition based penalty. Need to be
specified with |
phia |
Scalar value of a in decomposition based penalty. Need to be
specified with |
se |
logical; calculate standard error when |
... |
additional arguments passed to the |
If there are any missing or infinite values in Y
, and funcs
,
the corresponding row (or observation) will be dropped. Neither Q
nor L
may contain missing or infinite values.
peer_old()
fits the following model:
y_i=\int {W_i(s)\gamma(s) ds} + \epsilon_i
where \epsilon_i ~ N(0,\sigma^2)
. For all the observations,
predictor function W_i(s)
is evaluated at K sampling points. Here,
\gamma (s)
denotes the regression function.
Values of y_i
and W_i(s)
are passed through argument Y and
funcs, respectively. Number of elements or rows in Y
and
funcs
need to be equal.
The estimate of regression functions \gamma(s)
is obtained as
penalized estimated. Following 3 types of penalties can be used:
i. Ridge: I_K
ii. Second-order difference: [d_{i,j}
] with d_{i,i} = d_{i,i+2}
= 1, d_{i,i+1} = -2
, otherwise d_{i,i} =0
iii. Decomposition based penalty: bP_Q+a(I-P_Q)
where P_Q=
Q^T(QQ^T)^{-1}Q
For Decomposition based penalty user need to specify
pentype='DECOMP'
and associated Q matrix need to be passed through
Q
argument.
Alternatively, user can pass directly penalty matrix through argument L.
For this user need to specify pentype='USER'
and associated L matrix
need to be passed through L
argument.
Default penalty is Ridge penalty and user needs to specify RIDGE
.
For second-order difference penalty, user needs to specify D2
.
a list containing:
fit |
result of the call to |
fitted.vals |
predicted outcomes |
Gamma |
estimates with standard error for regression function |
GammaHat |
estimates of regression function |
se.Gamma |
standard error associated with
|
AIC |
AIC value of fit (smaller is better) |
BIC |
BIC value of fit (smaller is better) |
logLik |
(restricted) log-likelihood at convergence |
lambda |
estimates of smoothing parameter |
N |
number of subjects |
K |
number of Sampling points in functional predictor |
sigma |
estimated within-group error standard deviation. |
Madan Gopal Kundu mgkundu@iupui.edu
Kundu, M. G., Harezlak, J., and Randolph, T. W. (2012). Longitudinal functional models with structured penalties (arXiv:1211.4763 [stat.AP]).
Randolph, T. W., Harezlak, J, and Feng, Z. (2012). Structured penalties for functional linear models - partially empirical eigenvectors for regression. Electronic Journal of Statistics, 6, 323–353.
lpeer
, plot.peer
## Not run:
#------------------------------------------------------------------------
# Example 1: Estimation with D2 penalty
#------------------------------------------------------------------------
## Load Data
data(DTI)
## Extract values for arguments for peer() from given data
cca = DTI$cca[which(DTI$case == 1),]
DTI = DTI[which(DTI$case == 1),]
##1.1 Fit the model
fit.cca.peer1 = peer(Y=DTI$pasat, funcs = cca, pentype='D2', se=TRUE)
plot(fit.cca.peer1)
#------------------------------------------------------------------------
# Example 2: Estimation with structured penalty (need structural
# information about regression function or predictor function)
#------------------------------------------------------------------------
## Load Data
data(PEER.Sim)
## Extract values for arguments for peer() from given data
PEER.Sim1<- subset(PEER.Sim, t==0)
W<- PEER.Sim1$W
Y<- PEER.Sim1$Y
##Load Q matrix containing structural information
data(Q)
##2.1 Fit the model
Fit1<- peer(Y=Y, funcs=W, pentype='Decomp', Q=Q, se=TRUE)
plot(Fit1)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.