Write your observations from the plot

Assignment Help Python Programming
Reference no: EM133640096

Scientific Computing

Instruction:

You may use MATLAB or Python for writing your programs. You are allowed to use the library function for calculating the matrix inverse, but are not allowed to use any library functions for calculating the pseudo or Moore-Penrose inverse.

Upload all your programs to the homework dropbox (do not put this in a word document or a pdf file. I'll should be able to run your programs for evaluation)

Learning Objective: To understand that there may exist a unique solution for a square matrix system of equations (using matrix inverse) and there exists a unique least squares solution to a rectangular matrix system of equations when there are more number of training data than the number of unknown model parameters to be estimated.

Homework Problem:

Question 1. Write a program to determine a unique polynomial function y(x) that passes through all the given data {(x1, y1), . . . , (xn, yn)}, for an arbitrary choice of n. Confirm that your estimates of the model parameters agree with the data by plotting the model predicted values of yi for various values of xi.

Data Generation : To evaluate your algorithms (programs), generate test data

{(xi, yi)}i=1n that has a cubic relationship as follows:

(a) Let the underlying relationship between variables xi (independent) and yi (dependent) be cubic. i.e. yi = β0 + β1xi + β2x2 + β3x3.

(b) Choose any non-zero values for the model parameters β0, β1, β2 and β3.

(c) Generate exactly 4 unique data points from the cubic model: {(xi, yi)}4i=1, where yi = β0 + β1xi + β2x2 + β3x3. For example, choosei xi = {-2, 0, 2, 4} ; β0 = 3; β1 = -1; β2 = -3 and β3 = 1 and estimate the model predicted values yi. i.e. these data points lie exactly on the cubic model. (ancillary question: how should one choose {xi}4i=1 for simulating the data governed by the model?)

Model validation

(a) Plot the data {(xi, yi)}4 i=1 used for estimating the model parameters {βi, i = 0, . . . , 3}

(b) Once the model parameters are estimated, estimate yˆi for {xi = -2, -1.9, -1.8, . . . , -0.1, 0, 0.1, . . . , 3.8, 3.9, 4.0}

(c) In the same figure, plot the data {(xi, y^i)} predicted by the model in the previous step.

(d) Write your observations from the plot as well as by comparing your parameter estimates with the true model parameters.

Question 2: Write a program to determine a polynomial function y(x) that passes through all the given data {(x1, y1), . . . , (xn, yn)} in a least squared error sense as discussed in class (for an arbitrary choice of n). Confirm that your estimates of the model parameters agree with the data by plotting the model predicted values of yi for various values of xi

Data Generation : To evaluate your algorithms (programs), generate test data {(xi, yi)}ni=1 that has a cubic relationship as follows:

a) Same as in the first problem.
b) Same as in the first problem.
c) Same as in the first problem.
d) Add random variations to each of the data points as follows:

yi = β0 + β1xi + β2x2 + β3x3 + ∈i, where the random variable ∈i follows a normal distribution with 0 mean and σ standard deviation. i.e. ∈i ∼ Normal(0, σ2). You can choose any variance σ, e.g. σ = 2. Hint: In Matlab, you can use eps = normrnd(mu, sigma, n) to draw n random ∈i from a normal distribution with mean mu = 0 and standard deviation sigma.

Model validation:

(a) Plot the data {(xi, yi)}4i=1 used for estimating the model parameters {βi, i = 0, . . . , 3}

(b) Once the model parameters are estimated, estimate yˆi for {xi = -2, -1.9, -1.8, . . . , -0.1, 0, 0.1, . . . , 3.8, 3.9, 4.0}

(c) In the same figure, plot the data {(xi, yˆi)} predicted by the model in the previous step.

(d) Write your observations from the plot as well as by comparing your parameter estimates with the true model parameters.

 

Reference no: EM133640096

Questions Cloud

What are the causes for his cognitive impairment : What are the causes for his cognitive impairment? How does his depression and cognitive problems affect his diabetes self-management?
Identifying assertions at risk and developing appropriate : Research information about the selected company Address particular areas of the audit process and develop appropriate audit procedures
How you will fulfill the requirements of the rfp you chose : Develop a project plan detailing how you will fulfill the requirements of the RFP you chose and the project proposal you created (Milestone Three).
How it impacts the delivery of health care services today : Respond to the following: Select 1 law or regulation and describe its history as well as how it impacts the delivery of health care services today.
Write your observations from the plot : Write your observations from the plot as well as by comparing your parameter estimates with the true model parameters.
What recommendations using theories : Analyse How Zurich insurance group can improve on their sustainability or diversity and inclusion? What recommendations using theories.
Create the project management documents : Create the project management documents needed to successfully lead a project.
Whats example of workplace violence : Whats an example of workplace violence that you have experienced?
Discuss the pricing strategy you plan to use : How you will use the sales cycle to approach it as you establish your consulting business. Discuss the pricing strategy you plan to use.

Reviews

Write a Review

Python Programming Questions & Answers

  Results of the golf tournament played at the end of march

Write a program to gather, then display the results of the golf tournament played at the end of March. The Club president Mr. Martin has asked you to write two

  Make a program that represents a number of bytes

Write a function, size_format, that takes an integer, b, that represents a number of bytes and returns a readable string representation of this number of bytes.

  Write a program that reads a word and prints each character

Write a program that reads a word and prints each character of the word on a separate line. For example, if the user provides the input Harry the program.

  Write program that is capable of generating a set words

You will write a Python program that is capable of generating a likely set of completion words given the start of a word as input to the program.

  Simulate a tally counter that can be used to admit a limited

Simulate a tally counter that can be used to admit a limited number of people. First, the limit is set with a call def setlimit self, maximum.

  Creating an application that simulates a banking interface

ITECH1400 - Foundations of Programming Assignment - FedUni Banking. Creating an application that uses a GUI that simulates a simple banking interface

  Display the dollars and quarters and dimes and nickels

Display the dollars, quarters, dimes, nickels, and pennies that the customer should receive in return. In order to avoid roundoff errors.

  Explain how python programming language will use a function

Explain how the Python programming language will use a function to display the following statement on the screen: I am programming.

  Produce meaningful theoretical and practical driven solution

Produce a meaningful theoretical and practical driven solution for potential or actual AI problem, which show the necessary understanding of the elements

  Deep learning in python

Read the background material on deep learning and on deep learning in Python - Deep Learning Assignment - Develop alternate models from the template

  Define a definition for the function and recursive function

Define a definition for the function, pow(x, N), to compute x N for integer x and integer N, e.g. 3 1001 . Write a recursive function.

  Build a distributed data storage system

CMT202 Distributed and Cloud Computing, Cardiff School - Demonstrate and apply knowledge about the state-of-the-art in distributed-systems architectures

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