fn_cov_mle: Wrapper for 'obj_offspring_reparam'.

Description Usage Arguments Author(s)

View source: R/update_all.R

Description

This exists to calculate the Hessian of the parameters at the end of updog_update_all.

Usage

1
2
3
4
5
fn_cov_mle(par, ocounts, osize, ploidy, prob_geno, p1counts = NULL,
  p1size = NULL, p2counts = NULL, p2size = NULL, p1geno = NULL,
  p2geno = NULL, bias_val_mean = 0, bias_val_sd = 0.7,
  seq_error_mean = -4.7, seq_error_sd = 1, model = c("f1", "s1", "hw",
  "uniform"))

Arguments

par

A numeric vector of length 4. The elements are s, ell, r, and the logit of out_prop from obj_offspring_reparam.

ocounts

The observed counts of the refernce allele for each individual.

osize

The observed number of reads for each individuals.

ploidy

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

prob_geno

The allele frequencies of the genotypes. See get_prob_geno.

p1counts

A vector of non-negative integers. The ith element is the number of reads of the reference allele in the ith sample of parent 1. If NULL then the prior probabilities on parent 1's genotype will default to uniform.

p1size

A vector of positive integers. The ith element is the total number of reads in the ith sample of parent 1. If NULL then the prior probabilities on parent 1's genotype will default to uniform.

p2counts

A vector of non-negative integers. The ith element is the number of reads of the reference allele in the ith sample of parent 2. If NULL then the prior probabilities on parent 2's genotype will default to uniform.

p2size

A vector of positive integers. The ith element is the total number of reads in the ith sample of parent 2. If NULL then the prior probabilities on parent 2's genotype will default to uniform.

p1geno

The initial value of the first parental genotype.

p2geno

The initial value of the second parental genotype.

bias_val_mean

The prior mean on the log of bias_val (corresponding to parvec[1]). Set bias_val_sd = Inf to have no penalty on the bias parameter.

bias_val_sd

The prior standard deviation on the log of bias_val (corresponding to parvec[1]). Set bias_val_sd = Inf to have no penalty on the bias parameter.

seq_error_mean

The mean of the logit-normal prior on the sequencing error rate, which corresponds to parvec[2]. Set seq_error_sd = Inf to have no penalty on the sequencing error rate. The default is -4.7, which roughly corresponds to a mean sequencing error value of 0.009. If you want to constain seq_error to be zero, you need to set update_seq_error = FALSE, seq_error = 0, andseq_error_mean = -Inf.

seq_error_sd

The standard deviation of the logit-normal prior on the sequencing error rate, which corresponds to parvec[2]. The default is 1, which at three standard deviations is about a sequencing error rate of 0.15. Set seq_error_sd = Inf to have no penalty on the sequencing error rate.

model

The model for the genotype distribution. Do we assume an F1 population ("f1"), an S1 population ("s1"), Hardy-Weinberg equilibrium ("hw"), or a uniform distribution ("uniform").

Author(s)

David Gerard


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