Skip to content

solving equations with several variables

2 messages · Josh Schmidt, Uwe Ligges

#
I tried:
and got this error.

Error in fn(par, ...) : unused argument(s) (x1 ...)

I am trying to solve for the circular-linear regression equation in Fisher 
(1993).
=====
and
Josh Schmidt
Department of Biology and Wildlife
University of Alaska Fairbanks
474-7006 (office)
#
Josh Schmidt wrote:

            
Sorry, should have been:

  f <- function(b, x1, x2, x3){
     -sum(cos(x1+2.33474-2*(atan(b[1]*x2+b[2]*x3))))
  }
  optim(c(0, 0), f, x1=x1, x2=x2, x3=x3)


Uwe Ligges