This vignette covers the basic functionality of the ajive
package.
library(ajive)
blocks <- sample_toy_data(n=200, dx=100, dy=500)
First decide on the initial signal ranks.
scree_plot_blocks(blocks)
Using the above scree plots we set the initial signal rank equal to 2 for both blocks.
initial_signal_ranks <- c(2, 2)
Now we are ready to compute the JIVE decomposition
ajive_output <- ajive(blocks, initial_signal_ranks, n_wedin_samples = 100, n_rand_dir_samples = 100)
You can access a number of the possible quantities of interest with the following functions
get_block_full
get_common_normalized_scores
get_block_scores
get_block_loadings
get_joint_rank
get_individual_rank
The user can alwasy access the AJIVE output directly from ajive_output
which is just a list.
The user can access the full JIVE decomposition matrices with get_block_full
i.e.
k <- 1 J <- get_block_full(ajive_output, k, type='joint') I <- get_block_full(ajive_output, k, type='individual') E <- get_block_full(ajive_output, k, type='noise') # check X = J + I + E norm(blocks[[k]] - (J + I + E))
bss_1 <- get_block_scores(ajive_output, k, type='joint', normalized=FALSE)
normalized_bss_1 <- get_block_scores(ajive_output, k, type='joint', normalized=TRUE)
cns <- get_common_normalized_scores(ajive_output)
ins_1 <- get_block_scores(ajive_output, k, type='individual', normalized=TRUE)
indiv_loadings_1 <- get_block_loadings(ajive_output, k, type='individual')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.