Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
=
sd(N |data) =
â
=
279.1
v
u â
u X
1
t
(N â 279.1)2 c (0.99)N
N
N =203
v
u 1000
u X
1
t
(N â 279.1)2 21.47 (0.99)N
N
N =203
79.6.
2.10c. Many possible solutions here (see Jeffreys, 1961; Lee, 1989; and Jaynes, 1996). One idea
that does not work is the improper discrete uniform prior density on N
P:âp(N ) â 1. This density
leads to an improper posterior density: p(N ) â N1 , for N ⥠203. ( N =203 (1/N ) =
P â.) The
prior density p(N ) â 1/N is improper, but leads to a proper prior density, because N 1/N 2 is
convergent.
Note also that:
⢠If more than one data point is available (that is, if more than one cable car number is observed),
then the posterior distribution is proper under all the above prior densities.
⢠With only one data point, perhaps it would not make much sense in practice to use a noninformative prior distribution here.
normalized density
0.4
0.8
1.2
0.0
2.11a.
dens <- function (y, th){
dens0 <- NULL
for (i in 1:length(th))
dens0 <- c(dens0, prod (dcauchy (y, th[i], 1)))
dens0}
y <- c(-2, -1, 0, 1.5, 2.5)
step <- .01
theta <- seq(step/2, 1-step/2, step)
dens.unnorm <- dens(y,theta)
dens.norm <- dens.unnorm/(step*sum(dens.unnorm))
plot (theta, dens.norm, ylim=c(0,1.1*max(dens.norm)),
type="l", xlab="theta", ylab="normalized density",
xaxs="i", yaxs="i", cex=2)
0.2
0.4
0.6
0.8
1.2
theta
0.8
1.0
[a common
mistake]
0.2
0.4
0.6
0.8
Note: a common error here is to forget to
scale the y-axis from zero, thus yielding a
plot as shown to the left. This is incorrect because it misleadingly implies that
the density goes to zero at θ = 1. When
plotting densities, the y-axis must extend
to zero!
thetas <- sample (theta, 1000, step*dens.norm,
replace=TRUE)
hist (thetas, xlab="theta", yaxt="n",
breaks=seq(0,1,.05), cex=2)
2.11b.
0.0
0.2
0.4
0.6
0.8
1.0
theta
The histogram is jagged because there are only 1000 simulation draws.
9