If you want to fit a polynomial to a set of data points, there are many options available including least squares fitting, gradient descent, and lagrange interpolation.
However, thinking in more programmer / computer science terms, let's say that I had something more like a pseudo random number generator where it had some internal state, and when you ran a function, it would do an operation, update the internal state and spit out a new value. (Note, I'm not trying to make a prng, just using it as an example of the type of function I'd like to fit to my data)
Are there any methods other than brute force for creating (or iteratively training, ala gradient descent) a system like that to give something close to a specific sequence of desired output values?
For example, a simple feedback function may look something like this in C++:
float SequenceGenerator()
{
// internal storage
static float internalState = 16.371f;
// adjust the internal storage
internalState += internalState * 83.12f;
// keep the internal storage <= 100
while(internalState > 100.0f)
internalState -= 100.0f;
// return the next value in the sequence
return internalState;
}
I definitely see how i could choose some random value for the initial values for the starting state, and the multiplication amount. I can also see how I could compare the values that come out to my sequence and come up with something like a mean squared error.
I'm not sure however, how I might be able to do something like calculate a gradient to adjust those values to iteratively minimize the mean squared error.
Is there a way to do something like this?
(I can't seem to find appropriate tags other than PRNG, please let me know if there are better tags or feel free to edit)