Farrar.David at epamail.epa.gov
2008-Sep-18 19:47 UTC
[R] quantile regression / problems calling nlrq from inside other functions
All,
This worked:
mBW <- function( ... ) ... # matrix-valued function
BaconWatts <- function(formula,
mmf=mBW, # model matrix function(x, bp, g)
data, plot=T, tau=0.5 )
{
...
m.nl <- nlrq(y ~ b0 + mBW(x,bp,g) %*% c(b1,b2), tau=tau, start=par0,
trace=T )$m
...
}
For some reason the following reports a failure to find the function mmf()
mBW <- function( ... ) ...
BaconWatts <- function(formula,
mmf=mBW, # model matrix function(x, bp, g)
data, plot=T, tau=0.5 )
{
...
m.nl <- nlrq(y ~ b0 + mmf(x,bp,g) %*% c(b1,b2), tau=tau, start=par0,
trace=T )$m
...
}
It doesn't help to define functions mmf() or mBW() inside BaconWatts.
[[alternative HTML version deleted]]
