bsvd: Gibbs sampler for Bayesian SVD.

Description Usage Arguments Details Value Author(s) References

View source: R/ruvb.R

Description

This is a modification of the Bayesian approach from Hoff (2012) to allow for heteroscedastic columns. We start the missing values from the RUV4 solution.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bsvd(
  Y21,
  Y31,
  Y32,
  k,
  nsamp = 10000,
  burnin = round(nsamp/4),
  keep = 20,
  print_update = TRUE,
  plot_update = FALSE
)

Arguments

Y21

Top left of matrix.

Y31

Bottom left of matrix.

Y32

Top right of matrix.

k

The rank of the mean matrix.

nsamp

A positive integer. The number of samples to draw.

burnin

A positive integer. The number of early samples to discard.

keep

A positive integer. We will same the updates of Y22 every keep iteration of the Gibbs sampler.

print_update

A logical. Should we print a text progress bar to keep track of the Gibbs sampler (TRUE) or not (FALSE)?

plot_update

A logical. Should we make some plots to keep track of the Gibbs sampler (TRUE) or not (FALSE)?

Details

The rejection sampler in rbmf.matrix.gibbs almost always stalls, so I am removing it from exports for now.

Value

A list with the following elements:

Y22_array A three-dimensional array containing draws of Y22. Y22[, , i] contains the ith draw of Y22.

mu_psi_phi A matrix with three columns. The rows are the draws from the posterior. The first column is for the mean of the singular values. The second column is for the precision of the singular values. The last column is for the mean of the variances.

neff_y22 The effective sample sizes from Y22_array as calculated by effectiveSize

neff_mu_psi_phi The effective sample sizes from mu_psi_phi as calculated by effectiveSize

Author(s)

David Gerard

References


dcgerard/vicar documentation built on July 7, 2021, 1:08 p.m.