Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: matrix multiplication: problem with matrix inverse; suggest to use solve() instead #649

Open
Danielsite opened this issue Mar 5, 2024 · 3 comments

Comments

@Danielsite
Copy link

Hi Mattfidler,

I found this error when I deploy my R shiny app with shinyproxy. I was Ok when I run my app in local.
Could you please help me with this issues?

image

@mattfidler
Copy link
Contributor

mattfidler commented Mar 6, 2024

Hi @Danielsite

There isn't enough information for me to help.

If this is in ShinyMixR, you can ask there.

Also @RichardHooijmaijers has alot of experience with Shiny and nlmixr2 he may be able to help or have seen this before.

https://github.com/RichardHooijmaijers/shinyMixR

@Danielsite
Copy link
Author

Hi @RichardHooijmaijers @mattfidler,

When I used nlmixr2 version 2.0.9 I would not get this error (but the running time is too slow). However once I used the latest nlmixr2 (2.1.1), the error popped up. matrix multiplication: problem with matrix inverse; suggest to use solve() instead

I think the main reason is the BLAS system.

Below is my sessionInfo:

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0

Below is my Poppk model, I think the syntax should be ok.
"model.2cpt.ode.lag <- function() {
ini({
tka <- log(0.5) # log(ka)
tcl <- log(25) # log(CL)
tv2 <- log(500) # log(V2)
tv3 <- log(1000) # log(V3)
tq <- log(55) # log(Q)
tlag <- log(0.5)
tclwtbl <- log(2)
tclsubtp <- log(1.8)
tv2wtbl <- log(2)
tv2subtp <- log(3)
tv3alpbl <- log(0.6)
eta.ka ~ 0.1 # IIV on ka
eta.cl ~ 0.1 # IIV on CL
eta.v2 ~ 0.1 # IIV on V2
eta.v3 ~ 0.1 # IIV on V3
eta.q ~ 0.1 # IIV on Q
eta.tlag ~ 0.1 # IIV on lagtime
prop.err <- 0.1

                         })
                         model({
                           ka <- exp(tka + eta.ka)
                           cl <- exp(tcl + eta.cl+ log(WTBL)*tclwtbl + tclsubtp * (2-SUBJTYP))
                           v2 <- exp(tv2 + eta.v2+ log(WTBL)*tv2wtbl + tv2subtp * (2-SUBJTYP))
                           v3 <- exp(tv3 + eta.v3+ log(ALPBL)*tv3alpbl)
                           q <- exp(tq + eta.q)
                           d/dt(depot) = -ka * depot
                           d/dt(center) = ka * depot - cl / v2 * center + q/v3 * periph - q/v2 * center
                           d/dt(periph) = q/v2 * center - q/v3 * periph
                           lag(center) = exp(tlag + eta.tlag)
                           cp = center / v2
                           cp ~ prop(prop.err)
                         })
                       }"

I would be appreciated if you can help me figure out the issue! Thank you!

@mattfidler
Copy link
Contributor

Hi Danelle,

Thank you for providing the model. Unfortunately the model alone does not allow me to reproduce the issue.

Probably, the most robust way to reproduce something I can use is to use the reprex package:

https://reprex.tidyverse.org/

Once you have a way to reproduce the matrix multiplication issue, I could help more with this particular issue .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants