grad_parent: Gradient of 'obj_parent' (when 'outlier = FALSE') with...

Description Usage Arguments Value Author(s)

View source: R/RcppExports.R

Description

Gradient of obj_parent (when outlier = FALSE) with respect to bias_val, seq_error, and od_param. Basically, this just calculates derivatives of the log beta-binomial density.

Usage

1
2
grad_parent(pcounts, psize, ploidy, pgeno, bias_val = 1, seq_error = 0,
  od_param = 0, weight = 1)

Arguments

pcounts

The number of counts of the reference allele we observe in a parent.

psize

The total number of reads we observe in a parent.

ploidy

An integer. The ploidy of the species. This is assumed to be the same for each individual.

pgeno

The genotype of the parent.

bias_val

The bias parameter. A value of 1 means there is no bias toward one allele or the other. A value less than one indicates a bias toward the reference allele. A value greater than one indicates a bias toward the non-reference allele.

seq_error

The sequencing error rate.

od_param

The overdispersion parameter in the beta-binomial model for the OK counts. When this is zero, this resorts to the binomial model for counts.

weight

A double that multiplies to the log-likelihood (objective). Should only be used when outlier = FALSE during the M step of the EM algorithm.

Value

A NumericVector of length three that contains the partial derivatives of bias_val, seq_error, and od_param, in that order.

Author(s)

David Gerard


dcgerard/updogAlpha documentation built on May 14, 2019, 3:10 a.m.