1,0.2,2,1,data.sf.mont))
Error in catch2.fun(k, f1, f2, a, b, A, B, R, n0, av, index.n) :
Object "a" not found
Why wasn't the initial value of a=2 passed to catch2.fun() which was
called by lprob.catch()?
Thank you for your time.
Nancy
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
1,0.2,2,1,data.sf.mont))
Error in catch2.fun(k, f1, f2, a, b, A, B, R, n0, av, index.n) :
Object "a" not found
Why wasn't the initial value of a=2 passed to catch2.fun() which was
called by lprob.catch()?
The second argument to optim() must be a function of one variable
(possibly a vector variable), but
lprob.catch(x, freq,1, 0.5,0.5, a,- 0.7, 1, -0.7,0.1, 1,0.2,2,1,data.sf.mont)
is a not a function at all. How is optim() supposed to know that a=2,
rather than x=2, or data.sf.mont=2?
You probably wanted
optim(2,function(a) {lprob.catch(x, freq,1, 0.5,0.5, a,- 0.7, 1, -0.7,0.1,1,0.2,2,1,data.sf.mont)})
assuming that all the other variables are defined.
-thomas
Thomas Lumley Asst. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
1,0.2,2,1,data.sf.mont))
Error in catch2.fun(k, f1, f2, a, b, A, B, R, n0, av, index.n) :
Object "a" not found
Why wasn't the initial value of a=2 passed to catch2.fun() which was
called by lprob.catch()?
From ?optim
fn: A function to be minimized (or maximized), with first
argument the vector of parameters over which minimization is
to take place. It should return a scalar result.
and a is not the first argument: you told it to optimze over x.
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._