Description Usage Arguments Value Note Author(s) References See Also Examples

Log-likelihood of the number of unsampled individuals given the genotypes of offspring and potential parents

1 2 |

`X` |
list for each offspring with elements |

`USdam` |
logical or character; if |

`USsire` |
logical or character; if |

`nUS` |
vector for the size of the unsampled populations. Parmeters for the unsampled female populations come before the male populations. |

`ped` |
optional pedigree with id, dam and sire in ech column |

`USsiredam` |
logical; if |

`shrink` |
optional scalar for the variance defining the ridge-regression likelihood penalisation. |

log-likelihood of the number of unsampled individuals given the genotype data.

Intended to be used within `MLE.popsize`

Jarrod Hadfield [email protected]

Nielsen. R. *et.al* Genetics (2001) 157 4 1673-1682

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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | ```
## Not run:
data(WarblerG)
A<-extractA(WarblerG)
sex<-c(rep("Male", 50), rep("Female", 100))
offspring<-c(rep(0,100), rep(1, 50))
terr<-as.factor(rep(1:50, 3))
id<-1:150
res1<-expression(varPed(x="offspring", restrict=0))
res2<-expression(varPed(x="terr", gender="Female", relational="OFFSPRING",
restrict="=="))
test.data<-data.frame(id, sex, offspring, terr)
PdP<-PdataPed(formula=list(res1, res2), data=test.data)
simped<-simpedigree(PdP)
G<-simgenotypes(A, E1=0, E2=0, ped=simped$ped, no_dup=1)
# remove 25 males at random, leaving 25
rm.males<-sample(1:50, 25, replace=FALSE)
data.rm<-test.data[-rm.males,]
GdPrm<-GdataPed(G=lapply(G$Gobs, function(x){x[-rm.males]}),
id=G$id[-rm.males])
# delete genotype and phenotype records
PdPrm<-PdataPed(formula=list(res1, res2), data=data.rm, USsire=TRUE)
X.listrm<-getXlist(PdP=PdPrm, GdP=GdPrm, A=A, E2=0)
X<-lapply(X.listrm$X, function(x){list(N=c(25,0,1,0),
G=c(sum(x$G[1:25]), 0, x$G[26], 0))})
# each offspring has 1 mother and 25 sampled fathers so the 4 classes are:
# a) 1*25 categories with both parents sampled, 0*25 categries with only
# sires sampled b) 1*1 categories with only dams sired and 0*0 categories
# with both sexes unsampled.
nUS<-seq(10,40, length=100)
nUS_Loglik<-1:100
for(i in 1:100){
nUS_Loglik[i]<-popsize.loglik(X, USsire=TRUE, nUS=nUS[i])
}
plot(nUS_Loglik~nUS, type="l", main="Profile Log-likelihood
for number of unsampled males")
## End(Not run)
``` |

MasterBayes documentation built on July 30, 2017, 1:01 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.