[R] I made some progress on my previous "systemfit" question but still not quite there
Leeds, Mark (IED)
Mark.Leeds at morganstanley.com
Thu May 24 00:06:18 CEST 2007
Surprisingly, I played around with some test code and below actually
creates equations that look correct.
tempmat<-matrix(10,nrow=6,ncol=6)
restrictmat<-diag(6)
colnames(tempmat)<-c("AUD.l1","CHF.l1","CAD.l1","GBP.l1","EUR.l1","JPY.l
1")
rownames(tempmat)<-c("AUD","CHF","CAD","GBP","EUR","JPY")
eqn<-list()
for ( i in 1:6 ) {
datares <- tempmat[, which(restrictmat[i, ] == 1),drop=FALSE]
eqn[[i]]<-paste(rownames(tempmat)[i]," ~","-1","+",colnames(datares))
print(eqn[[i]])
}
The only problem now is that I don't know how to name them so that
I can do the
system<-list( demand = eqDemand, supply = eqSupply)
part that systemfit needs. In fact, I don't know how to name the actual
equation eqDemand or the named part demand.
I would want demand to be "AUD", supply to be "CHF", etc. If someone has
time to run the code, they would see what I mean.
Thanks a lot.
--------------------------------------------------------
This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
More information about the R-help
mailing list