Hi, can somebody help me with this? The material is based on Pattern Recognition and Machine Learning by Bishop. The fitting_N20 csv is as follows:
1 | 0 | 0.991459 |
2 | 0.105263 | 0.360328 |
3 | 0.210526 | 0.558448 |
4 | 0.315789 | 0.26556 |
5 | 0.421053 | -1.3642 |
6 | 0.526316 | -1.98388 |
7 | 0.631579 | -1.55182 |
8 | 0.736842 | -0.02016 |
9 | 0.842105 | 1.164831 |
10 | 0.947368 | 1.090539 |
11 | 1.052632 | 1.925967 |
12 | 1.157895 | 1.031809 |
13 | 1.263158 | 0.099923 |
14 | 1.368421 | 0.608555 |
15 | 1.473684 | -0.70144 |
16 | 1.578947 | 0.566558 |
17 | 1.684211 | 1.998774 |
18 | 1.789474 | 1.423031 |
19 | 1.894737 | 2.386509 |
20 | 2 | 3.199598 |
5. Suppose we have a data set D= (zu, t), c = (21.--. ,IN), t = (t1,- tn) generated by li=/(C) + noise, where f: R+R is an unknown function of interest and N is the number of data points given. We can assume the noise is some Gaussian noise with mean zero, i.e. each noise is independent of each other and N10,3--) for some unknown parameter 3 > 0. Figure 1 shows the data provided with N = 20. We would like to use this 2 1 0 - 1 -2 0.00025 0.50 0.75 100 125 150 175 2.00 l'igure 1: Scatter plot of fitting N20.cev. data set to approximate f using a function of the form y(x, w) 20+*+2.1 + ... + M-wr, where M 2 (degree of the polynomial) and w = (, 2, ...UM) e R$+1 (polynomial coefficients) are parameters to be determined by you. Use everything we taught in class and reference to textbook 31.1 and $1.2.5) to finish the following tasks. (a) Formulate the problem into a minimization or maximization problem. What is your cost function? (Feel free to add regularizer if you deem suitable.) Your answer to this question should be handwritten math equations or typed in INTEX (b) Read the data into your program from the csv file fitting-N20.csv and create a plot similar to Figure 1. (c) Solve the problem numerically, that is, write a program that takes the data in fitting N20.csv and compute the corresponding optimal cocificients w* = (10. 1, wg:...). Write down your plan for solving this problem in math equations or pseudocode (or type in LATEX) for partial credit. (Note: The lecture on 6/29 will likely help with this solution. You may need to rcad ahead to do this problem in advance.) (d) Plot your fitting function y(x, w) as a curve alongside the data. The following graph in Figure 2 is an example for you. 1 0 -1 -2 0.00 0.25 0.50 0.75 100 125 150 175 2.00 Figure 2: Sample plot for task (d). (e) What is your choice of M? Why? You can performed the above tasks with a few different choices of M, or give a convincing heuristic argument, 5. Suppose we have a data set D= (zu, t), c = (21.--. ,IN), t = (t1,- tn) generated by li=/(C) + noise, where f: R+R is an unknown function of interest and N is the number of data points given. We can assume the noise is some Gaussian noise with mean zero, i.e. each noise is independent of each other and N10,3--) for some unknown parameter 3 > 0. Figure 1 shows the data provided with N = 20. We would like to use this 2 1 0 - 1 -2 0.00025 0.50 0.75 100 125 150 175 2.00 l'igure 1: Scatter plot of fitting N20.cev. data set to approximate f using a function of the form y(x, w) 20+*+2.1 + ... + M-wr, where M 2 (degree of the polynomial) and w = (, 2, ...UM) e R$+1 (polynomial coefficients) are parameters to be determined by you. Use everything we taught in class and reference to textbook 31.1 and $1.2.5) to finish the following tasks. (a) Formulate the problem into a minimization or maximization problem. What is your cost function? (Feel free to add regularizer if you deem suitable.) Your answer to this question should be handwritten math equations or typed in INTEX (b) Read the data into your program from the csv file fitting-N20.csv and create a plot similar to Figure 1. (c) Solve the problem numerically, that is, write a program that takes the data in fitting N20.csv and compute the corresponding optimal cocificients w* = (10. 1, wg:...). Write down your plan for solving this problem in math equations or pseudocode (or type in LATEX) for partial credit. (Note: The lecture on 6/29 will likely help with this solution. You may need to rcad ahead to do this problem in advance.) (d) Plot your fitting function y(x, w) as a curve alongside the data. The following graph in Figure 2 is an example for you. 1 0 -1 -2 0.00 0.25 0.50 0.75 100 125 150 175 2.00 Figure 2: Sample plot for task (d). (e) What is your choice of M? Why? You can performed the above tasks with a few different choices of M, or give a convincing heuristic argument