Re: [R] Error meaning

2010-01-20 Thread Berend Hasselman
Roslina Zakaria wrote: > > I have the following code to solve 4 simultaneous eqns with 4 unknowns > using newton iteration method.  But I got the error message: >   > pars <- c(1.15, 40, 50, 0.78) > newton.input2 <- function(pars) > {  ## parameters to estimate > ... >   > f1 <- pars[1]*pars

Re: [R] Error meaning

2010-01-20 Thread David Winsemius
When I look at this line: f4 <- pars[1]*pars[2]*pars[3](pars[1]+pars[4]) It appears to my wet-brain interpreter that you are trying to apply a function par[3] to the argument (pars[1]+pars[4]) When I insert a "*", I then get output but I don't know if it is correct. > newton.input2(pars)

[R] Error meaning

2010-01-20 Thread Roslina Zakaria
Hi r-users,   I have the following code to solve 4 simultaneous eqns with 4 unknowns using newton iteration method.  But I got the error message:   pars <- c(1.15, 40, 50, 0.78) newton.input2 <- function(pars) {  ## parameters to estimate      alp <- pars[1]    b1  <- pars[2]     b2  <- pars[3]