I'm trying to estimate a non-linear Seemingly Unrelated Regressions (SUR) model with 5 equations in R
, and I was working over the package systemfit
. Everything goes well until it needs to set some restrictions on my equations. using the package systemfit
, the function nlsystemfit()
it works for non-linear equations. But the option/parameter restrict.matrix
it's not allowed for nlsystemfit()
(it works for linear equations in the function systemfit()
).
A simplified example is (I think show the data is irrelevant here):
EQ_1 <- Y1 ~ (c1 - x)*Q + c11*G11 + c12*G12 + c13*G13
EQ_2 <- Y2 ~ (c2 - x)*Q + c21*G11 + c22*G12 + c23*G13
EQ_3 <- Y3 ~ (c3 - x)*Q + c31*G11 + c32*G12 + c33*G13
start.values <- c(c1 = 0,c2= 0,c3 = 0,
c11 = 0,c12 = 0,c13 = 0,
c21 = 0,c22 = 0,c23 = 0,
c31 = 0,c32 = 0,c33 = 0)
model <- list(EQ_1 ,EQ_2 ,EQ_3)
model.sur <- nlsystemfit(method = "SUR",
eqns = model,
startvals = start.values,
data = as.data.frame(dat))
The estimation works perfectly so far. But now, I need to set the following constraints:
Rest_1 <- c11 + c12 + c13 = 0
Rest_2 <- c21 + c22 + c23 = 0
Rest_3 <- c31 + c32 + c33 = 0
Rest_4 <- c1 + c2 + c3 = -1
Obviously, the model here is linear with 3 equations, but it's because I'm trying to simplify the idea. But the current model has 5 nonlinear equations and more parameters.
Anyone can guide me, please, about how to perform a Non-Linear SUR estimation with restrictions in R?
Thanks a lot in advance.