[R] optimisation - Error in checkFunc(Func2, times, y, rho) : The number of derivatives returned by func() (22) must equal the length of the initial conditions vector (2)
drjimlemon at gmail.com
Tue Feb 21 22:56:14 CET 2017
Did you try to _install_ rather than just _load_ the XLConnect package?
Sad to say, your code:
### this will fail unless XLConnect has been installed
#Initial values of the parameters
parms=c(k1=500, k2=4500, k3=200,k4=2.42, k5=0.26,k6=12.2,k7=0.004,
#definition of the parameters function
} ### you seem to be missing a closing brace here
# model fitting
} ### maybe this is the missing closing brace
is pretty messy with several lines commented out that may be
necessary, and has a number of possible errors. I have pointed out a
few (see ### comments). If the problem is the missing XLConnect
package, perhaps installing it will produce some meaningful error
On Tue, Feb 21, 2017 at 10:03 PM, Malgorzata Wieteska via R-help
<r-help at r-project.org> wrote:
> I get an error message:Error in checkFunc(Func2, times, y, rho) : The number of derivatives returned by func() (22) must equal the length of the initial conditions vector (2)
> I try to optimise system of differential equations with 2 extra variables derived from the data.frame.
> I didn't manage to install XLConnect package, so I don't know if this is the source of the problem.
> Loading required package: XLConnectWarning message:In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called ‘XLConnect’
> I have missing data, so time frame is limited. I haven't got values for solution of the first equation, but I hope that it isn't problem, I've got the same message when putting random numbers as x values.
More information about the R-help