Tuesday
September 2, 2014

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

MATLAB MATH HELP HELP HELP HELP HELP HELP - Write three functions, AppEval, ...
statistics...Please help - A sample of 12 measurements has a mean of 24 and a ...
statistics - A sample of 12 measurements has a mean of 20 and a standard ...
Statistics - A sample of 12 measurements has a mean of 24 and a standard ...
statistics - A sample of 12 measurements has a mean of 34 and a standard ...
statistics - Below are six data sets with 6 randomly selected scores in each ...
Statistics - A sample of 12 measurements has a mean of 34 and a standard ...
Statistics - Which of the following criteria must be met to do a one-proportion ...
qnt/351 - Which of the following statements about the two sample sizes is NOT ...
statistics college - suppose we have a set of blood pressure set with a mean of ...

Search
Members