Wednesday
June 19, 2013

Homework Help: Python Programming

Posted by Anonymous on Sunday, January 13, 2013 at 2:50am.

We have created a set of data values that sample a function y(x). The sample points are stored in two arrays: xVals and yVals. These represent measurements of a physical process that is subject to noise so that if a is the i'th entry of xVals (i.e. a = xVals[i]) then yVals[i] is an approximation of y(a).

Write a procedure called findOrder that finds the lowest order polynomial model that fits the data to an accuracy of 1.0e-1, as measured by the residual error. findOrder should return the array of coefficients provided by pylab.polyfit. Recall that pylab.polyfit takes as arguments an array of x values, an array of y values, a degree of polynomial fit, and an optional argument full, which, if True, will cause pylab.polyfit to return:

an array of coefficients
the residual of the fit
Three additional parameters that should not concern you.

You may assume that the modules pylab and numpy are already imported into the environment. You may use anything you wish from the numpy module, but only pylab.polyfit and pylab.array are available from the pylab module.


def findOrder(xVals, yVals, accuracy = 1.0e-1):
# Your Code Here

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

math - The following is a set of data from a sample of n = 5: 7 4 9 8 The ...
statistics college - suppose we have a set of blood pressure set with a mean of ...
Statistics - Select a random sample of 30 student responses to question 6, "...
Statistics - Select a random sample of 30 student responses to question 6, "...
statistics - Find 10-th, 60-th and 75-th percentiles in each of your data set, ...
statistics - For this discussion you will need to come up with twenty different ...
science - can please someone check my answer. which 2 statements are true A)...
statistics - Job Sat. INTR. EXTR. Benefits 5.2 5.5 6.8 1.4 5.1 5.5 5.5 5.4 5.8 5...
python programming - Explain in python programming (x^n-1)/(x-1) = x^(n-1)+x^(n-...
Statictics - 2. Herpetologists (snake specialists) found that a certain species ...

For Further Reading

Search
Members
Community