reshape_samples: Reshape fitted scores for easy plotting

Description Usage Arguments Value

View source: R/reshape.R

Description

Both thetas and betas in NMF are reshaped using very similar code, so we might as well combine it explicitly in one function.

Usage

1
reshape_samples(samples, truth, dims)

Arguments

samples

[array] The samples generated by STAN; e.g. obtained by fit$param. Two dimensions are for the actual matrix, the third are from sampling iterations.

truth

[matrix] The truth parameter values, known because we are working from a simulation.

dims

[character vector] The names to use for the rows and columns of the parameter matrix.

Value

reshaped [data.table] The melted scores, with truth along with samples.


krisrs1128/nmfSim documentation built on May 20, 2019, 1:30 p.m.