You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
issue raised by @andrew-leroux (thank you), bug in MFPCA due to function implicitly assuming ids are ordered. Code below reproduces the bug:
library("refund")
data(DTI)
DTI <- subset(DTI, Nscans < 6)
id <- as.numeric(factor(DTI$ID)); summary(diff(id)) ## IMPORTANT: the IDs are already ordered
Y <- DTI$cca
id2 <- rev(id) ## create new vector of ids which are NOT ordered
mfpca.DTI1 <- mfpca.sc(Y=Y, id = id, twoway = TRUE) ## works
mfpca.DTI2 <- mfpca.sc(Y=Y, id = id2, twoway = TRUE) ## fails
The code below raises a similar issue; there is no bug but estimation is wrong. See the plot, the first row of the first fit and the last row of the second fit should have the same fitted values but they don't.
data(DTI)
library("refund")
DTI <- subset(DTI, Nscans == 4)
id <- as.numeric(factor(DTI$ID)); summary(diff(id))
Y <- DTI$cca
Y2 <- Y[rev(1:nrow(Y)),] ## create new vector of ids which are NOT ordered
id2 <- id[rev(1:nrow(Y))]
mfpca.DTI1 <- mfpca.sc(Y=Y, id = id, twoway = TRUE)
mfpca.DTI2 <- mfpca.sc(Y=Y2, id = id2, twoway = TRUE)
issue raised by @andrew-leroux (thank you), bug in MFPCA due to function implicitly assuming ids are ordered. Code below reproduces the bug:
The code below raises a similar issue; there is no bug but estimation is wrong. See the plot, the first row of the first fit and the last row of the second fit should have the same fitted values but they don't.
The text was updated successfully, but these errors were encountered: