Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct lean=TRUE & plot=TRUE #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/FCReg.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions R/FPCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ FPCA = function(Ly, Lt, optns = list()){
plot.FPCA(ret)
}

if (optns$lean) {
ret$inputData <- NULL
}

return(ret);
}

12 changes: 6 additions & 6 deletions R/MakeResultFPCA.R
Original file line number Diff line number Diff line change
Expand Up @@ -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:
######
Expand Down Expand Up @@ -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'
Expand Down
5 changes: 5 additions & 0 deletions man/FCReg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/FPCA.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.