Skills

Simbiology Fit Model

Fit SimBiology model parameters to data, fitproblem, population NLME, virtual...

Install

npx skills add matlab/matlab-agentic-toolkit --skill simbiology-fit-model -g -a claude-code -y
Category
Engineering
Updated
8d ago
License
See repository
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Fit SimBiology model parameters to data, fitproblem, population NLME, virtual patients, and NCA. Use when asked to fit, estimate, calibrate, or compute PK metrics.

Fit SimBiology Models

Estimate parameters from data using fitproblem, fit population models with NLME, generate virtual patients, and compute NCA metrics.

When to Use

  • "fit", "estimate", "calibrate" model parameters
  • Parameter estimation from experimental/observed data
  • Population PK/PD, NLME, mixed effects, inter-individual variability
  • Virtual patients, virtual cohorts
  • NCA, AUC, Cmax, Tmax, half-life, clearance
  • Keywords: "fit", "estimate", "calibrate", "population", "NCA", "AUC"

When NOT to Use

  • Model construction or diagram (use simbiology-build-model)
  • Simulation without fitting (use simbiology-simulate-model)
  • Sensitivity analysis (use simbiology-simulate-model)

Must-Follow Rules

1. Use fitproblem for parameter estimation

Always use fitproblem instead of calling sbiofit or sbiofitmixed directly. fitproblem provides a unified, declarative interface:

prob = fitproblem;
prob.Model = model;
prob.Data = data;
prob.ResponseMap = "Species = DataColumn";
prob.Estimated = estimatedInfo({'param'}, 'Bounds', [lo hi]);
results = fit(prob);

Do NOT call sbiofit(model, data, ...) or sbiofitmixed(model, data, ...) directly, their positional argument signatures are error-prone.

2. Fitting requires groupedData, NOT a plain table

Always wrap data:

data = groupedData(table(...));
data.Properties.IndependentVariableName = 'Time';

3. ResponseMap maps model outputs to data columns

Format is always "ModelOutput = DataColumnName":

% Single compartment, use species name on the left
prob.ResponseMap = "Drug = DrugConc";

% Multi-compartment, use qualified name to disambiguate
prob.ResponseMap = "Central.Drug = DrugConc";

% When species name matches data column name, still use the = format
prob.ResponseMap = "Drug = Drug";

Use the unqualified species name unless the same species name exists in multiple compartments (then qualify with Compartment.Species).

Read the whole SKILL.md on GitHub

More in Engineering