I am working on a Data Panel project that is about macro volatility, taking into consideration some quality indicators. According to my model, indicators definitely determine macro variables. Data are from 1944 up to 2020 for 50 countries with solid macro variables, quality indicators and lots of dummies.
What I would need is a code/program that solves the stochastic optimization problem(Newton Ramsay or any other), creating a new variable, perhaps discrete and continuous for each time period and for each one of the indicators included, such that it would by optimization find the optimum value of each the indicator that brings the actual GDP to its potential GDP value estimated with the HP filter. In other worlds, to find the optimal value for each of the indicators separately, creating a new variable for each of them and in each period that minimizes the cyclical component.
In simple math setting, say for indicator1:
Find value x of indicator1 such that minimizes (GDP potential -GDP actual) and is equal(=) to zero. I hope this is clear to you. I am fine with any software, thought prefer Matlab Stata or R
Any help if appreciated