I'd like to give a Javascript function an array and then extrapolate forwards by a number of periods -
eg
var numArray = [0,1,2,3,4,5]
var myFunction = function(array,period){}
So myFunction(numArray,7) would return '6' and myFunction(numArray,8) would return '7'
I think I can make this work for a linear least squares, but how would I make it work for a 2nd degree polynomial?
Thank you
MV