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

Column order matters? #6

Open
erikgrenestam opened this issue May 31, 2020 · 0 comments
Open

Column order matters? #6

erikgrenestam opened this issue May 31, 2020 · 0 comments

Comments

@erikgrenestam
Copy link

Not sure if this is a bug or my own ignorance, but I've noticed that the ordering of columns in the data seem to matter. Example:

library(nowcasting)
data(NYFED)

base <- NYFED$base
blocks <- NYFED$blocks$blocks
trans <- NYFED$legend$Transformation
frequency <- NYFED$legend$Frequency

#randomly generated reordering
shuffle <- c(7, 11, 24, 21, 10, 15, 2,1, 22, 25, 19, 5, 18, 17, 4, 12, 16, 6, 14, 23, 8, 9, 3, 13, 20)

base_shuffle <- base[,shuffle]
frequency_shuffle <- frequency[shuffle]
blocks_shuffle <- blocks[shuffle,]
trans_shuffle <- trans[shuffle]

x <- Bpanel(base = base, trans = trans, NA.replace = F, na.prop = 1)
x_shuffle <- Bpanel(base = base_shuffle, trans = trans_shuffle, NA.replace = F, na.prop = 1)

nowEM <- nowcast(formula = GDPC1 ~ ., data = x, r = 1, p = 1, 
                 method = "EM", blocks = blocks, frequency = frequency)
nowEM_shuffle <- nowcast(formula = GDPC1 ~ ., data = x_shuffle, r = 1, p = 1, 
                 method = "EM", blocks = blocks_shuffle, frequency = frequency_shuffle)

You can verify that nowEM$yfcst and nowEM_shuffle$yfcst are different. Why is this? Do you have any recommendations for a "correct" column order?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant