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

Description Usage Arguments Details Value Note See Also Examples

View source: R/NB.plot.likelihood.R

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

1
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?

Details

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

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.

Note

This would be a good way to examine whether the maximization converges to the global maximum.

See Also

NB.estimator.

Examples

1
2
3
4
5
6
## 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)

NB documentation built on May 2, 2019, 1:29 p.m.