Learn R Programming

NB (version 0.9)

NB.plot.likelihood: Plot profile (log)-likelihood

Description

This function does not maximise the likelihood function but rather provide a range of log-likelihood values as a function of effective population size.

Usage

NB.plot.likelihood(infile, alleles, sample.interval, lb, ub, step, plotit = TRUE)

Arguments

infile
The input data. Please refer to infile from NB.estimator.
alleles
Number of alleles at each locus. Please refer to alleles from NB.estimator.
sample.interval
Please refer to sample.interval from NB.estimator.
lb
The lower bound of N.
ub
The upper bound of N.
step
How many points do you want to evaluate at.
plotit
Do you want to plot the log-likelihood out?

Value

Returns a range of log-likelihood values with the associated effective population size. If plotit==TRUE then a plot of the log-likelihood will also be produced.

Details

The input arguments infile, alleles, and sample.interval have the same definitions as those in NB.estimator.

See Also

NB.estimator.

Examples

Run this code
## CREATE SAMPLE DATASET
NB.example.dataset()

## PLOT THE LOG-LIKELIHOOD
NB.plot.likelihood(infile='sample_data.txt', alleles=rep(4, 50), 
	sample.interval=c(0, 8), lb=300, ub=2000, step=200)

Run the code above in your browser using DataLab