-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Mixed BIC & Full-Grid Solves
Unify interface to full-grid and BIC-based selection to allow for "mixed" solves Allow BIC-based selection to be set separately for each parameter (of 4) while other parameters have a full-grid of solutions. This will be useful for special cases (e.g., two way FPCA where we want BIC for smoothing parameters but to fix sparsity parameters to zero) and for visualization.
- Loading branch information
Showing
16 changed files
with
757 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
get_4Dlist_elem <- function(x, alpha_u_i, lambda_u_i, alpha_v_i, lambda_v_i){ | ||
if(!inherits(x, "MoMA_4D_list")){ | ||
moma_error(sQuote("x"), " should be a ", sQuote("MoMA_4D_list"), " object.") | ||
} | ||
n_alpha_u = dim(x)[1] | ||
n_lambda_u = dim(x)[2] | ||
n_alpha_v = dim(x)[3] | ||
n_lambda_v = dim(x)[4] | ||
|
||
# NOTE: R index starts from 1 | ||
if( | ||
alpha_u_i <= 0 || alpha_u_i > n_alpha_u || | ||
lambda_u_i <= 0 || lambda_u_i > n_lambda_u || | ||
alpha_v_i <= 0 || alpha_v_i > n_alpha_v || | ||
lambda_v_i <= 0 || lambda_v_i > n_lambda_v | ||
){ | ||
moma_error("Invalid index (",alpha_u_i, ",", lambda_u_i, | ||
",",alpha_v_i, ",",lambda_v_i,"), dim = ", | ||
dim(x)) | ||
} | ||
return(x[n_lambda_u * n_alpha_v * n_lambda_v * (alpha_u_i-1) + | ||
n_alpha_v * n_lambda_v * (lambda_u_i-1) + | ||
n_lambda_v * (alpha_v_i-1) + | ||
lambda_v_i]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.