-
Notifications
You must be signed in to change notification settings - Fork 7
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
rxode2
pipe out non-diagonal elements
#781
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Is that to remove correlation between a and b without changing the estimates? |
For example: library(rxode2)
#> rxode2 3.0.0 using 8 threads (see ?getRxThreads)
#> no cache: create with `rxCreateCache()`
mod2 <- function() {
ini({
lka ~ 0.45
lcl ~ c(0.01, 1)
lvc ~ c(-0.01, 0.01, 3.45)
lfun ~ c(-0.1, 0.1, 0.01, 4)
})
model({
ka <- exp(lka)
cl <- exp(lcl)
vc <- exp(lvc)
kel <- cl / vc
d/dt(depot) <- -ka*depot
d/dt(central) <- ka*depot-kel*central
cp <- central / vc + lfun
})
}
# Will reorder
mod2 %>% ini(diag(lcl, lvc))
#> ℹ remove covariance `(lka,lcl)`
#> ℹ remove covariance `(lcl,lvc)`
#> ℹ remove covariance `(lcl,lfun)`
#> ℹ remove covariance `(lka,lvc)`
#> ℹ remove covariance `(lvc,lfun)`
#> ── rxode2-based free-form 2-cmt ODE model ──────────────────────────────────────
#> ── Initalization: ──
#>
#> Omega ($omega):
#> lfun lka lvc lcl
#> lfun 4.0 -0.10 0.00 0
#> lka -0.1 0.45 0.00 0
#> lvc 0.0 0.00 3.45 0
#> lcl 0.0 0.00 0.00 1
#>
#> States ($state or $stateDf):
#> Compartment Number Compartment Name
#> 1 1 depot
#> 2 2 central
#> ── Model (Normalized Syntax): ──
#> function() {
#> ini({
#> lfun ~ 4
#> lka ~ c(-0.1, 0.45)
#> lvc ~ 3.45
#> lcl ~ 1
#> })
#> model({
#> ka <- exp(lka)
#> cl <- exp(lcl)
#> vc <- exp(lvc)
#> kel <- cl/vc
#> d/dt(depot) <- -ka * depot
#> d/dt(central) <- ka * depot - kel * central
#> cp <- central/vc + lfun
#> })
#> } Created on 2024-09-07 with reprex v2.1.1 |
You can also see the new lower triangular form here.... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
something like:
%>% ini(diag(a,b))
or%>% ini(diag(a+b))