Forum: help


RE: Restrictions not working with SUR [ Reply ] By: Arne Henningsen on 2018-03-25 06:53 | [forum:45786] |
You wrote "I want Eq2 and Eq5 to have similar parameters." This is not really possible. However, it is possible to impose restrictions so that the two equations have identical parameters. The error message indicates that you did not use the correct names of the coefficients. It is usually easiest to estimate the model without restrictions, obtain the names of the coefficients, and then copy and paste these coefficient names to specify the restrictions. I guess that the first restriction should look like "volume_LogCube - BasalArea_LogCube = 0". |
RE: Restrictions not working with SUR [ Reply ] By: Jaime Uria-Diez on 2018-03-06 11:38 | [forum:45741] |
Hi Arne, I am working in the same problem as Peder last time. I have these set of six equations: r1Height <- Medelhojd ~ ElevP95 r2Volume <- LogTotalVol ~ LogCube + XCube + Coverage r3Biomass <- LogBiomass ~ LogCube + Coverage r4FH <- FH ~ ElevP95 + LogCube r5Basalarea <- BasalArea ~ LogCube + XCube + Coverage - FH r6Diameter <- LogDiameter ~ XCube + LogPMin95 eqSystem <- list(height = r1Height, volume = r2Volume, biomass = r3Biomass, FH = r4FH, BasalArea = r5Basalarea , diameter = r6Diameter) And I want Eq2 and Eq5 to have similar parameters, so I used the restrictions like this (I dont know if the interaction term is well included like this): restrict <- c("LogTotalVol_ - BasalArea_ =0","LogTotalVol_LogCube - BasalArea_LogCube = 0","LogTotalVol_XCube - BasalArea_XCube = 0", "LogTotalVol_Coverage - BasalArea_Coverage = 0") Then once I included the restriction in the systemfit functioin to compute the SUR, but I got this error. fitsur <- systemfit(eqSystem, method = "SUR", data = CleanRemoteData, maxiter = 600, restrict.matrix = restrict) Error in constants(lhs, cnames_symb) : The hypothesis "LogTotalVol_ - BasalArea_ =0" is not well formed: contains bad coefficient/variable names. In addition: Warning message: In constants(lhs, cnames_symb) : NAs introduced by coercion Any idea how to solve it? |
RE: Restrictions not working with SUR [ Reply ] By: Arne Henningsen on 2017-12-31 05:58 | [forum:45530] |
Hej Peder It seems that the restrictions result in perfect multicollinearity. Which values get in "the order of 10^-4 and smaller" in the unrestricted regression? Which of the two methods implemented in systemfit() did you use to impose the restrictions? (If possible, I recommend to use "restrict.regMat" to impose restrictions; see the "details" section of systemfit()'s documentation for reasons.) It will be easiest to help you if you provide a minimal reproducible example. Best regards, Arne |
Restrictions not working with SUR [ Reply ] By: Peder Axensten on 2017-11-10 12:52 | [forum:45445] |
I have a system of six equations and systemfit using SUR gives me the resulting parameters very quickly if I use no restrictions. But with restrictions I get an error message that seem to indicate a system that does not converge (the underlaying flags Lapack/blas "impossible" matrices). If I check my restrictions with the parameters I get from the unrestricted case, I get values in the order of 10^-4 and smaller. As I want these restrictions to be zero, I think that I should have a rather healthy combination of equations and data? The error message is Error in solve(sigma, tol = solvetol) : Lapack routine dsptrf returned error code 1 If I usie only one restriction at the time, I get similar error messages from Lapack/blas. I have no previous experience with systemfit, but I have tried to read the documentation carefully. Any ideas on how to proceed? |