Dear Stata uses,
I am having a constant optimization problem to solve in Stata
I am having three variables. Lp, gdp and hpgdp. Lp is a quality variable, gdp and hpgdp contain data. hpgdp is the filtered data for gdp with Hodrick Prescott filter.

I need to generate a new var for Lp such that gdp reaches hpgdp..
In simply words what's the optimal values for Lp in order gdp to reach hpgdp
Dataset is an unbalanced panel.

I would appreciate any help
Best
Mario