View source: R/helper_functions.R
traceplot_array | R Documentation |
MegaLMM parameters are all matrices. Parameters related to the factor loadings matrix
Lambda
all have K
rows. Factors related to the factor scores
all have K
columns. Some parameters only have 1 row or column, but are still stored as matrices.
Posterior samples of these parameters are arrays with dimensions: Ixnxm
for
I
samples of a parameter with dimensions nxm
.
traceplot_array(
sample_array,
facet_dim = 2,
name = "param",
n_per_facet = 5,
mask = NULL,
include_zero = TRUE
)
sample_array |
|
facet_dim |
either 2 or 3, giving the dimension of |
name |
string giving a name to assign to the plot. The file will be a pdf booklet stored in the 'run_ID' folder with this name. |
n_per_facet |
maximum number of values to make traces per facet |
mask |
optional |
include_zero |
should each facet include the value zero? |
This function makes trace plots of parameters using a faceting scheme to try to
display as many parameter traces as possible in an organized way. In all plots,
the sample number will be the x-axis. The plot(s) will be divided into facets by either the
second (default) or 3rd dimension of the sample_array
. Within a facet there will be
lines showing the traces of individual values within that dimension of the matrix.
In cases where the matrix is large in that dimension, only the n_per_facet
traces with the largest (absolute) posterior mean will be shown, as these are probably the
most important.
Sometimes (particularly in a cross-validation framework) we may have a matrix with
many parameters, but only some of them are interesting to inspect traces. You can supply
an nxm
logical matrix mask
where TRUE
means the value will be masked
from the plot, and FALSE
means the value will be plotted.
None
traceplot_array(load_posterior_param(MegaLMM_state,'Lambda'),2,'Lambda')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.