Displaying 17 results from an estimated 17 matches for "eq1".
Did you mean:
eq
2011 Jun 21
1
Setting up list of many equations for systemfit
Dear List Members,I am trying to set up a large system of equations and I am trying to find a simple way to set up the list command under the package system fit. Here is the example from system fit and what I am trying to do:
EQ1 <- Y1 ~ X1 + X2 + X4EQ2 <- Y2 ~ X2 + X3EQ3 <- Y3 ~ X2 + X3 + X4EQ4 <- Y4 ~ X1 + X3 + X4eqSystem <-list(form1 = EQ1, form2 = EQ2, form3 = EQ3, form4 = EQ4)
#atempt 1 to "automate" above:eqSystem1 <-paste(paste("form", 1:4, sep=""), paste("EQ"...
2011 Jun 23
0
Loops, Paste, Apply? What is the best way to set up a list of many equations?
Is there a way to apply paste to?list(form1 = EQ1, form2 = EQ2, form3 = EQ3, form4 = EQ4)?such that I don't have to write form1=EQ1 for all my models?(I might have a list of 20 or more)? I also need the EQs to read the formulas associated with them.
For example, below, I was able to automate the name assignment but I could not figure out how...
2009 Apr 13
2
joint estimation of two poisson equations
...9;d prefer to avoid doing that unless it's
entirely necessary.
I'll post my solution to the list when I've worked it out.
Regards,
~Owen
# CODE FOR "sur" OPTION
rm(list = ls())
library(Zelig)
y1 = c(1,2,3,4)
y2 = c(0,2,0,2)
x = c(2,3,4,8)
d = data.frame(cbind(y1, y2, x))
eq1 = y1 ~ x
eq2 = y2 ~ x
eqSystem = list (eq1, eq2)
system_out = zelig(formula = eqSystem, model = "sur", data = d)
summary(system_out)
-----------------------------------------------------------------
# ERROR FROM REPLACING "sur" WITH "poisson"
Error in switch(mode(x)...
2004 Nov 29
3
systemfit - SUR
Hello to everyone,
I have 2 problems and would be very pleased if anyone can help me:
1) When I use the package "systemfit" for SUR regressions, I get two
different variance-covariance matrices when I firstly do the SUR
regression ("The covariance matrix of the residuals used for
estimation") and secondly do the OLS regressions. In the manual for
"systemfit" on page
2012 Oct 17
1
extracting and restricting coefficients
HiĀ
I want to fit two equations simultaneously
EQ1<-Y1~X1+X2
EQ2<-Y2~X1+X2
eqsystem<-list(Y1HAT=EQ1,Y2HAT=EQ2)
fitols<-systemfit(eqsystem,
method="OLS", data=BB)
How do I get coefficients for the first equation? R code
How do I restrict coefficient of X2 in the first equation (say , restrict it to less thanĀ zero). R code
You...
2017 Jun 11
1
Memory leak in nleqslv()
...over nleqslv, in that the solver
does not appear to clean up memory used in previous iterations. I
believe I've isolated the/my issue in a small sample of code:
library(nleqslv)
cons_ext_test <- function(x){
rows_x <- length(x)/2
x_1 <- x[1:rows_x]
x_2 <- x[(rows_x+1):(rows_x*2)]
eq1<- x_1-100
eq2<-x_2*10-40
return(c(eq1,eq2))
}
model_test <- function()
{
reserves<-(c(0:200)/200)^(2)*2000
lambda <- numeric(NROW(reserves))+5
res_ext <- pmin((reserves*.5),5)
x_test <- c(res_ext,lambda)
#print(x_test)
for(test_iter in c(1:1000))
nleqslv(x_test,cons_ext_tes...
2007 Mar 28
0
nlsystemfit: Errors with reproducing the manual example
...try to do something similar on my own data (called R_manuf and
containing 3 columns named va98, ts98 and gom98) with the code
library(systemfit)
dati <- read.table("R_manuf",header=T,na.strings="nan")
attach(dati)
y1 <- va98/ts98 - 1;
y2 <- gom98 - va98;
eq1.formula <- y1.98 ~ a1*ts98^(b1-1) ;
eq2.formula <- y2.98 ~ a2*ts98^b2 ;
labels <- list("eq1", "eq2" );
start.values <- c(a1=-0.5, b1=1.02, a2=-0.8, b2=0.9 );
model <- list( eq1.formula, eq2.formula);
model.ols <- nlsystemfit( "OLS", model, star...
2006 Jan 12
1
Problem with NLSYSTEMFIT()
...The functions f_i(.) have to be formulated as R-functions. When invoking
"nlsystemfit()" I get the error
Error in deriv.formula(eqns[[i]], names(parmnames)) :
Function 'f1' is not in the derivatives table
Isn't it possible to provide equations in the form
eq1 ~ f1(x,t,theta) etc. to "nlsystemfit()" ?
Kind regards,
Kilian Plank
[[alternative HTML version deleted]]
2011 Jun 28
2
How do I output all the R-squares of an SUR? summary(fitSUR$eq[[1:4]])$r.squared does not work
...E PROGRAM ################
YX<-as.data.frame(matrix(rnorm(280),ncol=14, nrow=20)) ##
generate variables
names(YX) <-c(paste("Y", 1:4, sep=""), paste("X", 1:10, sep="")) ##
assign variables' names
library(systemfit)
## EQUATIONS:
EQ1 <- Y1 ~ X1 + X2 + X4 + X7 + X10 ## equation 1 formula
EQ2 <- Y2 ~ X2 + X3 + X5 + X8 + X10 ## equation 2 formula
EQ3 <- Y3 ~ X5 + X6 + X7 + X9 ## equation 3 formula
EQ4 <- Y4 ~ X1 + X3 + X4 + X6 + X9 ## equation 4 formula
eqSystem <-list(form1 = EQ1, form2...
2017 Jun 08
5
Matrix multiplication
...rt(w)*a; a
t(a)%*%a
On 1/4/2017 5:41 PM, Steven Yen wrote:
> I need help with gls{nlme}.
> Specifically, I am estimating an equation with AR(1) using
> maximum-likelihood. I am not understanding the correlationoption
> below. Help appreciated.
>
> ===
> library(nlme)
> eq1<-log(chnimp)~log(chempi)+log(gas)+log(rtwex)+befile6+
> affile6+afdec6
> reg1<-gls(eq1,data=mydata,correlation=corAR1(),method="ML",verbose=T)
>
[[alternative HTML version deleted]]
2008 Oct 06
0
Computationally singular [provides coefficients but not covariance matrix]
...summary command is unable to provide me
results, while the coefficients are available from the coefficients value. I
suppose that it cannot estimate the covariance matrix. Is there any command
that I can relax the tolerance so it can estimate the covariance matrix.
The code and the error of R is:
eq1<-rq(y~factor(year)+factor(state)+x1+x2+x3, tau=0.05, data=data1)
summary(eq1)
summary(qr.05.nox)
Error in solve.default(crossprod(x)) :
system is computationally singular: reciprocal condition number =
4.51499e-31
Error in diag(solve(crossprod(x))) :
error in evaluating the argument ...
2011 Oct 02
0
deSolve - Function daspk on DAE system - Error
I'm getting this error on the attached code and breaking my head but can't
figure it out. Any help is much appreciated. Thanks, Vince
CODE:
library(deSolve)
Res_DAE=function(t, y, dy, pars) {
with(as.list(c(y, dy, pars)), {
res1 = -dS -dES-k2*ES
res2 = -dP + k2*ES
eq1 = Eo-E -ES
eq2 = So-S -ES -P
return(list(c(res1, res2, eq1, eq2)))
})
}
pars <- c(Eo=0.02, So=0.02, k2=250, E=0.01); pars
yini <- c(S=0.01, ES = 0.01, P=0.0, E=0.01); yini
times <- seq(0, 0.01, by = 0.0001); times
dyini = c(dS=0.0, dES=0.0, dP=0.0)
## Tabular output check of matrix...
2011 Oct 03
0
deSolve - Function daspk on DAE system - Error (Vince)
...s-ascii
I'm getting this error on the attached code and breaking my head but
can't
figure it out. Any help is much appreciated. Thanks, Vince
CODE:
library(deSolve)
Res_DAE=function(t, y, dy, pars) {
with(as.list(c(y, dy, pars)), {
res1 = -dS -dES-k2*ES
res2 = -dP + k2*ES
eq1 = Eo-E -ES
eq2 = So-S -ES -P
return(list(c(res1, res2, eq1, eq2)))
})
}
pars <- c(Eo=0.02, So=0.02, k2=250, E=0.01); pars
yini <- c(S=0.01, ES = 0.01, P=0.0, E=0.01); yini
times <- seq(0, 0.01, by = 0.0001); times
dyini = c(dS=0.0, dES=0.0, dP=0.0)
## Tabular output check of matrix...
2017 Jun 08
0
Matrix multiplication
...017 5:41 PM, Steven Yen wrote:
>> I need help with gls{nlme}.
>> Specifically, I am estimating an equation with AR(1) using
>> maximum-likelihood. I am not understanding the correlationoption
>> below. Help appreciated.
>>
>> ===
>> library(nlme)
>> eq1<-log(chnimp)~log(chempi)+log(gas)+log(rtwex)+befile6+
>> affile6+afdec6
>> reg1<-gls(eq1,data=mydata,correlation=corAR1(),method="ML",verbose=T)
>>
>
> [[alternative HTML version deleted]]
>
>____________________________________________...
2002 Jul 31
0
Nonlinear Seemingly Unrelated Regression
Hello to everyone,
I found some problems using R in the estimation of systems of nonlinear
equations
like SURE (Seemingly Unrelated Regression Equations) with mutual
parameters as the following system example:
EQ1 PQ1=P1*G1+B1*(Y-P1*G1-P2*G2-P3*G3)
EQ2 PQ2=P2*G2+B2*(Y-P1*G1-P2*G2-P3*G3)
where G1,G2,G3,B1,B2 are the coefficients to estimate.
command "nls" accept only single equation nonlinear model formula and
package "systemfit" doesn't allows any nonlinear estimation.
Do you kn...
2002 Aug 13
0
Non linear SUR estimation
TO: r-help at lists.R-project.org
r-help at stat.math.ethz.ch
Hello to everyone,
I found some problems using R in the estimation of systems of nonlinear
equations
like SURE (Seemingly Unrelated Regression Equations) with mutual
parameters as the following system example:
EQ1 PQ1=P1*G1+B1*(Y-P1*G1-P2*G2-P3*G3)
EQ2 PQ2=P2*G2+B2*(Y-P1*G1-P2*G2-P3*G3)
where G1,G2,G3,B1,B2 are the coefficients to estimate.
command "nls" accept only single equation nonlinear model formula and
package "systemfit" doesn't allows any nonlinear estimation.
Do you k...
2009 Dec 13
0
How to control the skewness of a heteroscedastic variable?
...the heteroscedasticity) and z are assumed to be
positively correlated.
I thought that since the two terms on the rhs of eq.1 are
uncorrelated the 3rd central moment of y should equal the sum of the
3rd central moments of the two terms on the rhs. This seems to be
correct as long as x and z in eq1 are uncorrelated. But if I make x
and z correlated the 3rd moment of y exceeds the sum of the 3rd
moments of the terms on the rhs.
My problem is that I cannot understand why this is the case (there
seems to be no linear correlation between z and the multiplicative
error term). Is it my statis...