Skip to content

Commit

Permalink
updates to smooth.basis.sparse.R
Browse files Browse the repository at this point in the history
  • Loading branch information
gileshooker committed Mar 22, 2023
1 parent f4286ba commit 7e33622
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/smooth.basis.sparse.R
Expand Up @@ -76,16 +76,16 @@ smooth.basis.sparse <- function(argvals, y, fdParobj, fdnames=NULL, covariates=N
coefs = matrix(0, nrow = basisobj$nbasis, ncol = dim(y)[2])
for(i in 1:dim(y)[2]){
curve = y[,i]
curve.smooth = smooth.basis(time[!is.na(curve)],curve[!is.na(curve)],
curve.smooth = smooth.basis(argvals[!is.na(curve)],curve[!is.na(curve)],
basisobj, covariates, method)
coefs[,i] = curve.smooth$fd$coefs
}
} else if(length(dim(y) == 3){
} else if(length(dim(y)) == 3){
coefs = array(0, c(basisobj$nbasis,dim(y)[2:3]))
for(i in 1:dim(y)[2]){
for(j in 1:dim(y)[3]){
curve = y[,i,j]
curve.smooth = smooth.basis(time[!is.na(curve)],curve[!is.na(curve)],
curve.smooth = smooth.basis(argvals[!is.na(curve)],curve[!is.na(curve)],
basisobj, covariates, method)
coefs[,i,j] = curve.smooth$fd$coefs
}
Expand Down

0 comments on commit 7e33622

Please sign in to comment.