Displaying 3 results from an estimated 3 matches for "supply2".
Did you mean:
supply
2003 Oct 17
2
nlm, hessian, and derivatives in obj function?
...l" method, but I would like to make sure the parameter estimates
and the se's are matching before I attempt more difficult problems.
rm(list=ls(all=TRUE))
print( "running nlsystemfit models test at end...")
data( kmenta )
attach( kmenta )
##demand2 <- q ~ d0 + d1 * p + d2 * d
supply2 <- q ~ s0 + s1 * p + s2 * f + s3 * a
##system2 <- list( demand2, supply2 )
##labels <- list( "Demand", "Supply" )
##inst <- ~ d + f + a
##sv2 <- c(d0=3,s2=2.123,d2=4,s0=-2.123,s3=4.234,d1=4.234,s1=0.234)
sv2 <- c(s0=-2.123,s1=0.234,s2=2.123,s3=4.234)
obj <-...
2003 Sep 30
1
can't get names from vector in nlm calls
...] )[2] )
rhs[[i]] <- eval( formula( eqns[[i]] )[3] )
residi[[i]] <- lhs[[i]] - rhs[[i]]
r <- rbind( r, as.matrix( residi[[i]] ) )
}
## blah, blah, blah....
knls <- obj
}
print( "calling nlstest" )
demand2 <- q ~ d0 + d1 * p + d2 * d
supply2 <- q ~ s0 + s1 * p + s2 * f + s3 * a
system2 <- list( demand2, supply2 )
sv2 <- c(d0=3,d2=4,d1=4.234,s0=-2.123,s2=2.123,s3=4.234,s1=0.234)
### call the nlm function to get the estimates...
estnew <- nlm( knls, sv2, hessian=TRUE, print.level=1, eqns=system2,
data=kmenta, fitmethod="...
2003 Oct 06
1
getting names of p vector in nlm function...
...] )[2] )
rhs[[i]] <- eval( formula( eqns[[i]] )[3] )
residi[[i]] <- lhs[[i]] - rhs[[i]]
r <- rbind( r, as.matrix( residi[[i]] ) )
}
## blah, blah, blah....
knls <- obj
}
print( "calling nlstest" )
demand2 <- q ~ d0 + d1 * p + d2 * d
supply2 <- q ~ s0 + s1 * p + s2 * f + s3 * a
system2 <- list( demand2, supply2 )
sv2 <- c(d0=3,d2=4,d1=4.234,s0=-2.123,s2=2.123,s3=4.234,s1=0.234)
### call the nlm function to get the estimates...
estnew <- nlm( knls, sv2, hessian=TRUE, print.level=1, eqns=system2,
data=kmenta, fitmethod="...