[R-sig-dyn-mod] Different solutions using deSolve::ode() with 32 and 64 Bit systems: Problem for sensitivity analysis
Johannes Friedrich
Johannes.Friedrich at uni-bayreuth.de
Thu Jun 2 15:38:32 CEST 2016
Dear Ladies and Gentlemen,
during the last days I made a strange observation concerning the package
"FME" and "deSolve".
I used a local sensitivity analysis in my R-package and also made a
little example in the manual of the package. To check the performance, I
sent my package to the win-builder and I compared the results between
examples_i386 and examples_x64. And the result was, that the sensitivity
analysis using the function /FME::sensFun() /produces NOT the same using
R 32 Bit or R 64 Bit.
I then made a little comparison and a reproducible example (from the FME
vignette):
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
/library("deSolve")//
//library("FME")//
//pars <- list(gmax = 0.5, eff = 0.5, ks = 0.5, rB = 0.01, dB = 0.01)//
//
//solveBact <- function(pars, times=seq(0, 50, by=0.5)) {//
// derivs <- function(t, state, pars) {//
// with(as.list(c(state, pars)), {//
// dBact <- gmax*eff*Sub/(Sub+ks)*Bact - dB*Bact - rB*Bact//
// dSub <- -gmax*Sub/(Sub+ks)*Bact + dB*Bact//
////
// return(list(c(dBact, dSub), TOC = Bact + Sub))//
//
// })//
// }//
// state <- c(Bact = 0.1, Sub = 100)//
// return(ode(y = state, times = times, func = derivs, parms = pars))//
//}//
//
//out <- solveBact(pars)//
//
//SnsBact <- sensFun(func = solveBact, //
// parms = pars, //
// sensvar = "Bact", //
// varscale = 1)/
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Running this little example with R (3.3.0) 32 Bit and 64 Bit gives not
the same results. You can check this, e.g.
/identical(SnSBact$gmax_x64, SnSBact$gmax_x32)/.
Also the solution of the differential equations using /deSolve::ode()/
are not the same (/identical(out[,"TOC"], out_x64[,"TOC"])/)
In this example this has only little effects, but with bigger models
(like my package) the differences are enormous.
* Has someone ever detected the same problems?
* Comes the problem for the sensitivity analysis from the different
ODE solutions, or is the problem also part of the /FME::sensFun()/
function?
Thanks for any pointers,
Johannes
--
Johannes Friedrich
University of Bayreuth
Chair of Geomorphology
95440 Bayreuth, Germany
Tel. +49-921-55-2054
Fax +49-921-55-2314
http://www.geomorph.uni-bayreuth.de/
[[alternative HTML version deleted]]
More information about the R-sig-dynamic-models
mailing list