optimisation.params.peaks: likeLTD::optimisation.params.peaks

Description Usage Arguments Details Value Examples

View source: R/maximize-peaks.R

Description

Creates a list of parameters to use with DEoptim::DEoptim for peak height data.

Usage

1
2
3
4
5
6
7
optimisation.params.peaks(hypothesis, verbose=TRUE, fixed=NULL,
                           logObjective=TRUE, logDegradation=TRUE,
                           arguments=NULL, zero=1e-6, throwError=FALSE,
                           withPenalties=TRUE, doLinkage=TRUE,objective=NULL, iterMax=25, 
                           likeMatrix=FALSE,diagnose=FALSE,DEoptimStrategy=3,
			   searchPopFactor=1,DEoptimF=0.8,DEoptimC=NULL,
				maxDropin=250, minDropin=5, maxDNAcont=NULL,...)

Arguments

hypothesis

Hypothesis from which to perform maximization

verbose

Wether to print likelihood each and every time the objective function is called

fixed

Names of the parameters to keep fixed

logObjective

If TRUE (default), the objective function is the log10-likelihood.

logDegradation

If TRUE (default), the degradation parameters are entered as 10^x

arguments

Initial parameters from which to start the maximization. If NULL, calls initial.arguments.

zero

Epsilon to indicate lower and upper bounds as alpha +/- epsilon that exclude the bound itself

throwError

If TRUE, throws an error if the result is infinite

withPenalties

If TRUE, then penalties are evaluated and used

doLinkage

Logical indicating whether or not to apply a correction for linked loci. This correction is only applied when Q and X are assumed to be siblings i.e. hypothesis$relatedness=c(0.5,0.25). This multiplies the prosecution likelihood by IMP_L/IMP_U, where IMP_L is the inverse match probability with linkage taken into account, and IMP_U is the same but without linkage taken into account.

objective

Objective function produced from create.likelihood.vectors.peaks

iterMax

Number of iterations to run the optimisation for before checking for convergence within each step.

likeMatrix

Whether to return likelihoods for every genotype combination, or a likelihood summed over all genotypes after optimisation. Set to TRUE for individual genotype likelihoods. This is used for get.likely.genotypes.peaks.

diagnose

Logical. If TRUE a list of peak heights, estimated mean peak heights and standard deviation of peak heights is returned by result$fn.

DEoptimStrategy

Parameter to control the strategy used by DEoptim. See DEoptim::DEoptim.control.

searchPopFactor

The population size used by DEoptim is searchPopFactor multiplied by the number of parameters to optimise over.

DEoptimF

Parameter to control differential weighting of DEoptim. See DEoptim::DEoptim.control.

DEoptimC

Parameter to control the speed of crossover adaptation for DEoptim. See DEoptim::DEoptim.control.

maxDropin

Upper bound for the dropin parameter to be used by evaluate.peaks. If you wish to explain a minor cnotributor as dropin this value may need to be greater than the default of 250.

minDropin

Lower bound of the dropin parameter to be used by evaluate.peaks, if dropin modelled.

maxDNAcont

Maximum DNA contribution for all individuals to be used by evaluate.peaks. If NULL, the maximum peak height in the CSP will be used, unless there are no peaks, in which case 5000 will be used. Defaults to NULL.

...

Any named parameter to modify the hypothesis, e.g. nUnknowns

Details

Starting from the hypothesis, it creates a list of arguments which can be applied to DEoptim::DEoptim to obtain the maximum (log-)likelihood of that hypothesis.

It accepts a number of customizations:

In any case, the value returned can always be modified prior to calling evaluate.peaks.

Value

fn

The objective function

lower

Lower bounds for the parameters

upper

Upper bounds for the parameters

control

Control parameters for DEoptim::DEoptim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Not run: 
# datapath to example files
datapath = file.path(system.file("extdata", package="likeLTD"),"laboratory")

# File paths and case name for allele report
admin = pack.admin.input.peaks(
            peaksFile = file.path(datapath, 'laboratory-CSP.csv'),
            refFile = file.path(datapath, 'laboratory-reference.csv'),
            caseName = "Laboratory",
            detectionThresh = 20
             )

# Enter arguments
args = list(
        nUnknowns = 1
        )

# Create hypotheses
hypP = do.call(prosecution.hypothesis.peaks, append(admin,args))
hypD = do.call(defence.hypothesis.peaks, append(admin,args))

# Get parameters for optimisation
paramsP = optimisation.params.peaks(hypP)
paramsD = optimisation.params.peaks(hypD)

# parameters without linkage adjustment
paramsP = optimisation.params.peaks(hypP,doLinkage=FALSE)

## End(Not run)

likeLTD documentation built on May 1, 2019, 7:58 p.m.