Write down the likelihood function for the data

Assignment Help Simulation in MATLAB
Reference no: EM131982143

Assignment - Bayesian Inference using the Metropolis Algorithm

In the section, you will use the algorithm you coded in the previous part to make inference given real data. The data (when we will call y) is two-dimensional data, where the first column is X1 and the second column is X2. In the example, we will assume that our data follows a multivariate normal distribution with unknown mean vector μ and unknown covariance matrix ∑.

[X1, X2]T ∼ N(μ, ∑)

You are only given 15 data points (rows). Your job will be to make internees on the unknown parameters of the distribution μ and ∑. To do so, we will do some Bayesian data analysis. In Bayesian inference, all unknown parameters are treated as random variables. The goal is to find the distribution of the unknown parameters given the data. Suppose that we have a vector of unknown parameters θ. From Bayes' theorem, we know the following is true:

p(θ|y) = (p(y|θ)p(θ))/p(y) ∝  p(y|θ) p(θ)

In the above expression, p(y|θ) is the likelihood function, which can be interpreted as "how likely did our data come from this distribution given the parameters θ. p(θ) is the prior distribution of the unknown parameters, which can be interpreted as "what do I know about my parameters before doing any inference". p(y) is a normalizing constant which makes p(θ|y) a valid probability distribution. Our Goal is to understand how our data affected our knowledge about the unknown parameters (hence we want to learn p(θ|y)). The problem is that we often do not have p(θ|y) in a nice closed form which we can draw samples from. This is where the Metropolis algorithm comes in. The goal is draw samples from p(θ|y) using the Metropolis algorithm. Before you do anything, here are the specs you need to follow: (1) Under the assumption that our data points are independent and identitcally distributed, the likelihood function of the data can be written as a product over all data points:

p(y|θ) = n=1ΠN p(yn|θ)

(2) We will exploit the fact that p(y) is fuel a normalizing constant and thus will consider that our target distribution is just π(θ) = p(y|θ)p(θ). With this infomration, the task should now be more clear. Warning: this part of the project is not easy, as you will have to do some thinking/researching on your own.

If you need me to point you to other references, please do not hesitate to ask. Here are the specific tasks:

1. Write down the likelihood function for the data you are given. In other words, what is p(y|μ, ∑).

2. You will assume that the prior distribution p(μ, ∑) = p(μ)p(∑). In other words, we assume that before getting any data μ and ∑ are independent. For μ the prior distribution we will choose is multivariate normal distribution and for ∑ we will use the inverse-Wishart distribution (which is a distribution over matrices). Write down both distributions. What are their parameters?

3. After reading a bunch of studies and obtaining prior knowledge, you think the moan parameter μ should be around [-7, 4.5]T. You also think that the covariance matrix should be around [15, 5; 5, 15]. Can you write down some suitable parameters for the prior that will make the expected values of the priors agree with the prior knowledge?

4. Using this information now, write a function called unnormalizsd_posterker.m in MATLAB which takes in values of μ and ∑ and outputs the evaluated values π(μ, ∑).

5. Run the Metropolis algorithm on this distribution. Keep running the loop until you have accepted 5000 samples. In the samples that have been accepted to do any Inference. From these samples, only use the last 4000. Note: You will struggle to choose a suitable random walk so that the acceptance of the samples is high, especially for the random walk of the matrix. Do some research! Ask Google what are proper proposal/candidtate distribution for unknown mean and covariance matrices!

6. Histogram the samples of μ using the hits3 function in MATLAB.

7. Compute the posterior means of both μ and ∑.

Attachment:- Assignment File.rar

Reference no: EM131982143

Questions Cloud

Calculate the conversion value of each bond : Hilton Hotels, Corp. has a converatble bon issue outstanding. Each bond, with a face value of $1,000 can be converted into common shares at a rate of 61.2983.
Which items increased suffered inflation : Which items increased suffered inflation? Explain the reasons for the increase. Take into account all economic and monetary variables you can.
Describe policy activities around waste management : ENV360 – Environmental Policy and Economics - Compare Waste Management Policy for the UAE and another country of your choice. Describe their policy activities
Discuss about the cycle of change model : If you were required to choose only one step in the Cycle of Change Model as being most important to the success of any major organizational change.
Write down the likelihood function for the data : Bayesian Inference using the Metropolis Algorithm - Write down the likelihood function for the data you are given. In other words, what is p(y|µ, ?)
What concept did you find to be the most enjoyable : Are there any concepts that you continue to struggle with that you would like more resources for before you begin your final exam?
Explain the source or the importance of author within text : Introduce your key sources - mention them or their authors by name, explain the source or the importance of the author within your text.
Describe how you might perform separation : Suppose you have been hired to set up a process for separating large quantities of waste plastic that is a mixture of PETE and HDPE. Describe how you might.
Construct a partial amortization schedule : How many payments are required? Construct a partial amortization schedule showing the details of the last three payments and the totals.

Reviews

len1982143

5/14/2018 6:52:29 AM

Subject: Mtalab. Detailed Question: Just the last part of the assignment which says BONUS PART. Run the Metropolis algorithm on this distribution. Keep running the loop until you have accepted 5000 samples. In the samples that have been accepted to do any Inference. From these samples, only use the last 4000. Note: You will struggle to choose a suitable random walk so that the acceptance of the samples is high, especially for the random walk of the matrix. Do some research! Ask Google what are proper proposal/candidtate distribution for unknown mean and covariance matrices!

Write a Review

Simulation in MATLAB Questions & Answers

  Calculate the stress intensity factor

Use the three-parameter zone finite element method or the boundary collocation method to calculate the stress intensity factor K, at the crack tip for the plate

  Build a simulation using newtons laws of motion

Build a new and different simulation of your own using Newtons laws of motion and Show the code and describe how it works

  Write the specification of load mover

Write the specification of LOAD MOVER detailed of the whole design and precise for automatic control section and divide the design into various modules and Is the kernel required if yes which one?

  Design the automatic control section using statecharts

Aim of this project is to design an embedded system which can move loads from one place to another. The system can be operated manually, automatically and wirelessly.

  Need an expert who can model a drill in simulink

Need an expert who can model a drill in Simulink. Working model of a drill needing for an improvment to behave more realistically as a drill to drill through plastic block.

  Project is on load frequency control using fpid

Project is on load frequency control using FPID tuned using GA and PSO algorithm and the system is a two area system.

  Number of packets received with time

Let x be the number of packets received with time -

  Build a matlab based graphical user interface

Build a Matlab based graphical user interface (GUI) that operates in conjunction with a base Matlab/ Simulink simulation program. Any base simulation is considered acceptable.

  Build a matlab based graphical user interface

Build a Matlab based graphical user interface (GUI) that operates in conjunction with a base Matlab/ Simulink simulation program. Any base simulation is considered acceptable.

  Simulate the standardised sum of independent

Simulate the standardised sum of independent and identically distributed variates - Fit a linear regression model as in Q5, and plot your estimates for β0 and β1 as N increases, together with a line indicating their true values. Supply your code.

  Plot the original periodic square wave

Plot the original periodic square wave on the same graph. Comment on the difference between the original periodic square wave and its truncated Fourier series presentation.

  Use matlab to plot the function

Plot the original periodic square wave on the same graph. Comment on the difference between the original periodic square wave and its truncated Fourier series presentation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd