Question: In this problem, we numerically calculate a posterior distribution. Suppose the stimulus distribution ps ( s ) is Gaussian with mean 2 0 and standard

In this problem, we numerically calculate a posterior distribution. Suppose the stimulus distribution ps(s) is Gaussian with mean 20 and standard deviation 4. The measurement distribution px|s(x|s) is Gaussian with standard deviation \\sigma =5. A Bayesian observer infers s from an observed measurement Xobs =30. We are now going to calculate the posterior probability density using numerical methods.
We expand on the previous problem by varying the stimulus distribution. Start with the code from the previous problem. Suppose the stimulus distribution ps(s) is uniform on the interval [15,25] and 0 outside this interval. The measurement distribution px|s(x|s) is Gaussian with standard deviation \\sigma =5. A Bayesian observer infers s from an observed measurement xobs =30. We are again going to calculate the posterior probability density numerically.
a) What is the value of p(s) on the interval [15,25]?
b) Define a vector of hypothesized stimulus values s: (0,0.2,0.4,...,40).
c) Compute the likelihood function and the prior on this vector of s values.
d) Multiply the likelihood and the prior pointwise.
e) Divide this product by its sum over all s (normalization step).
f) Convert this posterior probability mass function into a probability density function by dividing
by the step size you used in your vector of s values (e.g.,0.2).
g) Plot the likelihood, prior, and posterior in the same plot.c) Is the posterior Gaussian?
h) Numerically calculate the mean of the posterior.
i) Numerically calculate the variance of the posterior

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!