atgagcgccgttcccgatatccccggcggccccgcgcagcggctggc ccaggcctgcgatgcgctgcgattgccggccgacgccggccagcagc agaagctgctgcgctatatcgagcaaatgcagcgctggaaccgcacg tacaacctgactgccatccgggatccggggcagatgctcgtgcagca cctgttcgacagtctgtcggtcgtggcgccgctggagcgtggcctgc ccggcgtggtgctggccatcatgcgcgcccattgggacgtcacatgc gtggacgcagtcgagaagaaaaccgcattcgtgcgacagatggccgg cgcgctcggactgcccaatctgcaggccgcgcatacccgtatcgaac agctcgaaccggcgcaatgcgacgtggtgatatcgcgtgcgttcgct tcgttacaggacttcgcgaagctggccggccgccacgtgcgcgaggg tggtaccctcgtcgccatgaagggcaaggtgcccgatgacgaaatcc aggcgttacagcaacacggccactggacggtcgaacggatcgaaccg ttggtggtgccggcactcgacgcgcaacgctgcctgatatggatgcg acgcagtcaaggaaacata
Suppose that is a -dimensional sampling distribution then we can express the multinomial density as
where and . Note that this is from the multi-parameter exponential distribution shown by Equation (4.1) with and
Suppose that where and then we can express the Dirichlet distribution as
where can be counts and is the normalising constant.
It is easy to see that these two distributions are conjugate because
The marginal parameters of the Dirichlet are marginally Beta as described below
The number of taxis that pass per minute over a 50 minute interval are recorded as:
Number of taxis | 0 | 1 | 2 | 3 | 4 | 5 |
Freq | 10 | 12 | 11 | 10 | 5 | 2 |
If the events of taxis passing can be assume iid and from a Poisson distribution. Find the expected rate of a arrival and a 95% CI for that rate of arrival assuming anon-informative prior for .
What is the posterior probability of the proportion of DNA bases shown below given a non-informative prior?
What are the marginal distributions ie ?
atgagcgccgttcccgatatccccggcggccccgcgcagcggctggcccaggcctgcgatgcgctgcgattgccggccgacgccggccagcagc agaagctgctgcgctatatcgagcaaatgcagcgctggaaccgcacgtacaacctgactgccatccgggatccggggcagatgctcgtgcagca cctgttcgacagtctgtcggtcgtggcgccgctggagcgtggcctgcccggcgtggtgctggccatcatgcgcgcccattgggacgtcacatgc gtggacgcagtcgagaagaaaaccgcattcgtgcgacagatggccggcgcgctcggactgcccaatctgcaggccgcgcatacccgtatcgaac agctcgaaccggcgcaatgcgacgtggtgatatcgcgtgcgttcgcttcgttacaggacttcgcgaagctggccggccgccacgtgcgcgaggg tggtaccctcgtcgccatgaagggcaaggtgcccgatgacgaaatccaggcgttacagcaacacggccactggacggtcgaacggatcgaaccg ttggtggtgccggcactcgacgcgcaacgctgcctgatatggatgcgacgcagtcaaggaaacata
a | c | g | t |
---|---|---|---|
74 | 141 | 140 | 70 |
Instead of and being fixed, we assume that both change over time:
. The sequential updates of the hyper-parameters of are very straightforward. Let be the sufficient statistics on day and be the crime statistics on day .
where
#R code for sequential updates of alpha. alpha=rep(1,P); mn=matrix(0,N,P); uq=matrix(0,N,P) lq=matrix(0,N,P);uq=matrix(0,N,P) while (t<N) { i=i+1 alpha=alpha+as.numeric(y[i,]) mn[t,]=qbeta(rep(.5,P),p1,sum(alpha)-alpha) uq[t,]=qbeta(rep(.995,P),p1,sum(alpha)-alpha) lq[t,]=qbeta(rep(.005,P),p1,sum(alpha)-alpha) }
C_DRUGS | C_SHOTS | BURGLARY | DISCONDUCT | LARCENY | MVTHEFT |
8 | 2 | 10 | 8 | 33 | 19 |
7 | 0 | 10 | 10 | 33 | 14 |
1 | 1 | 13 | 7 | 29 | 31 |
11 | 1 | 10 | 3 | 27 | 16 |
6 | 1 | 7 | 14 | 22 | 26 |
6 | 3 | 11 | 14 | 28 | 22 |
Attribute | Definition | |
---|---|---|
1 | AGGS | Agrrevated assault |
2 | ARSON | Arson |
3 | BURGLARY | Burglary |
4 | CMIS | Criminal mischief |
5 | DRUGS | Drug offense |
6 | GAMBLING | Gambling |
7 | LARCENY | Larceny |
8 | MENACING | Menacing |
9 | MVTHEFT | Motor vehicle theft |
10 | MURDER_MANSLAUGHTER | Murder/manslaughter |
11 | DISCONDUCT | Discoduct |
12 | RAPE | Rape |
13 | ROBBERY | Robbery |
14 | SIMPASS | Simple Assault |
15 | TRESPASS | Trespassing |
16 | WEAPONS | Weapons charges |
17 | VCI | ARSON, CMIS, DRUGS, DISCONDUCT, SIMPASS,WEAPONS |
18 | P1P | AGGASS, MURDER, RAPE, ROBBERY |
19 | P1V | BURGLARY, LARCENY, MVTHEFT, ROBBERY |