This vignette covers the basic functionality of the ajive package.

library(ajive)

Sample toy data

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)

accessing AJIVE output

You can access a number of the possible quantities of interest with the following functions

The user can alwasy access the AJIVE output directly from ajive_output which is just a list.

Full matrix representation

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))

Block Specific Scores

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)

Common Normalized Scores

cns <- get_common_normalized_scores(ajive_output)

Individual Normalized Scores

ins_1 <- get_block_scores(ajive_output, k, type='individual', normalized=TRUE)

Individual loadings

indiv_loadings_1 <- get_block_loadings(ajive_output, k, type='individual')


idc9/r_jive documentation built on Oct. 20, 2020, 4:23 p.m.