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

Cant initialize only one factor with flash_factor_init #107

Open
jean997 opened this issue Nov 6, 2023 · 2 comments
Open

Cant initialize only one factor with flash_factor_init #107

jean997 opened this issue Nov 6, 2023 · 2 comments

Comments

@jean997
Copy link

jean997 commented Nov 6, 2023

data <- matrix(rnorm(n = 60), ncol = 10, nrow = 6)
init <- list(matrix(rnorm(n = 10), nrow =10, ncol =1), matrix(c(0, 0, 1, 1, 1,1), nrow = 6, ncol = 1))
fl <- flash_init(data = data, var_type =2)
fl <- flash_factors_init(fl, init)

error:

Error in base::colSums(x, na.rm = na.rm, dims = dims, ...) :
'x' must be an array of at least two dimensions

It looks like the issues is in line 65 of residuals_and_R2.R

@jean997
Copy link
Author

jean997 commented Jan 11, 2024

Looks like there is the same error from backfit if only one factor is added from flash_greedy

@willwerscheid
Copy link
Owner

Hi @jean997 sorry i completely missed this issue when it was posted. There is a typo in the code snippet you provided - it should read nrow = 10, ncol = 6 instead of ncol = 10, nrow = 6. That solves the problem for me.

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

2 participants