Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Engineering Mathematics Expert

Bayesian regression problem

Best-fit model is not necessarily the best model. It is important to balance between a good fit to the data and model complexity. The purpose of this exercise is to illustrate this idea via a regression problem, which was discussed.

Table 1 (see appendix) contains 8 observations (values stored as x and y vectors in INPUT.mat). Use load ('INPUT.mat') in MATLAB to read in these values. This matlab file can be downloaded from CCLE course website /problem sets.

We can define all possible polynomial regression models as:

y = β0 + β1x + β2x2 + ? + βp xp + ε, where ε ~ Normal (0, σ2)

In this exercise, we consider seven possible models: p = 0, 1, 2,..., 6.

Our goal is to decide which one of the seven models is the "best" one to explain the observed data. For each model with specific parameters β, "goodness of fit" can be measured by the likelihood term P(y|β,M). Here, β is a vector of regression coefficients, and M indicates a polynomial regression model of order p. Model evidence is evaluated using P(y|M), which describes how likely the data are generated by a polynomial model.

(a) Analyze the goodness of fit of each model M by computing the likelihood for each model, based on the predefined regression coefficients, b provided in INPUT.mat (also listed in Table 2 for each model in appendix, see more detail in appendix).

In statistical terms, likelihood can be understood as how the data are generated/sampled from a model. The assumption that ε follows a normal distribution with zero mean and a constant standard deviation σ tells you the variation in data generation.

We can write the likelihood probability distribution as

yi ~ Normal(y ^i, σ2), where y ^I = b0 + b1xi + b2xi2 + ? + bp xip

Here, y ^i (called "y-hat") is the predicted value for the ith observation on y. We further assume that each data point is independently sampled. Then, for a particular regression model M with order p, the likelihood is given by

P(y|β, M)= i=18?(yi; y ^i, σ2)

?(x; μ, σ2) refers to the probability density function of the normal distribution (i.e., norm pdf function in MATLAB) with mean μ and standard division σ. Please use σ=5 for your likelihood calculation.

Since likelihoods across different models could differ by orders of magnitude, for a better illustration, it is more advantageous to plot the natural logarithm of the likelihoods instead of the raw likelihood values. Present a plot of log-likelihood against the orders of polynomial p. What trend do you observe from the log-likelihood plot? Which model gives you the "best fit"?

(b) Evaluate each model M by its model evidence P(y|M), which is given by

P(y|M)= -∞∫+∞P(y|β, M)P(β)dβ

Computing this integral analytically is hard. Instead, we use the discrete approximation:

-∞∫+∞P(y|β, M)P(β)dβ  ≈  1/N j=1N P(y|βj, M)

To simplify your calculation, we assume the prior P(β) to be a uniform distribution, i.e., βk~Uniform(A,B), where A = bk - 0.5, and B = bk + 0.5, for k = 0, 1, ..., p (p is the order of the polynomial regression of model M, bk is the kth value in Table 2 for each Model M).

Using sampling approach to implement the Bayesian model. Sample N sets of β values for each model M according to the prior distribution. For each sampled βj, compute P(y|βj, M), which is given by the likelihood equation. Use N = 500.

Present a bar chart of model evidence against the orders of polynomial p. Which model gives you the highest model evidence?

(c) Write a short paragraph to discuss which regression model is the best for this set of data.

Attachment:- Assignment.rar

Engineering Mathematics, Engineering

  • Category:- Engineering Mathematics
  • Reference No.:- M92019072

Have any Question?


Related Questions in Engineering Mathematics

Q undirected vs directed connectivitya prove that in any

Q: Undirected vs. directed connectivity. (a) Prove that in any connected undirected graph G = (V, E) there is a vertex v ? V whose removal leaves G connected. (Hint: Consider the DFS search tree for G.) (b) Give an examp ...

Analytical methods for engineers assignment - calculusthis

ANALYTICAL METHODS FOR ENGINEERS ASSIGNMENT - CALCULUS This assignment assesses Outcome - Analyse and model engineering situations and solve problems using calculus. Questions - Q1. Differentiate the following functions ...

Question suppose that g is a directed graph in class we

Question : Suppose that G is a directed graph. In class we discussed an algorithm that will determine whether a given vertex can reach every other vertex in the graph (this is the 1-to-many reachability problem). Conside ...

Assignment - lp problemsthe data for all the problems in

Assignment - LP problems The data for all the problems in this HW are included in the LP_problems_xlsx spreadsheet. Problem 1 - Cash Planning A startup investment project needs money to cover its cash flow needs. At the ...

Question a suppose that you are given an instance of the

Question : (a) Suppose that you are given an instance of the MST problem on a graph G, with edge weights that are all positive and distinct. Let T be the minimum spanning tree for G returned by Kruskal's algorithm. Now s ...

Show all your work not just the answerswhen you multiply 21

(SHOW ALL YOUR WORK, not just the answers) When you multiply: 21 x 68 you most likely do: 8x1 + 8x20 + 60x1 + 60x20 = 1, 428 So, there are 4 multiplications and then 3 additions. How long would it take a computer to do t ...

Problem 1given a sequence xn for 0lenle3 where x0 1 x1 1

Problem # 1: Given a sequence x(n) for 0≤n≤3, where x(0) = 1, x(1) = 1, x(2) = -1, and x(3) = 0, compute its DFT X(k). (Use DFT formula, don't use MATLAB function) Use inverse DFT and apply it on the Fourier components X ...

Question a signal starts at point x as it travels to point

Question : A signal starts at point X. As it travels to point Y, it loses 8 dB. At point Y, the signal is boosted by 10 bB. As the signal travels to point Z, it loses 7 dB. The dB strength of the signal at point Z is -5 ...

All these questions should be answered in matlab 1 generate

All these questions should be answered in MATLAB !!! 1. Generate a set of 3 random patterns of dimension 12 where each value is +1 or -1.(3 random 12*12 matrix) 2. Create a 12-unit Hopfield network (a 12x12 matrix) from ...

Question suppose g is an undirected connected weighted

Question : Suppose G is an undirected, connected, weighted graph such that the edges in G have distinct edge weights. Show that the minimum spanning tree for G is unique.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As