Building a program: Faking the data

When I was writing a lab on least-square curve fitting for Calculus III, I ran into a problem.  I needed a bunch of data that fit the curves I was working with (mostly exponential, limited, and logistic growth models) but looked at least moderately realistic.  Of course, one option would have been to look it up or to use some sort of computer based data collection technique to get "real" data.  On the other hand, we can think of this as an experiment in virtual reality, so let's generate our own data.

What I want to design here is a program that will accept a generating function (provided by the user) and some sort of measure of "perturbation" and generate a list of data that could then be manipulated by the students.  Also, it would be nice to plot this data so I can see how closely it fits the generating curve (so I don't make it too far out or too obvious).  Ideally, it should be able to do this for any kind of function I choose.  Let's further assume that I want to ensure that all my data is positive (not necessary, but why not?).

Solution


Converted by Mathematica      April 26, 2002