Estimates given by the lowest SSR found by grid search on a parameter
Posted: Tue Feb 01, 2022 8:00 pm
Hello,
I am estimating a model where the optimal value of one parameter (say beta) is determined using a grid search over a given interval and for which the SSR is minimized. What I am doing is the following: a) I run a regression for each value of beta in the interval using a for next loop and calculate the corresponding SSR; b) I store all the obtained SSRs in a vector; c) I find the lowest element of this vector, that is, the lowest SSR; d) then I rerun my regressions by grid searching over beta (using a new for next loop) and comparing (using an if statement) for each value of beta the SSR with the minimum SSR I found previously; e) when the current SSR matches with the minimum SSR then I exit from the for next loop and I have my optimal estimates and the regression output. .
This approach works well but is a rather heavy to implement. Is there a more easy way to find the vector of estimates corresponding to the lowest SSR found by a grid search over a parameter, a built-in function which does directly the job?
Thanks
I am estimating a model where the optimal value of one parameter (say beta) is determined using a grid search over a given interval and for which the SSR is minimized. What I am doing is the following: a) I run a regression for each value of beta in the interval using a for next loop and calculate the corresponding SSR; b) I store all the obtained SSRs in a vector; c) I find the lowest element of this vector, that is, the lowest SSR; d) then I rerun my regressions by grid searching over beta (using a new for next loop) and comparing (using an if statement) for each value of beta the SSR with the minimum SSR I found previously; e) when the current SSR matches with the minimum SSR then I exit from the for next loop and I have my optimal estimates and the regression output. .
This approach works well but is a rather heavy to implement. Is there a more easy way to find the vector of estimates corresponding to the lowest SSR found by a grid search over a parameter, a built-in function which does directly the job?
Thanks