R How to optimize the transformation parameters in dynamic linear regression?
I have a data-set with a dependent variable y that I'm trying to explain
and n independent variables (X matrix). I'm doing a constrained
multi-linear regression model in R. So instead of using the lm() function,
I'm using optimization packages (genalg, BBoptim, quadprog) to find the
best coefficients (betas) to the model by minimizing the sum of squared
errors SSE, and respecting the constraints. So I'm manually doing OLS.
This is working.
Now the problem is, some of my independent variables are transformed to
capture a lagged effect in time using logistic functions. Which makes my X
matrix dynamic. I want to find the best coefficients of the
transformations and consequently the best betas, such that the SSE is
minimized in the multi-linear regression. In other words, I think i have a
case of dynamic multi-linear regression.
In Excel solver, i used to do the optimization easily but It doesn't seem
to be that easy in R. Any pointers would be highly appreciated.
Thanks, YB
No comments:
Post a Comment