I'm trying to figure out gradient descent with Octave. With each iteration, my thetas get exponentially larger. I'm not sure what the issue is as I'm copying another function directly.
Here are my matrices:
X = 1 98
1 94
1 93
1 88
1 84
1 82
1 79
y = 97
94
94
78
85
85
76
theta = 1
1
I'm using this formula:
theta = theta - 0.001 * (1 / 7) * (X' * (X * theta - y))
I figured out what the optimal thetas are using the normal equation, but after only a few iterations my thetas are in the several thousands. Any idea what's wrong?