metrumresearchgroup / Torsten

library of C++ functions that support applications of Stan in Pharmacometrics
BSD 3-Clause "New" or "Revised" License
52 stars 11 forks source link

[BUG] #30

Closed ghost closed 3 years ago

ghost commented 3 years ago

I am using macOS Mojave system version 10.14.6. I am using R version 3.6.3 and cmdstan_version (2.25.0).

I have compiled and excute the Torsten examples before with no issues early today, however, now I have started receiving error massages as below:

suppressMessages(library(tidyverse)) suppressMessages(library(bayesplot)) suppressMessages(library(parallel)) library(cmdstanr)

setwd("~/Desktop/Torsten-master/example-models/pk2cpt") set_cmdstan_path(path = file.path("..", "..", "cmdstan")) CmdStan path set to: /Users/mg/Desktop/Torsten-master/example-models/pk2cpt/../../cmdstan

nChains <- 4 nPost <- 500 ## Number of post-burn-in samples per chain after thinning nBurn <- 500 ## Number of burn-in samples per chain after thinning nThin <- 1

nIter <- (nPost + nBurn) nThin nBurnin <- nBurn nThin nsample = nIter - nBurnin

file <- file.path(cmdstan_path(), "..", "example-models", "pk2cpt", "pk2cpt.stan") model <- cmdstan_model(file)

Compiling Stan program... \ Semantic error in '/var/folders/bd/xq4sxv9j3bl_j6rt1hggt3ch0000gn/T/Rtmpp29l70/model-31fb39d93132.stan', line 53, column 6 to column 65:

51:    // arrays abd returns a matrix with the predicted amount in each 
52:    // compartment at each event.
53:    x = pmx_solve_twocpt(time, amt, ii, evid, cmt, addl, ss, theta);
           ^
54:  
55:    cHat = x[2, :] ./ V1; // we're interested in the amount in the second compartment

Ill-typed arguments supplied to function 'pmx_solve_twocpt'. Available signatures: (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[], real[]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[], real[], real[]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[], real[], real[,]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[], real[,]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[], real[,], real[]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[], real[,], real[,]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[,]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[,], real[]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[,], real[], real[]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[,], real[], real[,]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[,], real[,]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[,], real[,], real[]) => matrix (real[], real[], real[], real[], data int[], data int[], data int[], data int[], real[,], real[,], real[,]) => matrix Instead supplied arguments of incompatible type: real[], real[], real[], int[], int[], int[], int[], real[].

make: *** [/var/folders/bd/xq4sxv9j3bl_j6rt1hggt3ch0000gn/T/Rtmpp29l70/model-31fb39d93132.hpp] Error 1 Error: An error occured during compilation! See the message above for more information.

I had an issue compiling mrgsolve model to simulate the data using R script in "pk2cpt" folder "pk2cpt_sim.R" but the compilation of mrgsolve model failed ,so I have reinstall mrgsolve package again and managed to simulate the data, but Torsten failed.

Unfortunately I have not saved the whole error massage from mrgsolve run but this is one line I used to search for solution for the problem:

In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:

Thank you in advance for your help.

yizhang-yiz commented 3 years ago

For some reason the pmx_solve_twocpt in your model is missing rate argument. The line should be like

https://github.com/metrumresearchgroup/Torsten/blob/c78a5b473f7009aa9e9a3f4848c48aac1e5c6951/example-models/pk2cpt/pk2cpt.stan#L53

Did you happen to be editing the model file?

ghost commented 3 years ago

Worked , awesome, really appreciated .

On Dec 17, 2020, at 10:12 PM, Yi Zhang notifications@github.com wrote:

For some reason the pmx_solve_twocpt in your model is missing rate argument. The line should be like

https://github.com/metrumresearchgroup/Torsten/blob/c78a5b473f7009aa9e9a3f4848c48aac1e5c6951/example-models/pk2cpt/pk2cpt.stan#L53 https://github.com/metrumresearchgroup/Torsten/blob/c78a5b473f7009aa9e9a3f4848c48aac1e5c6951/example-models/pk2cpt/pk2cpt.stan#L53 Did you happen to be editing the model file?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/metrumresearchgroup/Torsten/issues/30#issuecomment-747840705, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCB3ISD5MBMOC7IGMEX7B3SVLCATANCNFSM4VASDP2Q.