# Pedigree likelihood

### Description

Calculates various forms of pedigree likelihoods.

### Usage

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
likelihood(x, ...)
## S3 method for class 'linkdat'
likelihood(x, locus1, locus2=NULL, theta=NULL, startdata=NULL,
eliminate=0, logbase=NULL, ...)
## S3 method for class 'singleton'
likelihood(x, locus1, logbase=NULL, ...)
## S3 method for class 'list'
likelihood(x, locus1, ...)
likelihood_LINKAGE(x, marker, theta=NULL, afreq=NULL, logbase=NULL, TR.MATR=NULL,
initialCalc=NULL, singleNum.geno=NULL)
``` |

### Arguments

`x` |
a |

`locus1` |
a |

`locus2` |
either NULL, the character "disease", or a |

`theta` |
the recombination rate between locus1 and locus2 (in |

`eliminate` |
mostly for internal use: a non-negative integer indicating the number of iterations in the internal genotype-compatibility algorithm.
Positive values can save time if |

`logbase` |
a numeric, or NULL. If numeric the log-likelihood is returned, with |

`marker` |
an integer between 0 and |

`afreq` |
a numeric containing the marker allele frequencies. |

`startdata` |
for internal use. |

`TR.MATR, initialCalc, singleNum.geno` |
for internal use, speeding up linkage computations with few-allelic markers. |

`...` |
further arguments. Not used. |

### Details

All likelihoods are calculated using the Elston-Stewart algorithm.

If `locus2 = NULL`

, the result is simply the likelihood of the genotypes observed at the marker in locus1.

If `locus2 = "disease"`

, the result is the likelihood of the marker genotypes in locus1, given the affection statuses of the pedigree members, the disease model and the recombination rate `theta`

between the marker and disease loci.
The main use of this is for computation of LOD scores in parametric linkage analysis.

If `locus2`

is a marker object, the result is the likelihood of the genotypes at the two markers, given the recombination rate theta between them.

The function `likelihood_LINKAGE`

is a fast version of `likelihood.linkdat`

in the case where `locus2 = "disease"`

and the marker in locus1 has less than 5 alleles.

### Value

The likelihood of the data. If the parameter `logbase`

is a positive number, the output is `log(likelihood, logbase)`

.

### Author(s)

Magnus Dehli Vigeland

### See Also

`lod`

### Examples

1 2 3 4 5 6 7 8 | ```
x = linkdat(toyped, model=1) #dominant model
lod1 = likelihood_LINKAGE(x, marker=1, theta=0, logbase=10) -
likelihood_LINKAGE(x, marker=1, theta=0.5, logbase=10)
lod2 = lod(x, markers=1, theta=0)
# these should be the same:
stopifnot(identical(lod1, as.numeric(lod2)), round(lod1, 2)==0.3)
``` |