Question: Coded in MATLAB please 1. Generate the training set: a. NTrain=10 b. XTrain contains samples from a uniform distribution U(0,1). c. tTrain=sin(2XTrain)+, where is drawn

Coded in MATLAB please
1. Generate the training set: a. NTrain=10 b. XTrain contains samples from a uniform distribution U(0,1). c. tTrain=sin(2XTrain)+, where is drawn from a Gaussian (Normal) distribution N(0,=0.3). 2. Generate the test set: a. NTest=100 b. XTest contains samples from a uniform distribution U(0,1). c. tTest=sin(2XTest)+, where is drawn from a Gaussian distribution N(0,=0.3). 3. Use the method of linear regression with non-linear models to fit polynomials of degree M=0,1,2,,9 to the training set. 4. Record the training and testing errors for each of the 10 cases. 5. Produce the plot as shown below, where ERMS=J(w)/N 6. Repeat the exercise for NTrain=100. Upload your .m or .py file to Blackboard prior to the deadline. Name your files as Lastname_Firstname_Project2.*
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
