factcircuit
FactCircuit는 불변 출처와 단계별 검증, 제한된 검색, 재현 가능한 평가를 제공하는 감사 가능한 주장·증거 검증 루프입니다
ferx는 인구 PK/PD 비선형 혼합효과 모델링 오픈소스 플랫폼으로 R 패키지와 고성능 Rust 엔진을 제공한다
ferx is an open-source nonlinear mixed-effects modeling platform for population PK/PD, with an R package and high-performance Rust engine.
데이터Rust · Visual Basic 6.0GitHub @FeRx-NLME온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Open-source nonlinear mixed-effects (NLME) modeling engine for population PK/PD and pharmacometrics, with FOCEI, SAEM, analytical PK, and ODE models.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
ferx-core is an open-source, high-performance nonlinear mixed-effects (NLME)
modeling engine for population pharmacokinetic and pharmacodynamic (PopPK/PD)
analysis. Written in Rust, it implements FOCE/FOCEI, SAEM, importance sampling,
analytical PK solutions, and ODE models for pharmacometric workflows.
Additional features:
• PK-PD and multi-analyte modeling
• BLQ likelihood modeling
• Importance Sampling & SIR
• Deep Compartmental Models & Neural ODEs
• Stochastic differential equations
• Simulation with uncertainty
• Various optimizers
• ... and moreREADME 전문 보기 ↗Website · Documentation · R package · Examples
ferx-core is an open-source, high-performance nonlinear mixed-effects (NLME) modeling engine for population pharmacokinetic and pharmacodynamic (PopPK/PD) analysis. Written in Rust, it implements FOCE/FOCEI, SAEM, importance sampling, analytical PK solutions, and ODE models for pharmacometric workflows.
Additional features:
# Build (the repo is a cargo workspace; the `ferx` binary lives in `ferx-cli`)
cargo build --release --workspace
# Fit a model
cargo run --release -p ferx-cli -- examples/warfarin.ferx --data data/warfarin.csv
# Fit with simulated data (uses [simulation] block)
cargo run --release -p ferx-cli -- examples/warfarin.ferx --simulate
Output files: {model}-fit.yaml (parameter estimates) and {model}-sdtab.csv (per-subject diagnostics).
Models are defined in a simple DSL. Here is a one-compartment oral PK model for warfarin:
[parameters]
theta TVCL(0.2, 0.001, 10.0) # name(initial, lower, upper)
theta TVV(10.0, 0.1, 500.0)
theta TVKA(1.5, 0.01, 50.0)
omega ETA_CL ~ 0.09 # between-subject variability (variance)
omega ETA_V ~ 0.04
omega ETA_KA ~ 0.30
sigma PROP_ERR ~ 0.02 # residual error
[individual_parameters]
CL = TVCL * exp(ETA_CL)
V = TVV * exp(ETA_V)
KA = TVKA * exp(ETA_KA)
[structural_model]
pk one_cpt_oral(cl=CL, v=V, ka=KA)
[error_model]
DV ~ proportional(PROP_ERR)
[fit_options]
method = foce
maxiter = 300
covariance = true
| Model | Syntax |
|---|---|
| 1-compartment IV (bolus and/or infusion) | pk one_cpt_iv(cl=CL, v=V) |
| 1-compartment oral | pk one_cpt_oral(cl=CL, v=V, ka=KA) |
| 2-compartment IV (bolus and/or infusion) | pk two_cpt_iv(cl=CL, v1=V1, q=Q, v2=V2) |
| 2-compartment oral | pk two_cpt_oral(cl=CL, v1=V1, q=Q, v2=V2, ka=KA) |
| 3-compartment IV (bolus and/or infusion) | pk three_cpt_iv(cl=CL, v1=V1, q2=Q2, v2=V2, q3=Q3, v3=V3) |
| 3-compartment oral | pk three_cpt_oral(cl=CL, v1=V1, q2=Q2, v2=V2, q3=Q3, v3=V3, ka=KA) |
| ODE-based | Define equations in an [odes] block |
For IV models, the closed form (bolus vs infusion) is chosen per dose event from the RATE column — a subject can mix bolus and infusion records.
Set via method in [fit_options]:
| Method | Description |
|---|---|
foce | First-Order Conditional Estimation |
focei | FOCE with Interaction (default) |
gn | Gauss-Newton (BHHH) with Levenberg-Marquardt damping |
gn_hybrid | Gauss-Newton followed by FOCEI polish |
saem | Stochastic Approximation EM |
imp | Importance Sampling (typically chained after another method for OFV evaluation) |
Methods can be chained (e.g. method = saem, focei, imp) to run sequentially.
For FOCE/FOCEI, the outer optimizer can be set via optimizer in [fit_options]:
| Optimizer | Description |
|---|---|
auto | Per-model selection (default): L-BFGS when the exact analytic gradient is available, BOBYQA otherwise |
slsqp | NLopt Sequential Least Squares Programming |
nlopt_lbfgs | NLopt L-BFGS (lbfgs and bfgs are deprecated aliases) |
mma | NLopt Method of Moving Asymptotes |
bobyqa | NLopt BOBYQA (derivative-free) |
trust_region | Newton trust-region (argmin + Steihaug CG) |
Input data uses NONMEM-format CSV with columns:
ID, TIME, DV, EVID, AMT, CMTRATE, MDV, II, SSEVID codes: 0 = observation, 1 = dose, 4 = reset + dose.
The examples/ directory contains ready-to-run models:
| File | Description |
|---|---|
warfarin.ferx | 1-compartment oral (warfarin PK) |
two_cpt_iv.ferx | 2-compartment IV bolus |
two_cpt_oral_cov.ferx | 2-compartment oral with covariates (WT, CRCL) |
mm_oral.ferx | Michaelis-Menten elimination via ODE |
An R wrapper package (ferx) provides ferx_fit(), ferx_simulate(), and ferx_predict() functions that call into this Rust engine via extendr. Source is at ../ferx.
# Build the Rust backend and load the package
withr::with_dir("path/to/ferx", {
system("cd src/rust && cargo build --release")
devtools::load_all()
})
result <- ferx_fit(
model = "warfarin.ferx",
data = "warfarin.csv",
method = "foce" # or "focei"
)
result # prints summary with estimates and SEs
result$theta # named vector of fixed-effect estimates
result$omega # BSV covariance matrix
result$sigma # residual error estimates
result$se_theta # standard errors (NULL if covariance step failed)
result$sdtab # data.frame with ID, TIME, DV, PRED, IPRED, CWRES, IWRES, ETA1..n
sim <- ferx_simulate("warfarin.ferx", "warfarin.csv", n_sim = 100, seed = 42)
# Returns data.frame with SIM, ID, TIME, IPRED, DV_SIM
library(vpc)
obs <- read.csv("warfarin.csv")
vpc(obs = obs, sim = sim, sim_cols = list(dv = "DV_SIM"))
preds <- ferx_predict("warfarin.ferx", "warfarin.csv")
# Returns data.frame with ID, TIME, PRED (predictions at eta = 0)
MIT — see LICENSE.
One exception: the test fixture data/mbma_naproxen.csv is derived from a
CC BY-NC 4.0 publication and carries that licence instead, so commercial use
of that file is not granted. It is test data only — never linked into the
ferx binary, and excluded from the packaged crate along with its README and
licence companions, so the published crate carries no CC BY-NC file. See
data/mbma_naproxen.LICENSE.