I need to create a software algorithm to calculate cubic or quartic regression on an array of values, but it's been a while since my last stats class. I remember steps for linear regression with least squares, but I'm having a hard time finding steps to calculate the cubic or quartic regression. Essentially, I need to take their data points and generate a y=x type formula. If anyone could point me in the right direction I'd appreciate it. Thanks.