diff --git a/R/FCReg.R b/R/FCReg.R index f2ba69a5..eaffb88f 100644 --- a/R/FCReg.R +++ b/R/FCReg.R @@ -18,8 +18,8 @@ #' @details If measurement error is assumed, the diagonal elements of the raw covariance will be removed. This could result in highly unstable estimate if the design is very sparse, or strong seasonality presents. #' @references #' \cite{Yao, F., M\"{u}ller, H.G., Wang, J.L. "Functional Linear Regression Analysis for Longitudinal Data." Annals of Statistics 33, (2005): 2873-2903.(Dense data)} -#' \cite{Sent\"{u}rk, D., M\"{u}ller, H.G. "Functional varying coefficient models for longitudinal data." J. American Statistical Association, 10, (2010): 1256--1264. -#' \cite{Sent\"{u}rk, D., Nguyen, D.V. "Varying Coefficient Models for Sparse Noise-contaminated Longitudinal Data", Statistica Sinica 21(4), (2011): 1831-1856. (Sparse data)} +#' \cite{Sent\"{u}rk, D., M\"{u}ller, H.G. "Functional varying coefficient models for longitudinal data." J. American Statistical Association, 10, (2010): 1256--1264.} +#' \cite{Sent\"{u}rk, D., Nguyen, D.V. "Varying Coefficient Models for Sparse Noise-contaminated Longitudinal Data", Statistica Sinica 21(4), (2011): 1831-1856. (Sparse data)} #' @export #' @examples #' # Y(t) = \beta_0(t) + \beta_1(t) X_1(t) + \beta_2(t) Z_2 + \epsilon diff --git a/R/FPCA.R b/R/FPCA.R index 76e3194d..564e68bf 100644 --- a/R/FPCA.R +++ b/R/FPCA.R @@ -249,6 +249,10 @@ FPCA = function(Ly, Lt, optns = list()){ plot.FPCA(ret) } + if (optns$lean) { + ret$inputData <- NULL + } + return(ret); } diff --git a/R/MakeResultFPCA.R b/R/MakeResultFPCA.R index 6a582e3c..d06f30c8 100644 --- a/R/MakeResultFPCA.R +++ b/R/MakeResultFPCA.R @@ -13,7 +13,7 @@ # rho: regularization parameter for sigma2 # fitLambda: eigenvalues by least squares fit method # timestamps: time-stamps on how much time specific parts of FPCA needed -# inputData: input data to return (if lean: FALSE) +# inputData: input data to return ###### # Output: ###### @@ -66,17 +66,17 @@ MakeResultFPCA <- function(optns, smcObj, mu, scsObj, eigObj, ret$fitLambda <- fitLambda } - ret$inputData <- inputData; # This will be potentially be NULL if `lean` + ret$inputData <- inputData class(ret) <- 'FPCA' # select number of components based on specified criterion # This should be move within MakeResultFPCA selectedK <- SelectK(fpcaObj = ret, criterion = optns$methodSelectK, FVEthreshold = optns$FVEthreshold) - if(!optns$lean){ + # if(!optns$lean){ ret$inputData <- inputData; - } else { - ret$inputData <- NULL - } + # } else { + # ret$inputData <- NULL + # } ret <- append(ret, list(selectK = selectedK$K, criterionValue = selectedK$criterion)) class(ret) <- 'FPCA' diff --git a/man/FCReg.Rd b/man/FCReg.Rd index 87ff4d95..a455ff56 100644 --- a/man/FCReg.Rd +++ b/man/FCReg.Rd @@ -73,3 +73,8 @@ Ysp <- Sparsify(Y, T, sparsity) vars <- list(X_1=X_1sp, Z_2=Z[, 2], Y=Ysp) withError2D <- FCReg(vars, bw, bw, outGrid) } +\references{ +\cite{Yao, F., M\"{u}ller, H.G., Wang, J.L. "Functional Linear Regression Analysis for Longitudinal Data." Annals of Statistics 33, (2005): 2873-2903.(Dense data)} +\cite{Sent\"{u}rk, D., M\"{u}ller, H.G. "Functional varying coefficient models for longitudinal data." J. American Statistical Association, 10, (2010): 1256--1264.} +\cite{Sent\"{u}rk, D., Nguyen, D.V. "Varying Coefficient Models for Sparse Noise-contaminated Longitudinal Data", Statistica Sinica 21(4), (2011): 1831-1856. (Sparse data)} +} diff --git a/man/FPCA.Rd b/man/FPCA.Rd index ee4916ad..72b675b6 100644 --- a/man/FPCA.Rd +++ b/man/FPCA.Rd @@ -92,13 +92,13 @@ plot(res) # The design plot covers [0, 1] * [0, 1] well. CreateCovPlot(res, 'Fitted') } \references{ -\cite{Yao, F., Müller, H.G., Clifford, A.J., Dueker, S.R., Follett, J., Lin, Y., Buchholz, B., Vogel, J.S. (2003). "Shrinkage estimation +\cite{Yao, F., M\"{u}ller, H.G., Clifford, A.J., Dueker, S.R., Follett, J., Lin, Y., Buchholz, B., Vogel, J.S. (2003). "Shrinkage estimation for functional principal component scores, with application to the population kinetics of plasma folate." Biometrics 59, 676-685. (Shrinkage estimates for dense data)} -\cite{Yao, Fang, Müller, Hans-Georg and Wang, Jane-Ling (2005). "Functional data analysis for sparse longitudinal data." +\cite{Yao, Fang, M\"{u}ller, Hans-Georg and Wang, Jane-Ling (2005). "Functional data analysis for sparse longitudinal data." Journal of the American Statistical Association 100, no. 470 577-590. (Sparse data FPCA)} -\cite{Liu, Bitao and Müller, Hans-Georg (2009). "Estimating derivatives for samples of sparsely observed functions, +\cite{Liu, Bitao and M\"{u}ller, Hans-Georg (2009). "Estimating derivatives for samples of sparsely observed functions, with application to online auction dynamics." Journal of the American Statistical Association 104, no. 486 704-717. (Sparse data FPCA)} \cite{Castro, P. E., Lawton, W.H. and Sylvestre, E.A. (1986). "Principal modes of variation for processes with continuous