Lauren. Talluto
26.11.2024
… and so on.
What is the MLE? Is there a logical problem with that?
\[ s \sim Uniform(min = 1, max = N)\]
\[ t(x) = pr(s|N) \sim Uniform(s,N) \]
Algorithm
Algorithm
This is incredibly inefficient
\[ S_t = S_{t-1} + fecundity \times S_{t-1} - mortality \times S_{t-1} \]
\[ pr(\theta | X) \propto pr(X | \theta)pr(\theta) \]
\[ pr(\theta | X) \propto pr(X | \theta)pr(\theta) \]
\[ pr(\theta | X) \propto pr(X | \theta)pr(\theta) \]
\[ pr(\theta | X) \propto pr(X | \theta)pr(\theta) \]
\[ pr(\theta | X) \propto pr(X | \theta)pr(\theta) \]
Algorithm
Define t(x): log unnormalized posterior (i.e, "target") distribution
Define p(x): the proposal distribution
common: rnorm(n = 1, mean = x, sd = proposal_scale)
Choose state[0] (the starting value)
for i in 1:n_samples
candidate = p(state[i-1], proposal_scale)
r = exp( t(candidate) - t(state[i-1])) ## acceptance probability
if r > runif(1) ## coin flip to see if we accept or not
state[i] = candidate
else
state[i] = chain[i-1]
mcmc_hist()
and
mcmc_pairs
(multivariate)sampling
instead of
optimization
.