Re: [R] Fwd: Using odesolve to produce non-negative solutions

2007-06-11 Thread Setzer . Woodrow
By the way, if someone could forward the original question to me (I'm subscribed to but not currently receiving R-help, as I found I was spending too much time reading it!) I might think of something more useful. (alternatively, when was it posted; I can find it on gmane, too). Woody R. Woodrow

Re: [R] Fwd: Using odesolve to produce non-negative solutions

2007-06-11 Thread Setzer . Woodrow
Hi, all. lsoda can certainly not handle complex parameters. You can try (as Hank suggested) limiting hmax. You can also crank up relative and absolute precision by specifying smaller values of rtol and atol. I've seen similar problems in which the state variable becomes negative, with very

Re: [R] problems with optim, for-loops and machine precision

2007-01-10 Thread Setzer . Woodrow
Without more detail - a reproducible example - it is hard to give you concrete advice. I wonder if the functions NLL23 and NLL21 depend on numerical solutions of a system of ODEs, since you invoke the odesolve package? If so, try switching to the Nelder-Mead optimizer, enforcing the parameter

Re: [R] How to solve differential equations with a delay (time lag)?

2006-11-29 Thread Setzer . Woodrow
lsoda does not solve delay differential equations, which is what you need to be able to do. A quick search on netlib (netlib.org) turned up one match for delay differential equations: ode/ddverk.f, which might help (though not in R). R. Woodrow Setzer, Ph. D. National Center for Computational

Re: [R] nls convergence problem

2006-08-16 Thread Setzer . Woodrow
Joerg van den Hoff [EMAIL PROTECTED] wrote on 08/16/2006 08:22:03 AM: Earl F. Glynn wrote: [deleted] efg [deleted] (I think this is recognized by d. bates, but simply way down his 'to do' list :-(). joerg No doubt Doug Bates would gladly accept patches ... .

Re: [R] Error when loading odesolve

2006-08-04 Thread Setzer . Woodrow
Prof. Ripley: Thanks for diagnosing Wuming Gong's problem. I'm not sure I would have recognized the solution so quickly. I have uploaded to CRAN a new version of odesolve with Makevars fixed. R. Woodrow Setzer, Ph. D. National Center for Computational Toxicology US Environmental Protection

Re: [R] odesolve loading problem

2006-07-26 Thread Setzer . Woodrow
Hi Ariel, The problem is that I specified the wrong dependency in the DEPENDS field of the DESCRIPTION file of the package: I specified R version of at least 2.2.1, but that should have been 2.3.1. You have two choices -- upgrade your R to 2.3.1, or install odesolve 0.5.13. I will send an

Re: [R] odesolve with banded Jacobian [was no subject]

2005-11-21 Thread Setzer . Woodrow
Dear Karline Soetaert, I've just returned from a week of travel, so have not had a great deal of time to look at your request. From a brief rereading of the original lsoda documentation, it looks as if all I need to do is set a flag to a different value (jt to 4), and leave it up to the user to

Re: [R] changing memory limits to speed up lsoda

2005-10-26 Thread Setzer . Woodrow
Hank, I don't understand why you think memory is the problem, here. I'd try writing my model in C or Fortran (there is an example in the odesolve package). That speeds things up a lot, and is what I do with slow systems. R. Woodrow Setzer, Jr. National Center for Computational Toxicology US

Re: [R] odesolve/lsoda differences on Windows and Mac

2005-07-28 Thread Setzer . Woodrow
I've been talking offline with Hank Stephens about this; note that in the example he quotes, he set hmin = 0.1, and the quoted error message says that the stepsize had reached hmin with no convergence. I believe that he intended to set hmax (because of the pulsed input). Then, Peter Dalgaard's

Re: [R] odesolve/lsoda differences on Windows and Mac

2005-07-28 Thread Setzer . Woodrow
I will have added most of the solvers from the ode package odepack by Alan Hindmarsh, LLNL, to odesolve this year. These are all solvers in the lsode family. I would also like to add solver(s) for DAEs, like daskr (Brown, Hindmarsh, Petzold), but that may take a bit longer. If other folks are

[R] Using varPower in gnls, an answer of sorts.

2005-03-02 Thread Setzer . Woodrow
Back on January 16, a message on R-help from Ravi Varadhan described a problem with gnls using weights=varPower(). The problem was that the fit failed with error Error in eval(expr, envir, enclos) : Object . not found I can reliably get this error in version 2.0.1-patched 2004-12-09 on Windows

Re: [R] odesolve: lsoda vs rk4

2004-06-15 Thread Setzer . Woodrow
lsoda doesn't pass along the names attribute of the state vector, y. If you want to use the names of the state vector in your code, you need to reassign it inside your ode function. I should either fix this in the code for lsoda, or at least document it! For example, I can run the following

Re: [R] lsoda with arbitrary zero thresholds (with psuedo-solution)

2004-06-10 Thread Setzer . Woodrow
Dear Hank, Last question first: really, only you can say for sure if 4e-281 and 5e-11 are small enough; it depends on the units you measure your state variables in. However, this strategy cannot get the state variables to exactly 0. Obviously, you could get closer to 0.0 faster by setting

Re: [R] ODE solvers in R (was:The Wrong Choice: Locked in by licenserestrictions)

2003-05-30 Thread Setzer . Woodrow
I have plans to add dassl to odesolve. However, I won't have time in the immediate future. If someone wanted to take this on, I'd be happy to give advice and continue to manage the package ... . R. Woodrow Setzer, Jr.Phone: (919) 541-0128 Experimental Toxicology

[R] creating function bodies using body()

2003-04-04 Thread Setzer . Woodrow
I'm having trouble figuring out how to create a function using body- (). The help file for body() says that the argument should be a list of R expressions. However if I try that I get an error: tmpfun - function(a, b=2){} body(tmpfun) - list(expression(z - a + b),expression(z^2)) Error in

Re: [R] question about model formula

2003-03-06 Thread Setzer . Woodrow
I did not know about stepsize being an issue. I had thought that problems with convergence in this case were due to bad approximations of the finite difference gradient. I guessed that around the optimum, numerical errors would come to dominate the gradient calculations, causing convergence to

[R] Problems with Rcmd check on Win 2000 rw1062

2003-02-11 Thread Setzer . Woodrow
When I run Rcmd check on a package on my Windows 2000 machine, I get a series of error messages like the following: * checking generic/method consistency ...c:\DOCUME~1\R5018~1.WOO\LOCALS~1\Temp/R utils138414013: cannot open c:DOCUME~1R5018~1.WOOLOCALS~1Temp/Rin138408157: no s uch file It looks

Re: [R] Problems with Rcmd check on Win 2000 rw1062

2003-02-11 Thread Setzer . Woodrow
TMPDIR seems to be OK: echo %TMPDIR% C:/DOCUME~1/R5018~1.WOO/LOCALS~1/Temp I'll poke around in the Perl code to see what I can find. R. Woodrow Setzer, Jr.Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-4284 Pharmacokinetics Branch

Re: [R] Problems with Rcmd check on Win 2000 rw1062

2003-02-11 Thread Setzer . Woodrow
I do not understand why, but changing the definition of TMPDIR to C:/tmp solved the problem. R. Woodrow Setzer, Jr.Phone: (919) 541-0128 Experimental Toxicology Division Fax: (919) 541-4284 Pharmacokinetics Branch NHEERL B143-05; US EPA; RTP, NC 27711