Learn R Programming

NB (version 0.9)

NB.likelihood: Log-likelihood values for the NB estimator

Description

This will return return the log-likelihood value given a value of N.

Usage

NB.likelihood(N, infile, alleles, sample.interval)

Arguments

N
The effective population size dor diploid individuals.
infile
Your input data file in a plain text format. This data contains the allele counts at each locus and from each sampling time point.
alleles
a vector containing the number of alleles at each locus. For example, c(4, 4, 4) would mean that 3 loci are sampled, with 4 alleles each.
sample.interval
a vector stating at which generations the samples were taken. For example, c(0, 8) would indicate that two samples were collected from the 0th and 8th generation.

Value

Details

More details please see NB.estimator.

See Also

NB.estimator.

Examples

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

##SEE WHAT'S THE LOG-LIKELIHOOD VALUE IS WHEN N=1000
NB.likelihood(N=1000, infile='sample_data.txt', 
	alleles=rep(4, 50), sample.interval=c(0, 8))

	#####
	# NUMERICAL RESULT
	#[1] -544.0405
	#####

Run the code above in your browser using DataLab