Learn R Programming

updog (version 1.2.0)

obj_for_alpha: Objective function when updating alpha

Description

Objective function when updating alpha

Usage

obj_for_alpha(mu, sigma2, alpha, rho, log_bb_dense, ploidy)

Arguments

mu

A vector. The ith element is individual i's variational posterior mean at the SNP.

sigma2

A vector. The ith element is individual i's variational posterior variance at the SNP.

alpha

The SNP's allele frequency.

rho

A vector. The ith element is individuals i's inbreeding coefficient.

log_bb_dense

A matrix of log-densities of the beta binomial. The rows index the individuals and the columns index the allele dosage.

ploidy

The ploidy of the species.

Value

A double. The objective when updating alpha in mupdog.