==42579== Memcheck, a memory error detector ==42579== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==42579== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==42579== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==42579== R Under development (unstable) (2019-11-27 r77464) -- "Unsuffered Consequences" Copyright (C) 2019 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "episode" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('episode') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("aim") > ### * aim > > flush(stderr()); flush(stdout()) > > ### Name: aim > ### Title: Adaptive Integral Matching (AIM) > ### Aliases: aim > > ### ** Examples > > set.seed(123) > # Michaelis-Menten system with two 0-rate reactions > A <- matrix(c(1, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 0, + 0, 0, 1, 1, + 0, 0, 1, 1), ncol = 4, byrow = TRUE) > B <- matrix(c(0, 0, 1, 0, + 1, 1, 0, 0, + 1, 0, 0, 1, + 0, 1, 0, 0, + 1, 0, 0, 1), ncol = 4, byrow = TRUE) > k <- c(0.1, 1.25, 0.5, 0, 0); x0 <- c(E = 5, S = 5, ES = 1.5, P = 1.5) > Time <- seq(0, 10, by = 1) > > # Simulate data, in second context the catalytic rate has been inhibited > contexts <- cbind(1, c(1, 1, 0, 1, 1)) > m <- mak(A, B, r = reg(contexts = contexts)) > y <- numsolve(m, c(Time, Time), cbind(x0, x0 + c(2, -2, 0, 0)), contexts * k) > y[, -1] <- y[, -1] + matrix(rnorm(prod(dim(y[, -1])), sd = .25), nrow = nrow(y)) > > # Create optimisation object via data > o <- opt(y, nlambda = 10) > > # Fit data using Adaptive Integral Matching on mak-object > a <- aim(m, o) > a$params$rate 5 x 10 sparse Matrix of class "dgCMatrix" [[ suppressing 10 column names ‘s0’, ‘s1’, ‘s2’ ... ]] V1 . . . . 0.003056762 0.009765351 0.03962563 V2 . . . . . 0.075749381 0.48315720 V3 . 0.1658255 0.2254201 0.2468373 0.287400213 0.311796774 0.36224006 V4 . . . . . . . V5 . . . . . . . V1 0.05035555 0.05421152 0.05559707 V2 0.62955417 0.68216432 0.70106842 V3 0.38036626 0.38688021 0.38922084 V4 . . . V5 . . . > > # Compare with true parameter on column vector form > matrix(k, ncol = 1) [,1] [1,] 0.10 [2,] 1.25 [3,] 0.50 [4,] 0.00 [5,] 0.00 > > > # Example: Power Law Kinetics > A <- matrix(c(1, 0, 1, + 1, 1, 0), byrow = TRUE, nrow = 2) > p <- plk(A) > x0 <- c(10, 4, 1) > theta <- matrix(c(0, -0.25, + 0.75, 0, + 0, -0.1), byrow = TRUE, nrow = 3) > Time <- seq(0, 1, by = .025) > > # Simulate data > y <- numsolve(p, Time, x0, theta) > y[, -1] <- y[, -1] + matrix(rnorm(prod(dim(y[, -1])), sd = .25), nrow = nrow(y)) > > # Estimation > a <- aim(p, opt(y, nlambda = 10)) > a$params$theta 6 x 10 sparse Matrix of class "dgCMatrix" [[ suppressing 10 column names ‘s0’, ‘s1’, ‘s2’ ... ]] V1 . . . 0.12852776 0.31379298 0.38054627 0.4044017 V2 . 0.1073388 0.434665357 0.55230040 0.59457625 0.60976940 0.6152295 V3 . . . . . 0.03295876 0.1099967 V4 . -0.1547796 -0.210404548 -0.23804516 -0.25625650 -0.26281158 -0.2651593 V5 . . . . . . . V6 . . -0.009135348 -0.06571718 -0.08605163 -0.09532118 -0.1025328 V1 0.4129965 0.4160832 0.4170382 V2 0.6171918 0.6178970 0.6181504 V3 0.1376324 0.1475451 0.1501579 V4 -0.2660044 -0.2663079 -0.2664078 V5 . . . V6 -0.1051216 -0.1060508 -0.1063282 > > # Compare with true parameter on column vector form > matrix(theta, ncol = 1) [,1] [1,] 0.00 [2,] 0.75 [3,] 0.00 [4,] -0.25 [5,] 0.00 [6,] -0.10 > > > # Example: use custom lowess smoother on data > # Smooth each coordinate of data to get curve > # on extended time grid > ext_time <- seq(0, 1, by = 0.001) > x_smooth <- apply(y[, -1], 2, function(z) { + # Create loess object + data <- data.frame(Time = y[, -1], obs = z) + lo <- loess(obs ~ Time, data) + + # Get smoothed curve on extended time vector + predict(lo, newdata = data.frame(Time = ext_time)) + }) > > # Bind the extended time > x_smooth <- cbind(ext_time, x_smooth) > > # Run aim on the custom smoothed curve > a_custom <- aim(p, opt(y), x = x_smooth) > > > > > > cleanEx() > nameEx("field") > ### * field > > flush(stderr()); flush(stdout()) > > ### Name: field > ### Title: Field of Ordinary Differential Equation (ODE) systems. > ### Aliases: field > > ### ** Examples > > # Example: Michaelis-Menten system > A <- matrix( + c(1, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 0), ncol = 4, byrow = TRUE) > B <- matrix( + c(0, 0, 1, 0, + 1, 1, 0, 0, + 1, 0, 0, 1), ncol = 4, byrow = TRUE) > k <- c(1, 2, 0.5) > x <- c(E = 1, S = 4, ES = 0, P = 0) > > m <- mak(A, B) > > # Vector field > field(m, x, k) E S ES P -4 -4 4 0 > > # ... with differentials > field(m, x, k, TRUE) $f E S ES P -4 -4 4 0 $f_dx 4 x 4 sparse Matrix of class "dgCMatrix" E S ES P E -4 -1 2.5 . S -4 -1 2.0 . ES 4 1 -2.5 . P . . 0.5 . $f_dparam $f_dparam[[1]] 4 x 3 sparse Matrix of class "dgCMatrix" E -4 . . S -4 . . ES 4 . . P . . . > > > # Example: Power law kinetics > A <- matrix(c(1, 0, 1, + 1, 1, 0), byrow = TRUE, nrow = 2) > p <- plk(A) > x <- c(10, 4, 1) > theta <- matrix(c(0, -0.25, + 0.75, 0, + 0, -0.1), byrow = TRUE, nrow = 3) > > # Vector field > field(p, x, theta) [1] -10.0 7.5 -4.0 > > # ... with differentials > field(p, x, theta, TRUE) $f [1] -10.0 7.5 -4.0 $f_dx 3 x 3 sparse Matrix of class "dgCMatrix" [1,] -1.00 -2.5 . [2,] 0.75 . 7.5 [3,] -0.40 -1.0 . $f_dparam $f_dparam[[1]] 3 x 6 sparse Matrix of class "dgCMatrix" [1,] 10 . . 40 . . [2,] . 10 . . 40 . [3,] . . 10 . . 40 > > > > > cleanEx() > nameEx("imd") > ### * imd > > flush(stderr()); flush(stdout()) > > ### Name: imd > ### Title: Integral Matching Design > ### Aliases: imd > > ### ** Examples > > set.seed(123) > # Michaelis-Menten system with two 0-rate reactions > A <- matrix(c(1, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 0, + 0, 1, 0, 0, + 0, 0, 0, 1), ncol = 4, byrow = TRUE) > B <- matrix(c(0, 0, 1, 0, + 1, 1, 0, 0, + 1, 0, 0, 1, + 0, 0, 0, 1, + 0, 0, 1, 0), ncol = 4, byrow = TRUE) > k <- c(2.1, 2.25, 1.5, 0, 0); x0 <- c(E = 8, S = 10, ES = 1.5, P = 1.5) > Time <- seq(0, 10, by = 1) > > # Simulate data, in second context the catalytic rate has been doubled > contexts <- cbind(1, c(1, 1, 2, 1, 1)) > m <- mak(A, B, r = reg(contexts = contexts)) > y <- numsolve(m, c(Time, Time), cbind(x0, x0 + c(2, -2, 0, 0)), contexts * k) > y[, -1] <- y[, -1] + matrix(rnorm(prod(dim(y[, -1])), sd = .5), nrow = nrow(y)) > > # Get the design matrix used in integral matching > d <- imd(m, opt(y)) > head(d$X[[1]]) [,1] [,2] [,3] [,4] [,5] [1,] -35.048201 2.410597 2.410597 0.00000000 0.000000 [2,] -35.048201 2.410597 0.000000 -4.89113812 0.000000 [3,] 35.048201 -2.410597 -2.410597 0.00000000 5.406057 [4,] 0.000000 0.000000 2.410597 4.89113812 -5.406057 [5,] -0.589866 1.733053 1.733053 0.00000000 0.000000 [6,] -0.589866 1.733053 0.000000 -0.08670719 0.000000 > > # Compare with glmnet > lasso <- glmnet::glmnet(x = d$X[[1]], y = d$Y, intercept = FALSE, lower.limits = 0) > a <- aim(m, opt(y, nlambda = 100), adapts = "scales") > all.equal(lasso$beta, a$params$rate) [1] TRUE > > > > > cleanEx() > nameEx("mak") > ### * mak > > flush(stderr()); flush(stdout()) > > ### Name: mak > ### Title: Create 'mak' (Mass Action Kinetics) object > ### Aliases: mak > > ### ** Examples > > # Michaelis-Menten system > A <- matrix( + c(1, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 0), ncol = 4, byrow = TRUE) > B <- matrix( + c(0, 0, 1, 0, + 1, 1, 0, 0, + 1, 0, 0, 1), ncol = 4, byrow = TRUE) > k <- c(1, 2, 0.5) > x0 <- c(E = 1, S = 4, ES = 0, P = 0) > Time <- seq(0, 1, by = .1) > > m <- mak(A, B) > > # Solve system > numsolve(m, Time, x0, k) Time E S ES P [1,] 0.0 1.0000000 4.000000 0.0000000 0.000000000 [2,] 0.1 0.7186230 3.710505 0.2813770 0.008118484 [3,] 0.2 0.5783223 3.552071 0.4216777 0.026250923 [4,] 0.3 0.5058340 3.456453 0.4941660 0.049380586 [5,] 0.4 0.4689727 3.393812 0.5310273 0.075161080 [6,] 0.5 0.4503881 3.348113 0.5496119 0.102275615 [7,] 0.6 0.4412717 3.311231 0.5587283 0.130041139 [8,] 0.7 0.4371591 3.279051 0.5628409 0.158107821 [9,] 0.8 0.4357579 3.249462 0.5642421 0.186295564 [10,] 0.9 0.4358716 3.221362 0.5641284 0.214509727 [11,] 1.0 0.4368492 3.194155 0.5631508 0.242693833 attr(,"conv_code") [1] 0 > > # Evaluate field > field(m, x0, k) E S ES P -4 -4 4 0 > > > > > cleanEx() > nameEx("numint") > ### * numint > > flush(stderr()); flush(stdout()) > > ### Name: numint > ### Title: Numerical integration of powers and fractions of powers via > ### simpson rule > ### Aliases: numint > > ### ** Examples > > # Trajectory of power law kinetics system > A <- matrix(c(1, 0, 1, + 1, 1, 0), byrow = TRUE, nrow = 2) > p <- plk(A) > x0 <- c(10, 4, 1) > theta <- matrix(c(0, -0.25, + 0.75, 0, + 0, -0.1), byrow = TRUE, nrow = 3) > Time <- seq(0, 1, by = .025) > traj <- numsolve(p, Time, x0, theta) > > # Example: Integrate traj(s)^A between the time points in 'ti' > ti <- seq(0, 1, by = .1) > ss <- numint(time = ti, x = traj, type = "power", A = A, B = A) > > # Example: Integrate traj(s)^A / (1 + traj(s)^B) between the time points in 'ti' > B <- matrix(c(0, 2, 1, + 2, 1, 0), byrow = TRUE, nrow = 2) > ss <- numint(time = ti, x = traj, type = "fracpower", A = A, B = B) > > > > > cleanEx() > nameEx("numsolve") > ### * numsolve > > flush(stderr()); flush(stdout()) > > ### Name: numsolve > ### Title: Numerical solver for Ordinary Differential Equation (ODE) > ### systems. > ### Aliases: numsolve > > ### ** Examples > > # Example: Michaelis-Menten system > A <- matrix( + c(1, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 0), ncol = 4, byrow = TRUE) > B <- matrix( + c(0, 0, 1, 0, + 1, 1, 0, 0, + 1, 0, 0, 1), ncol = 4, byrow = TRUE) > k <- c(1, 2, 0.5) > x0 <- c(E = 1, S = 4, ES = 0, P = 0) > Time <- seq(0, .5, by = .1) > > m <- mak(A, B) > > # Solution for one context > numsolve(m, Time, x0, k) Time E S ES P [1,] 0.0 1.0000000 4.000000 0.0000000 0.000000000 [2,] 0.1 0.7186230 3.710505 0.2813770 0.008118484 [3,] 0.2 0.5783223 3.552071 0.4216777 0.026250923 [4,] 0.3 0.5058340 3.456453 0.4941660 0.049380586 [5,] 0.4 0.4689727 3.393812 0.5310273 0.075161080 [6,] 0.5 0.4503881 3.348113 0.5496119 0.102275615 attr(,"conv_code") [1] 0 > > # Solution for two contexts (the latter with faster rate) > numsolve(m, c(Time, Time), x0, cbind(k, k * 1.5)) Time E S ES P [1,] 0.0 1.0000000 4.000000 0.0000000 0.000000000 [2,] 0.1 0.7186230 3.710505 0.2813770 0.008118484 [3,] 0.2 0.5783223 3.552071 0.4216777 0.026250923 [4,] 0.3 0.5058340 3.456453 0.4941660 0.049380586 [5,] 0.4 0.4689727 3.393812 0.5310273 0.075161080 [6,] 0.5 0.4503881 3.348113 0.5496119 0.102275615 [7,] 0.0 1.0000000 4.000000 0.0000000 0.000000000 [8,] 0.1 0.6357616 3.619502 0.3642384 0.016259830 [9,] 0.2 0.5055582 3.456192 0.4944418 0.049366047 [10,] 0.3 0.4578947 3.369297 0.5421053 0.088597607 [11,] 0.4 0.4409743 3.310945 0.5590257 0.130029329 [12,] 0.5 0.4360135 3.263818 0.5639865 0.172195005 attr(,"conv_code") [1] 0 > > # Solution for two contexts (the latter with different initial condition) > numsolve(m, c(Time, Time), cbind(x0, x0 + 1.5), k) Time E S ES P [1,] 0.0 1.0000000 4.000000 0.0000000 0.000000000 [2,] 0.1 0.7186230 3.710505 0.2813770 0.008118484 [3,] 0.2 0.5783223 3.552071 0.4216777 0.026250923 [4,] 0.3 0.5058340 3.456453 0.4941660 0.049380586 [5,] 0.4 0.4689727 3.393812 0.5310273 0.075161080 [6,] 0.5 0.4503881 3.348113 0.5496119 0.102275615 [7,] 0.0 2.5000000 5.500000 1.5000000 1.500000000 [8,] 0.1 1.8785169 4.785120 2.1214831 1.593397205 [9,] 0.2 1.6431085 4.436765 2.3568915 1.706343102 [10,] 0.3 1.5575416 4.230749 2.4424584 1.826793011 [11,] 0.4 1.5323259 4.082601 2.4676741 1.949725186 [12,] 0.5 1.5340356 3.960898 2.4659644 2.073137912 attr(,"conv_code") [1] 0 > > # As above, but with sensitivity equations are solved (using approximate solution) > numsolve(m, c(Time, Time), cbind(x0, x0 + 1.5), k, TRUE) $trajectory Time E S ES P [1,] 0.0 1.0000000 4.000000 0.0000000 0.000000000 [2,] 0.1 0.7186230 3.710505 0.2813770 0.008118484 [3,] 0.2 0.5783223 3.552071 0.4216777 0.026250923 [4,] 0.3 0.5058340 3.456453 0.4941660 0.049380586 [5,] 0.4 0.4689727 3.393812 0.5310273 0.075161080 [6,] 0.5 0.4503881 3.348113 0.5496119 0.102275615 [7,] 0.0 2.5000000 5.500000 1.5000000 1.500000000 [8,] 0.1 1.8785169 4.785120 2.1214831 1.593397205 [9,] 0.2 1.6431085 4.436765 2.3568915 1.706343102 [10,] 0.3 1.5575416 4.230749 2.4424584 1.826793011 [11,] 0.4 1.5323259 4.082601 2.4676741 1.949725186 [12,] 0.5 1.5340356 3.960898 2.4659644 2.073137912 attr(,"conv_code") [1] 0 $sensitivity_param $sensitivity_param[[1]] , , 1 [,1] [,2] [,3] [,4] [1,] 0.0000000 0.0000000 0.0000000 0.000000000 [2,] -0.2444226 -0.2499674 0.2444226 0.005544822 [3,] -0.2948751 -0.3137799 0.2948751 0.018904810 [4,] -0.2892299 -0.3228862 0.2892299 0.033656303 [5,] -0.2709322 -0.3188291 0.2709322 0.047896945 [6,] -0.2541846 -0.3154151 0.2541846 0.061230516 [7,] 0.0000000 0.0000000 0.0000000 0.000000000 [8,] -0.7278666 -0.7469155 0.7278666 0.019048927 [9,] -0.8326400 -0.8908252 0.8326400 0.058185225 [10,] -0.8122265 -0.9118529 0.8122265 0.099626445 [11,] -0.7779314 -0.9176722 0.7779314 0.139740797 [12,] -0.7503494 -0.9286163 0.7503494 0.178266949 , , 2 [,1] [,2] [,3] [,4] [1,] 0.00000000 0.00000000 0.00000000 0.0000000000 [2,] 0.01381611 0.01397518 -0.01381611 -0.0001590723 [3,] 0.03590695 0.03710663 -0.03590695 -0.0011996784 [4,] 0.05494806 0.05821690 -0.05494806 -0.0032688382 [5,] 0.06866852 0.07487133 -0.06866852 -0.0062028101 [6,] 0.07759362 0.08734890 -0.07759362 -0.0097552765 [7,] 0.00000000 0.00000000 0.00000000 0.0000000000 [8,] 0.13290424 0.13573006 -0.13290424 -0.0028258223 [9,] 0.21335364 0.22436838 -0.21335364 -0.0110147388 [10,] 0.25843243 0.28094501 -0.25843243 -0.0225125832 [11,] 0.28207064 0.31789520 -0.28207064 -0.0358245642 [12,] 0.29309458 0.34318905 -0.29309458 -0.0500944683 , , 3 [,1] [,2] [,3] [,4] [1,] 0.00000000 0.000000000 0.00000000 0.00000000 [2,] 0.01405507 -0.001830227 -0.01405507 0.01588530 [3,] 0.03741444 -0.013529414 -0.03741444 0.05094385 [4,] 0.05855778 -0.036381742 -0.05855778 0.09493952 [5,] 0.07492062 -0.068370550 -0.07492062 0.14329117 [6,] 0.08687204 -0.106707483 -0.08687204 0.19357952 [7,] 0.00000000 0.000000000 0.00000000 0.00000000 [8,] 0.14418857 -0.039360501 -0.14418857 0.18354907 [9,] 0.25231114 -0.147745046 -0.25231114 0.40005619 [10,] 0.33287480 -0.293964845 -0.33287480 0.62683965 [11,] 0.39703977 -0.457999209 -0.39703977 0.85503898 [12,] 0.45251779 -0.628744986 -0.45251779 1.08126277 $sensitivity_x0 , , 1 [,1] [,2] [,3] [,4] [1,] 1.0000000 0.0000000 0.0000000 0.000000000 [2,] 0.7033285 -0.3028306 0.2966715 0.006159116 [3,] 0.5744720 -0.4489194 0.4255280 0.023391391 [4,] 0.5163839 -0.5292199 0.4836161 0.045603792 [5,] 0.4913214 -0.5788396 0.5086786 0.070160968 [6,] 0.4816280 -0.6141120 0.5183720 0.095740035 [7,] 1.0000000 0.0000000 0.0000000 0.000000000 [8,] 0.6515144 -0.3569292 0.3484856 0.008443610 [9,] 0.5431933 -0.4850011 0.4568067 0.028194419 [10,] 0.5119187 -0.5397733 0.4880813 0.051691979 [11,] 0.5075685 -0.5686422 0.4924315 0.076210722 [12,] 0.5138654 -0.5869082 0.4861346 0.100773613 , , 2 [,1] [,2] [,3] [,4] [1,] 0.00000000 1.0000000 0.00000000 0.000000000 [2,] -0.06387815 0.9347008 0.06387815 0.001421000 [3,] -0.07984885 0.9151948 0.07984885 0.004956349 [4,] -0.08068171 0.9103336 0.08068171 0.008984642 [5,] -0.07746936 0.9095482 0.07746936 0.012982435 [6,] -0.07416120 0.9090247 0.07416120 0.016814119 [7,] 0.00000000 1.0000000 0.00000000 0.000000000 [8,] -0.14429874 0.8520625 0.14429874 0.003638709 [9,] -0.17697444 0.8114235 0.17697444 0.011602105 [10,] -0.18276095 0.7966563 0.18276095 0.020582796 [11,] -0.18341681 0.7868485 0.18341681 0.029734668 [12,] -0.18399894 0.7770904 0.18399894 0.038910668 , , 3 [,1] [,2] [,3] [,4] [1,] 0.0000000 0.0000000 1.0000000 0.00000000 [2,] 0.1954535 0.1494138 0.8045465 0.04603968 [3,] 0.2933645 0.2088673 0.7066355 0.08449718 [4,] 0.3460065 0.2269916 0.6539935 0.11901490 [5,] 0.3752127 0.2239101 0.6247873 0.15130264 [6,] 0.3922300 0.2099167 0.6077700 0.18231335 [7,] 0.0000000 0.0000000 1.0000000 0.00000000 [8,] 0.1764878 0.1305635 0.8235122 0.04592428 [9,] 0.2539989 0.1684421 0.7460011 0.08555675 [10,] 0.2936477 0.1715165 0.7063523 0.12213119 [11,] 0.3173531 0.1602757 0.6826469 0.15707738 [12,] 0.3337459 0.1427546 0.6662541 0.19099136 , , 4 [,1] [,2] [,3] [,4] [1,] 0 0 0 1 [2,] 0 0 0 1 [3,] 0 0 0 1 [4,] 0 0 0 1 [5,] 0 0 0 1 [6,] 0 0 0 1 [7,] 0 0 0 1 [8,] 0 0 0 1 [9,] 0 0 0 1 [10,] 0 0 0 1 [11,] 0 0 0 1 [12,] 0 0 0 1 > > > # Example: Power law kinetics > A <- matrix(c(1, 0, 1, + 1, 1, 0), byrow = TRUE, nrow = 2) > p <- plk(A) > x0 <- c(10, 4, 1) > theta <- matrix(c(0, -0.25, + 0.75, 0, + 0, -0.1), byrow = TRUE, nrow = 3) > numsolve(p, Time, x0, theta) Time x1 x2 x3 [1,] 0.0 10.000000 4.000000 1.0000000 [2,] 0.1 8.979068 4.559473 0.5916274 [3,] 0.2 7.982913 4.807729 0.1931654 [4,] 0.3 7.075284 4.836895 -0.1698864 [5,] 0.4 6.297647 4.836895 -0.4809413 [6,] 0.5 5.603573 4.836895 -0.7585709 attr(,"conv_code") [1] 0 > > > > > cleanEx() > nameEx("opt") > ### * opt > > flush(stderr()); flush(stdout()) > > ### Name: opt > ### Title: Create 'opt' (optimisation) object > ### Aliases: opt > > ### ** Examples > > > # Generate some data > set.seed(123) > A <- matrix(c(1, 0, 1, + 1, 1, 0), byrow = TRUE, nrow = 2) > p <- plk(A) > x0 <- c(10, 4, 1) > theta <- matrix(c(0, -0.25, + 0.75, 0, + 0, -0.1), byrow = TRUE, nrow = 3) > Time <- seq(0, 1, by = .025) > y <- numsolve(p, Time, x0, theta) > y[, -1] <- y[, -1] + matrix(rnorm(prod(dim(y[, -1])), sd = .1), nrow = nrow(y)) > > # Minimally, you need to supply data: > op <- opt(y) > > # More weight on early observations > w <- outer(1 / seq_len(nrow(y)), rep(1, length(x0))) > op <- opt(y, weights = w) > > # Less weight on first coordinate > w <- outer(rep(1, nrow(y)), c(1, 2, 2)) > op <- opt(y, weights = w) > > # Adjust tuning parameter sequence > op <- opt(y, nlambda = 10, lambda_min_ratio = 0.05) > > > > > cleanEx() > nameEx("plk") > ### * plk > > flush(stderr()); flush(stdout()) > > ### Name: plk > ### Title: Create 'plk' (Power Law Kinetics) object > ### Aliases: plk > > ### ** Examples > > # Power law system > A <- matrix( + c(1, 0, 0, 0, + 0, 1, 2, 0, + 0, 0, 0, 1), ncol = 4, byrow = TRUE) > theta <- matrix( + c(0, 2, -0.5, 0, + 1, 0, 0, 1, + -1, -1, -1, -1), ncol = 3, byrow = TRUE) > x0 <- c(X = 1, Y = 4, Z = 0.1, W = 0.1) > Time <- seq(0, 1, by = .1) > > p <- plk(A) > > # Solve system > numsolve(p, Time, x0, theta) Time X Y Z W [1,] 0.0 1.000000 4.000000 0.10000000 0.100000000 [2,] 0.1 1.005551 4.003908 0.09937962 -0.008670985 [3,] 0.2 1.015184 4.008724 0.10419569 -0.116037401 [4,] 0.3 1.025864 4.014064 0.10953602 -0.225068359 [5,] 0.4 1.037686 4.019975 0.11544678 -0.335849670 [6,] 0.5 1.050839 4.026552 0.12202367 -0.448603052 [7,] 0.6 1.065562 4.033913 0.12938503 -0.563594219 [8,] 0.7 1.082150 4.042207 0.13767876 -0.681144663 [9,] 0.8 1.100976 4.051620 0.14709216 -0.801648004 [10,] 0.9 1.122524 4.062394 0.15786580 -0.925592662 [11,] 1.0 1.147420 4.074842 0.17031383 -1.053593977 attr(,"conv_code") [1] 0 > > # Evaluate field > field(p, x0, theta) X Y Z W 0.03 0.04 -0.06 -1.14 > > > > > cleanEx() > nameEx("print.mak") > ### * print.mak > > flush(stderr()); flush(stdout()) > > ### Name: print.mak > ### Title: Print 'mak' object > ### Aliases: print.mak > > ### ** Examples > > # Michaelis-Menten system > A <- matrix( + c(1, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 0), ncol = 4, byrow = TRUE) > B <- matrix( + c(0, 0, 1, 0, + 1, 1, 0, 0, + 1, 0, 0, 1), ncol = 4, byrow = TRUE) > m <- mak(A, B) > m Reactions: ------------------------------------- X1 + X2 -> X3 X3 -> X1 + X2 X3 -> X1 + X4 Solver type: Runge-Kutta-Fehlberg of order 4/5 Control parameters ---------------------------------- Maximum no. steps 100 Tolerance level 1e-06 Initial step discretisation 1e-04 Initial State Penalty: None Rate Parameter Penalty: l1 norm Control parameters --------------------------------- Maximal no. of steps 200 Steps per cycle 20 Maximal backtracking 50 Tolerance level 1e-05 Initial step length 0.1 Minimal step length 1e-10 Step length factor 0.5 > > > > cleanEx() > nameEx("print.plk") > ### * print.plk > > flush(stderr()); flush(stdout()) > > ### Name: print.plk > ### Title: Print 'plk' object > ### Aliases: print.plk > > ### ** Examples > > # Power law system > A <- matrix( + c(1, 0, 0, 0, + 0, 1, 2, 0, + 0, 0, 0, 0), ncol = 4, byrow = TRUE) > p <- plk(A) > p Powers: ------------------ X1 X2 * X3^2 Solver type: Runge-Kutta-Fehlberg of order 4/5 Control parameters ---------------------------------- Maximum no. steps 100 Tolerance level 1e-06 Initial step discretisation 1e-04 Initial State Penalty: None Theta Penalty: l1 norm Control parameters --------------------------------- Maximal no. of steps 200 Steps per cycle 20 Maximal backtracking 50 Tolerance level 1e-05 Initial step length 0.1 Minimal step length 1e-10 Step length factor 0.5 > > > > cleanEx() > nameEx("print.ratmak") > ### * print.ratmak > > flush(stderr()); flush(stdout()) > > ### Name: print.ratmak > ### Title: Print 'ratmak' object > ### Aliases: print.ratmak > > ### ** Examples > > # Rational mass action kinetics > A <- matrix( + c(1, 0, 0, 0, + 0, 1, 2, 0, + 1, 0, 0, 1), ncol = 4, byrow = TRUE) > x0 <- c(X = 1, Y = 4, Z = 0.1, W = 0.1) > time <- seq(0, 1, by = .1) > > rmak <- ratmak(A, diag(4)) > rmak Powers: -------------------- X1 X2 * X3^2 X1 * X4 Solver type: Runge-Kutta-Fehlberg of order 4/5 Control parameters ---------------------------------- Maximum no. steps 100 Tolerance level 1e-06 Initial step discretisation 1e-04 Initial State Penalty: None Theta1 Penalty: l1 norm Control parameters --------------------------------- Maximal no. of steps 200 Steps per cycle 20 Maximal backtracking 50 Tolerance level 1e-05 Initial step length 0.1 Minimal step length 1e-10 Step length factor 0.5 Theta2 Penalty: l1 norm Control parameters --------------------------------- Maximal no. of steps 200 Steps per cycle 20 Maximal backtracking 50 Tolerance level 1e-05 Initial step length 0.1 Minimal step length 1e-10 Step length factor 0.5 > > > > cleanEx() > nameEx("print.reg") > ### * print.reg > > flush(stderr()); flush(stdout()) > > ### Name: print.reg > ### Title: Print 'reg' object > ### Aliases: print.reg > > ### ** Examples > > # Example: default regularisation > reg() Penalty: l1 norm Control parameters --------------------------------- Maximal no. of steps 200 Steps per cycle 20 Maximal backtracking 50 Tolerance level 1e-05 Initial step length 0.1 Minimal step length 1e-10 Step length factor 0.5 > > > > > cleanEx() > nameEx("print.rlk") > ### * print.rlk > > flush(stderr()); flush(stdout()) > > ### Name: print.rlk > ### Title: Print 'rlk' object > ### Aliases: print.rlk > > ### ** Examples > > # Rational law kinetics > A <- matrix( + c(1, 0, 0, 0, + 0, 1, 2, 0, + 0, 0, 0, 1), ncol = 4, byrow = TRUE) > r <- rlk(A, A[c(2, 1, 3), ]) > r Fractions: ---------------------------------------------- X1 / 1 + X2 * X3^2 X2 * X3^2 / 1 + X1 X4 / 1 + X4 Solver type: Runge-Kutta-Fehlberg of order 4/5 Control parameters ---------------------------------- Maximum no. steps 100 Tolerance level 1e-06 Initial step discretisation 1e-04 Initial State Penalty: None Theta Penalty: l1 norm Control parameters --------------------------------- Maximal no. of steps 200 Steps per cycle 20 Maximal backtracking 50 Tolerance level 1e-05 Initial step length 0.1 Minimal step length 1e-10 Step length factor 0.5 > > > > cleanEx() > nameEx("print.solver") > ### * print.solver > > flush(stderr()); flush(stdout()) > > ### Name: print.solver > ### Title: Print 'solver' object > ### Aliases: print.solver > > ### ** Examples > > # Dormand-Prince 4/5 scheme > solver("dp45") Solver type: Dormand-Prince of order 4/5 Control parameters ---------------------------------- Maximum no. steps 100 Tolerance level 1e-06 Initial step discretisation 1e-04> > # Runge-Kutta-Fehlberg 4/5 scheme (default) > solver() Solver type: Runge-Kutta-Fehlberg of order 4/5 Control parameters ---------------------------------- Maximum no. steps 100 Tolerance level 1e-06 Initial step discretisation 1e-04> > > > > cleanEx() > nameEx("ratmak") > ### * ratmak > > flush(stderr()); flush(stdout()) > > ### Name: ratmak > ### Title: Create 'ratmak' (Rational Mass Action Kinetics) object > ### Aliases: ratmak > > ### ** Examples > > # Rational mass action kinetics > A <- matrix( + c(1, 0, 0, 0, + 0, 1, 2, 0, + 1, 0, 0, 1), ncol = 4, byrow = TRUE) > x0 <- c(X = 1, Y = 4, Z = 0.1, W = 0.1) > time <- seq(0, 1, by = .1) > > rmak <- ratmak(A, diag(4)) > > # Solve system > numsolve(o = rmak, time = time, x0 = x0, + param = list(theta1 = t(A * 1:3), + theta2 = t((A + 1) * 3:1))) Time X Y Z W [1,] 0.0 1.000000 4.000000 0.1000000 0.1000000 [2,] 0.1 1.018330 4.002059 0.1040339 0.1078243 [3,] 0.2 1.037479 4.004444 0.1086931 0.1170774 [4,] 0.3 1.057060 4.007012 0.1136988 0.1270929 [5,] 0.4 1.077081 4.009773 0.1190699 0.1378880 [6,] 0.5 1.097568 4.012745 0.1248413 0.1495083 [7,] 0.6 1.118546 4.015951 0.1310521 0.1620001 [8,] 0.7 1.140041 4.019415 0.1377453 0.1754094 [9,] 0.8 1.162079 4.023163 0.1449683 0.1897806 [10,] 0.9 1.184683 4.027226 0.1527726 0.2051558 [11,] 1.0 1.207878 4.031635 0.1612143 0.2215738 attr(,"conv_code") [1] 0 > > # Evaluate field > field(rmak, x0, + param = list(theta1 = t(A * 1:3), + theta2 = t((A + 1) * 3:1))) X Y Z W 0.17857143 0.01877934 0.03686636 0.07009346 > > > > > cleanEx() > nameEx("reg") > ### * reg > > flush(stderr()); flush(stdout()) > > ### Name: reg > ### Title: Create 'reg' (regularisation) object > ### Aliases: reg > > ### ** Examples > > # Use 'reg' object to specify regularisation when creating 'ode' objects > > # Example: power law kinetics with SCAD penalty on rate parameter > A <- matrix( + c(1, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 0), ncol = 4, byrow = TRUE) > p <- plk(A, r = reg("scad")) > > # Example: power law kinetics as above, with lower bound of -1 > p <- plk(A, r = reg("scad", lower = -1)) > > # Example: rational mass action kinetics with > # MCP penalty on first parameter argument and l2 on second > B <- matrix( + c(0, 0, 1, 0, + 1, 1, 0, 0, + 1, 0, 0, 1), ncol = 4, byrow = TRUE) > rmak <- ratmak(A, B, r1 = reg("mcp"), r2 = reg("l2")) > > # Example: mass action kinetics with > # no penalty on rate parameter and l2 on initial state > m <- mak(A, B, r = reg("none"), rx0 = reg("l2")) > > > > > cleanEx() > nameEx("rlk") > ### * rlk > > flush(stderr()); flush(stdout()) > > ### Name: rlk > ### Title: Create 'rlk' (Rational Law Kinetics) object > ### Aliases: rlk > > ### ** Examples > > # Rational law kinetics > A <- matrix( + c(1, 0, 0, 0, + 0, 1, 2, 0, + 0, 0, 0, 1), ncol = 4, byrow = TRUE) > theta <- matrix( + c(0, 2, -0.5, 0, + 1, 0, 0, 1, + -1, -1, -1, -1), ncol = 3, byrow = TRUE) > x0 <- c(X = 1, Y = 4, Z = 0.1, W = 0.1) > time <- seq(0, 1, by = .1) > r <- rlk(A, A[c(2, 1, 3), ]) > > # Solve system > numsolve(o = r, time = time, x0 = x0, param = theta) Time X Y Z W [1,] 0.0 1.000000 4.000000 0.10000000 0.100000000 [2,] 0.1 1.001622 4.001919 0.09748658 -0.002698143 [3,] 0.2 1.005717 4.003967 0.09953438 -0.101677767 [4,] 0.3 1.010442 4.006329 0.10189670 -0.201828826 [5,] 0.4 1.015395 4.008806 0.10437327 -0.302382606 [6,] 0.5 1.020584 4.011400 0.10696753 -0.403338274 [7,] 0.6 1.026024 4.014120 0.10968778 -0.504709783 [8,] 0.7 1.031735 4.016976 0.11254313 -0.606511829 [9,] 0.8 1.037736 4.019976 0.11554360 -0.708759694 [10,] 0.9 1.044049 4.023133 0.11870018 -0.811469259 [11,] 1.0 1.050699 4.026457 0.12202499 -0.914657006 attr(,"conv_code") [1] 0 > > # Evaluate field > field(r, x0, theta) X Y Z W -0.005454545 0.020000000 -0.070909091 -1.072447552 > > > > > cleanEx() > nameEx("rodeo") > ### * rodeo > > flush(stderr()); flush(stdout()) > > ### Name: rodeo > ### Title: Regularised Ordinary Differential Equation Optimisation (RODEO) > ### generic > ### Aliases: rodeo > > ### ** Examples > > set.seed(123) > # Michaelis-Menten system with two 0-rate reactions > A <- matrix(c(1, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 0, + 0, 0, 0, 1, + 1, 0, 0, 0), ncol = 4, byrow = TRUE) > B <- matrix(c(0, 0, 1, 0, + 1, 1, 0, 0, + 1, 0, 0, 1, + 0, 0, 1, 0, + 1, 0, 1, 0), ncol = 4, byrow = TRUE) > k <- c(1.1, 2.5, 0.25, 0, 0); x0 <- c(E = 2, S = 2, ES = 8.5, P = 2.5) > Time <- seq(0, 10, by = 1) > > # Simulate data, in second context the catalytic rate has been doubled > contexts <- cbind(1, c(1, 1, 2, 1, 1)) > m <- mak(A, B, r = reg(contexts = contexts)) > y <- numsolve(m, c(Time, Time), cbind(x0, x0 + c(2, -2, 0, 0)), contexts * k) > y[, -1] <- y[, -1] + matrix(rnorm(prod(dim(y[, -1])), sd = .5), nrow = nrow(y)) > > # Example: fit data using rodeo on mak-object > op <- opt(y, nlambda = 10) > fit <- rodeo(m, op, x0 = NULL, params = NULL) ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x4BB87CC: log@@GLIBC_2.29 (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C5C26: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:200) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C55B1: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C55B1: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:139) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x4BB87E3: log@@GLIBC_2.29 (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C5C26: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:200) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C55B1: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C55B1: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:139) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x4BB87E5: log@@GLIBC_2.29 (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C5C26: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:200) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C55B1: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C55B1: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:139) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x4C0CF4C: __ieee754_log_avx (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C5C26: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:200) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C55B1: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C55B1: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:139) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x4C0CF5B: __ieee754_log_avx (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C5C26: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:200) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C55B1: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C55B1: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:139) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x4C0D178: __ieee754_log_avx (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C5C26: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:200) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C55B1: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C55B1: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:139) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== > fit$params$rate 5 x 10 sparse Matrix of class "dgCMatrix" [1,] . . . . . 0.003971029 0.0086329027 [2,] . . . . . . 0.0008868052 [3,] . 0.04135856 0.0875091 0.1325837 0.1696533 0.191046996 0.2104656525 [4,] . . . . . . . [5,] . . . . . . . [1,] 0.04220816 0.07638354 0.1213487 [2,] 0.07151463 0.15475567 0.2658025 [3,] 0.22034066 0.22547278 0.2285435 [4,] . . . [5,] . . . > > # Example: fit dat using rodeo on aim-object > a <- aim(m, op) > a$params$rate 5 x 10 sparse Matrix of class "dgCMatrix" [[ suppressing 10 column names ‘s0’, ‘s1’, ‘s2’ ... ]] V1 . . . . 0.05332383 0.09622265 0.1116297 0.1171562 V2 . . . . 0.10374806 0.18998008 0.2209516 0.2320625 V3 . 0.1693495 0.2302106 0.2520829 0.25861325 0.25910350 0.2592796 0.2593428 V4 . . . . . . . . V5 . . . . . . . . V1 0.1191713 0.119359158 V2 0.2361097 0.236058349 V3 0.2593658 0.261855067 V4 . 0.003071391 V5 . . > fit <- rodeo(a) ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x4C0D187: __ieee754_log_avx (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C819E: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:615) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C80CD: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C80CD: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:601) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x4C0D18C: __ieee754_log_avx (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C819E: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:615) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x4C0D19A: __ieee754_log_avx (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C819E: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:615) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C80CD: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C80CD: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:601) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== ==42579== Use of uninitialised value of size 8 ==42579== at 0x4C0CFD8: __ieee754_log_avx (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C819E: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:615) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C80CD: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C80CD: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:601) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== ==42579== Use of uninitialised value of size 8 ==42579== at 0x4C0CFE1: __ieee754_log_avx (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C819E: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:615) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C80CD: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C80CD: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:601) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x17277083: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C819E: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:615) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x17277083: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172CA218: bronc(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, arma::Col, bool, bool, bool, bool) (packages/tests-vg/episode/src/ode_optim.cpp:803) ==42579== by 0x17256A1C: _episode_bronc (packages/tests-vg/episode/src/RcppExports.cpp:101) ==42579== by 0x49BFC7: R_doDotCall (svn/R-devel/src/main/dotcode.c:646) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== > fit$params$rate 5 x 10 sparse Matrix of class "dgCMatrix" [1,] . . . . . 0.001094063 0.006409054 [2,] . . . . . . . [3,] . 0.04117896 0.08783107 0.1290781 0.1698418 0.192951881 0.210291624 [4,] . . . . . . . [5,] . . . . . . . [1,] 0.02035030 0.06462059 0.1011546 [2,] 0.02333503 0.12708629 0.2152751 [3,] 0.21853131 0.22527352 0.2279734 [4,] . . . [5,] . . . > > > > > cleanEx() > nameEx("rodeo.aim") > ### * rodeo.aim > > flush(stderr()); flush(stdout()) > > ### Name: rodeo.aim > ### Title: Regularised Ordinary Differential Equation Optimisation (RODEO) > ### initialised via Adaptive Integral Matching > ### Aliases: rodeo.aim > > ### ** Examples > > set.seed(123) > # Example: Power Law Kinetics > A <- matrix(c(1, 0, 1, + 1, 1, 0), byrow = TRUE, nrow = 2) > p <- plk(A) > x0 <- c(10, 4, 1) > theta <- matrix(c(0, -0.25, + 0.75, 0, + 0, -0.1), byrow = TRUE, nrow = 3) > Time <- seq(0, 1, by = .025) > > # Simulate data > y <- numsolve(p, Time, x0, theta) > y[, -1] <- y[, -1] + matrix(rnorm(prod(dim(y[, -1])), sd = .25), nrow = nrow(y)) > > # Estimation via aim > a <- aim(p, opt(y, nlambda = 10)) > a$params$theta 6 x 10 sparse Matrix of class "dgCMatrix" [[ suppressing 10 column names ‘s0’, ‘s1’, ‘s2’ ... ]] V1 . . . 0.29847978 0.46014493 0.5179104 0.5387532 V2 . . 0.278327164 0.42263018 0.47449000 0.4931274 0.4998254 V3 . . . . 0.03725852 0.1869986 0.2409855 V4 . -0.1506354 -0.204770944 -0.24435763 -0.26225323 -0.2686621 -0.2709709 V5 . . . . . . . V6 . . -0.005569053 -0.06091824 -0.08332266 -0.1005707 -0.1067810 V1 0.5462543 0.5489580 0.550031544 V2 0.5022325 0.5030976 0.495071328 V3 0.2604233 0.2674296 0.270237931 V4 -0.2718013 -0.2721003 -0.272214622 V5 . . 0.001437466 V6 -0.1090153 -0.1098197 -0.110128311 > > # Supply to rodeo > rod <- rodeo(a) > rod$params$theta 6 x 10 sparse Matrix of class "dgCMatrix" [1,] . . . . 0.29833727 0.46028214 0.5500076 [2,] . . . . 0.26506776 0.41446746 0.4950687 [3,] . . . . . 0.05843985 0.2701991 [4,] . -0.1125424 -0.2016062 -0.2458128 -0.26620766 -0.28511995 -0.2759643 [5,] . . . . . . . [6,] . . . -0.0577267 -0.08175971 -0.09164933 -0.1086810 [1,] 0.5500076 0.550016807 0.55002479 [2,] 0.4950687 0.495074109 0.49507675 [3,] 0.2701991 0.270218003 0.27022954 [4,] -0.2759643 -0.275510740 -0.27471784 [5,] . 0.002874598 0.00677464 [6,] -0.1086810 -0.109172523 -0.11269112 > > # Compare with true parameter on column vector form > matrix(theta, ncol = 1) [,1] [1,] 0.00 [2,] 0.75 [3,] 0.00 [4,] -0.25 [5,] 0.00 [6,] -0.10 > > > # Example: include data from an intervened system > # where the first complex in A is inhibited > contexts <- cbind(1, c(0, 0, 0, 1, 1, 1)) > y2 <- numsolve(p, Time, x0 + 1, theta * contexts[, 2]) > y2[, -1] <- y2[, -1] + matrix(rnorm(prod(dim(y2[, -1])), sd = .25), nrow = nrow(y2)) > > # Estimation via aim > a <- aim(plk(A, r = reg(contexts = contexts)), opt(rbind(y, y2), nlambda = 10)) > a$params$theta 6 x 10 sparse Matrix of class "dgCMatrix" [[ suppressing 10 column names ‘s0’, ‘s1’, ‘s2’ ... ]] V1 . . . . 0.18278143 0.26128721 0.28953576 V2 . . 0.1900497 0.39090492 0.46308853 0.48902997 0.49835284 V3 . . . . . . 0.08020309 V4 . -0.1429035 -0.1942604 -0.21271709 -0.22453960 -0.22915230 -0.23081102 V5 . . . . . . . V6 . . . -0.05078163 -0.07126807 -0.07863052 -0.08355357 V1 0.29961283 0.3032852 0.30438400 V2 0.50170331 0.5029074 0.50334013 V3 0.11007230 0.1209331 0.12418286 V4 -0.23140500 -0.2316199 -0.23169087 V5 . . . V6 -0.08535251 -0.0860026 -0.08621768 > > # Supply to rodeo > rod <- rodeo(a) > rod$params$theta 6 x 10 sparse Matrix of class "dgCMatrix" [1,] . . . . . 0.16359291 0.26125908 [2,] . . . . 0.32694563 0.43389538 0.48266894 [3,] . . . . . . . [4,] . -0.1008438 -0.1830132 -0.22533813 -0.24275847 -0.25250075 -0.25370853 [5,] . . . . . . . [6,] . . . -0.04559933 -0.07475567 -0.08797513 -0.09280709 [1,] 0.30435296 0.30435623 0.304360512 [2,] 0.50333886 0.50334024 0.503341594 [3,] 0.12410670 0.12411588 0.124127398 [4,] -0.25667142 -0.25648212 -0.256210431 [5,] . . 0.003641435 [6,] -0.09779771 -0.09809729 -0.098791830 > > > > > > cleanEx() > nameEx("rodeo.ode") > ### * rodeo.ode > > flush(stderr()); flush(stdout()) > > ### Name: rodeo.ode > ### Title: Regularised Ordinary Differential Equation Optimisation (RODEO) > ### Aliases: rodeo.ode > > ### ** Examples > > set.seed(123) > # Example: Michaelis-Menten system with two 0-rate reactions > A <- matrix(c(1, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 0, + 0, 1, 0, 0, + 0, 0, 0, 1), ncol = 4, byrow = TRUE) > B <- matrix(c(0, 0, 1, 0, + 1, 1, 0, 0, + 1, 0, 0, 1, + 0, 0, 0, 1, + 0, 0, 1, 0), ncol = 4, byrow = TRUE) > k <- c(1, 2, 0.5, 0, 0); x0 <- c(E = 2, S = 8, ES = 0.5, P = 0.5) > Time <- seq(0, 10, by = 1) > > # Simulate data, in second context the catalytic rate has been doubled > m <- mak(A, B) > contexts <- cbind(1, c(1, 1, 2, 1, 1)) > y <- numsolve(m, c(Time, Time), cbind(x0, x0 + c(2, -2, 0, 0)), contexts * k) > y[, -1] <- y[, -1] + matrix(rnorm(prod(dim(y[, -1])), sd = .1), nrow = nrow(y)) > > # Fit data using rodeo on mak-object > op <- opt(y) > fit <- rodeo(m, op, x0 = NULL, params = NULL) ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x17277083: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C5C26: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:200) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x17277D2A: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:507) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C5C26: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:200) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== > > # Example: fit data knowing doubled catalytic rate > m_w_doubled <- mak(A, B, r = reg(contexts = contexts)) > fit <- rodeo(m_w_doubled, op, x0 = NULL, params = NULL) ==42579== Conditional jump or move depends on uninitialised value(s) ==42579== at 0x4BEB314: __math_invalid (in /usr/lib64/libm-2.29.so) ==42579== by 0x1727677B: optim::conv_criteria(__gnu_cxx::__normal_iterator > >, double, arma::Col) (packages/tests-vg/episode/src/motor_optim.cpp:319) ==42579== by 0x17277074: optim::optimise(__gnu_cxx::__normal_iterator > >) (packages/tests-vg/episode/src/motor_optim.cpp:385) ==42579== by 0x17277983: optim::optimise() (packages/tests-vg/episode/src/motor_optim.cpp:476) ==42579== by 0x172784CE: operator() (/usr/include/c++/9/bits/stl_function.h:1248) ==42579== by 0x172784CE: for_each<__gnu_cxx::__normal_iterator >, std::mem_fun_ref_t > (/usr/include/c++/9/bits/stl_algo.h:3876) ==42579== by 0x172784CE: move(std::vector >&) (packages/tests-vg/episode/src/motor_optim.cpp:559) ==42579== by 0x172C5C26: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:200) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== Uninitialised value was created by a heap allocation ==42579== at 0x4838E86: operator new(unsigned long) (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:344) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/ext/new_allocator.h:114) ==42579== by 0x172CF4C2: allocate (/usr/include/c++/9/bits/alloc_traits.h:444) ==42579== by 0x172CF4C2: _M_allocate (/usr/include/c++/9/bits/stl_vector.h:343) ==42579== by 0x172CF4C2: void std::vector >::_M_realloc_insert(__gnu_cxx::__normal_iterator > >, optim&&) (/usr/include/c++/9/bits/vector.tcc:440) ==42579== by 0x172C55B1: push_back (/usr/include/c++/9/bits/stl_vector.h:1201) ==42579== by 0x172C55B1: bull(Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, Rcpp::Vector<19, Rcpp::PreserveStorage>, arma::Cube, bool) (packages/tests-vg/episode/src/ode_optim.cpp:139) ==42579== by 0x17254986: _episode_bull (packages/tests-vg/episode/src/RcppExports.cpp:65) ==42579== by 0x49C053: R_doDotCall (svn/R-devel/src/main/dotcode.c:626) ==42579== by 0x4D84D1: bcEval (svn/R-devel/src/main/eval.c:7609) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== by 0x4EB72C: Rf_applyClosure (svn/R-devel/src/main/eval.c:1778) ==42579== by 0x4DC310: bcEval (svn/R-devel/src/main/eval.c:7021) ==42579== by 0x4E8D6F: Rf_eval (svn/R-devel/src/main/eval.c:688) ==42579== by 0x4EA976: R_execClosure (svn/R-devel/src/main/eval.c:1852) ==42579== > > > > > cleanEx() > nameEx("solver") > ### * solver > > flush(stderr()); flush(stdout()) > > ### Name: solver > ### Title: Create 'solver' object > ### Aliases: solver > > ### ** Examples > > # Use 'solver' object to specify numerical solver when creating 'ode' objects > > # Example: power law kinetics with Dormand-Prince order 4/5 solver > A <- matrix( + c(1, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 1, 0), ncol = 4, byrow = TRUE) > p <- plk(A, s = solver("dp45")) > > # Example: ... and with more steps > p <- plk(A, s = solver("dp45", step_max = 1e3)) > > # Example: rational mass action kinetics with Runge-Kutta order 2/3 solver > B <- matrix( + c(0, 0, 1, 0, + 1, 1, 0, 0, + 1, 0, 0, 1), ncol = 4, byrow = TRUE) > rmak <- ratmak(A, B, s = solver("rk23")) > > > > > ### *