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
. E.g., for individual diploid data, n=2
.x
"logit-logit"
, "Beta"
, "Barton"
, "multinom"
, "logistic"
or "Richards"
"L-BFGS-B"
and "SANN"
are used by the native optimization function optim
, "mcmc"
is a Markov Chain Monte Carlo using Metropolis-Hastings sampling. If "mcmc"
is used, the following four items are also used.
"mcmc"
and "SANN"
methods. In these methods, new parameter values are proposed by drawing values from normal distributions centered on the current value and with standard deviations from SD
.
method="mcmc"
or "SANN"
, starting values will be found by first using optim
with "L-BFGS-B"
.
method="mcmc"
and model="Beta"
, starting values for the Markov Chain will be found by finding the highest likelihood on a 100 x 100 grid made by mu <- seq(from=0.02,to=0.90,length.out=10); nu <- 2^(0:9)/10
.
E(y)=x
optim
: 0 means the algorithm thinks it did a good job, otherwise the MLE may be incorrect. If mcmc
was used, this will be the full Markov Chain, which could be analyzed for convergence (e.g., see coda
).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")
Run the code above in your browser using DataLab