Skip to contents

Fit PSD model with SVI algorithm, and use the loss function as a stopping criterion.

Usage

psd_fit_svi(
  G,
  K,
  epsilon = 1e-05,
  maxiter = 5e+05,
  val_iter = 10000,
  maxdrop = 3,
  maxiter.sample = 100,
  maxiter.val = 2000,
  val_J = 0.05,
  val_I = 0.1,
  tau = 1,
  kappa = 0.5
)

Arguments

G

The I x J matrix of counts; all entries of G should be taken from {0,1,2}.

K

An integer 2 or greater giving the matrix rank.

epsilon

Convergence criterion.

maxiter

The maximum number of iterations.

val_iter

The number of iterations between each validation set sampling.

maxdrop

The maximum number of consecutive decreases in the loss function. Beyond this value the loop will stop.

maxiter.sample

The maximum number of iterations in the sampling section.

maxiter.val

The maximum number of iterations in the validation section.

val_J

Sample proportion of SNPs in validation set.

val_I

Sample proportion of individuals in validation set.

tau

A parameter of the descending direction of SVI algorithm.

kappa

A parameter of the descending direction of SVI algorithm.

Value

A List with the following parameters:

P

The population scale matrix of the individuals.

Loss

A vector represents the value of the loss function which records once for 10 iterations.

MaxLoss

Maximum loss function value. Unlike other algorithms, we observe the loss function on the validation set. Therefore, monotonicity is not guaranteed, that is, the maximum value does not necessarily occur at the end, so the maximum value needs to be recorded.

Iterations

An integer represents the number of iterations.

Examples

# Refer to Articles in AwesomePackage.