On Wed, 29 Aug 2012, Jan Tille wrote: > Dear gretl users, > > first of all let me thank you, that you have already provided me with > solutions on other topics. Unfortunately, I need your help again.
No problem, that's what the mailing list is for. > The problem I am now trying to solve is the following. [... rolling regression with constraints ...] IMHO, your problem can be solved, once it's stated less ambiguously. Allow me to explain (and to apologise in advance for being pedantic). Suppose you have 3 regressors instead of 10. Then you have y_t = b0 + x_{1t} b1 + x_{2t} b2 + x_{3t} b3 + u_t Let's call this model U (for unrestricted). Once you impose the restriction b1+b2+b3=1, you can write the same model as y_t - x_3 = b0 + (x_{1t} - x_{3t}) b1 + (x_{2t} - x_{3t}) b2 + u_t Call this model R (restricted). Running OLS on model R, you get exactly the constrained estimates you're after. Then, you can recover you estimate of b3 as 1 - b1 - b2 and compute its standard error as sqrt(V(b1+b2)), which is easy to do. Do you want to NOW drop those coefficients whose t-statistic is less than a predefined threshold? But in this case, the remaining ones won't sum to 1 anymore. Or perhaps, you want run model R, trim it to your liking and then compute b3 as 1 - (sum of surviving betas). But then, what guarantee do you have that that b3 will itself be significant? Because if it isn't, you have the option of dropping it (and have the sum being different from 1) or keeping it (but why should you treat b3 specially?). Or maybe you want to run model U first, drop the "excess" variables and then force the coefficients to sum to 1? Because in this case, you have no guarantee that the surviving coefficients will be "significant" (whatever that means). I don't mean to be patronizing, but I think that before you think of the hansl syntax to do what you want, you should think a little harder about what you actually want! :) -------------------------------------------------- Riccardo (Jack) Lucchetti Dipartimento di Economia Università Politecnica delle Marche (formerly known as Università di Ancona) r.lucchetti(a)univpm.it http://www2.econ.univpm.it/servizi/hpp/lucchetti --------------------------------------------------