I want to let the gradient be a constant, say $3$ and then regress on the offset. Its obvious that one can do GD (or SGD) on something like the L2 loss of this. But this seems such an easy problem that I thought there should be something simpler that uses linear algebra. Is there?
Obviously:
$$ \theta = X^{-1}y$$
doesn't work since $\theta = [3 , c]$ since that doesn't respect the gradient being some constant value.