Fit a genomic cline using maximum likelihood
Fit a genomic cline and compare it to a null expectation. Choices are logit-logistic cline, Barton cline, Beta cline, multinomial regression, binomial regression, and Richards cline. This function is used by Cline.fit to compare clines fit to a data set.
gcline.fn(x, n, y, start, model = "logit-logit", method = "L-BFGS-B", iterations = 99, SD = rep(0.01, length(start)), headstart = FALSE,Grid = TRUE)
x |
A numeric vector of genome-wide mean ancestry (or any independent variable on the unit interval). |
n |
A numeric vector of sample sizes for each value in |
y |
A numeric vector containing the dependent variable: usually an allele count for each |
start |
A vector of starting values: u and v for the logit-logistic, μ and ν for the Beta cline, a and b for the Barton cline, and U, L, m, and b for the Richards cline. |
model |
Character string indicating which cline function to fit: |
method |
Character string indicating which algorithm to use to find the MLE: |
iterations |
The desired number of MCMC generations. The larger this number is, the greater the chance that the chain will find the maximum likelihood. |
SD |
Dispersion parameters for the |
headstart |
Logical: if TRUE and |
Grid |
Logical: if TRUE and |
A list:
model |
The cline function used |
method |
The optimization method used |
estimates |
Maximum likelihood parameter estimates |
lnL |
The maximum likelihood and the likelihood of the data given the naive null model |
k |
The number of fitted coefficients |
AICc |
Akaike's information criterion with sample size correction |
convergence |
From |
Benjamin M. Fitzpatrick
Fitzpatrick, B. M. 2012. Alternative forms for genomic clines. In prep
See Cline.fit for application to multilocus data sets and analysis of interclass heterozygosity.
x <- 0:50/50 # hypothetical genomic ancestry proportions y <- rbinom(50,2,x) # random diploid genotypes for a diagnostic marker n=rep(2,50) # sample size is two alleles per diploid individual gcline.fn(x=x,n=n,y=y,start=c(.5,2),model="logit-logit")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.