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

Invalid off-diagonal eta created with piping #518

Closed
billdenney opened this issue May 5, 2023 · 1 comment · Fixed by #608
Closed

Invalid off-diagonal eta created with piping #518

billdenney opened this issue May 5, 2023 · 1 comment · Fixed by #608

Comments

@billdenney
Copy link
Contributor

In the example below, (etad,etaf) exists but with only neta1 and not neta2. I think that the important part is pulling an eta from more than one block eta at the same time.

library(nlmixr2)
#> Loading required package: nlmixr2data

mod <- function() {
  ini({
    a <- 1
    b <- 2
    etaa + etab ~ c(3, 0.1, 4)
    c <- 5
    etac ~ 6
    d <- 7
    f <- 9
    etad + etaf ~ c(8, 0.2, 10)
  })
  model({
     g <- (a + etaa)/(b + etab)
     h <- (c + etac)
     i <- (d + etad)
     j <- f + etaf
  })
}

mod_new <-
  ini(
    nlmixr(mod),
    etab + etac + etad ~
      c(7,
        0.2, 8,
        0.3, 0.4, 9),
    etaa ~ 0
  )
#> ℹ some correlations may have been dropped for the variables: `etab`, `etac`, `etad`
#> ℹ the piping should specify the needed covariances directly
#> ℹ change initial estimate of `etab` to `7`
#> ℹ add covariance between `etac` and `etab` with initial estimate `0.2`
#> ℹ change initial estimate of `etac` to `8`
#> ℹ add covariance between `etad` and `etab` with initial estimate `0.3`
#> ℹ add covariance between `etad` and `etac` with initial estimate `0.4`
#> ℹ change initial estimate of `etad` to `9`
#> ℹ change initial estimate of `etaa` to `0`
mod_new$iniDf
#>    ntheta neta1 neta2        name lower  est upper   fix label backTransform
#> 1       1    NA    NA           a  -Inf  1.0   Inf FALSE  <NA>          <NA>
#> 2       2    NA    NA           b  -Inf  2.0   Inf FALSE  <NA>          <NA>
#> 3       3    NA    NA           c  -Inf  5.0   Inf FALSE  <NA>          <NA>
#> 4       4    NA    NA           d  -Inf  7.0   Inf FALSE  <NA>          <NA>
#> 5       5    NA    NA           f  -Inf  9.0   Inf FALSE  <NA>          <NA>
#> 6      NA     1     1        etaa  -Inf  0.0   Inf FALSE  <NA>          <NA>
#> 11     NA     2    NA (etad,etaf)  -Inf  0.2   Inf FALSE  <NA>          <NA>
#> 12     NA     2     2        etaf  -Inf 10.0   Inf FALSE  <NA>          <NA>
#> 8      NA     3     3        etab  -Inf  7.0   Inf FALSE  <NA>          <NA>
#> 9      NA     4     4        etac  -Inf  8.0   Inf FALSE  <NA>          <NA>
#> 10     NA     5     5        etad  -Inf  9.0   Inf FALSE  <NA>          <NA>
#> 13     NA     4     3 (etab,etac)  -Inf  0.2   Inf FALSE  <NA>          <NA>
#> 14     NA     5     3 (etab,etad)  -Inf  0.3   Inf FALSE  <NA>          <NA>
#> 15     NA     5     4 (etac,etad)  -Inf  0.4   Inf FALSE  <NA>          <NA>
#>    condition  err
#> 1       <NA> <NA>
#> 2       <NA> <NA>
#> 3       <NA> <NA>
#> 4       <NA> <NA>
#> 5       <NA> <NA>
#> 6         id <NA>
#> 11        id <NA>
#> 12        id <NA>
#> 8         id <NA>
#> 9         id <NA>
#> 10        id <NA>
#> 13        id <NA>
#> 14        id <NA>
#> 15        id <NA>

Created on 2023-05-04 with reprex v2.0.2

@billdenney
Copy link
Contributor Author

When I found this issue, I also had #481 in the same problem. They could be related.

@mattfidler mattfidler linked a pull request Nov 30, 2023 that will close this 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

Successfully merging a pull request may close this issue.

1 participant