---
title: Bayesian Optimization inputs and parameters
description: >-
  Data format, model types, priors, and sampler settings for Bayesian
  statistical and PK/PD modeling.
tags:
  - bayesian
  - inputs
---

You provide a data file (CSV or Parquet) plus the model type and the outcome/predictor columns to fit. Your model-type choice most shapes what you get back: a plain regression returns parameter posteriors, while `pkpd` returns compartmental PK parameters (clearance, volume of distribution) instead.

## Required inputs

| Parameter | Type | Description |
|-----------|------|-------------|
| **data_url** | string | URL to a CSV or Parquet file. |
| **model_type** | string | `regression`, `hierarchical`, `time_series`, `mixture`, `pkpd`, `dose_response`, or `custom`. |
| **outcome_column** | string | Column name for the outcome/dependent variable. |
| **predictor_columns** | array of string | Column names for predictor variables (at least one). |

## Model-specific columns

| Parameter | Used by | Description |
|-----------|---------|-------------|
| **group_column** | hierarchical | Column defining the grouping/level. |
| **time_column** | time_series, pkpd | Column for the time variable. |
| **pk_model** | pkpd | `one_compartment`, `two_compartment`, or `three_compartment`. |
| **administration** | pkpd | `iv_bolus`, `iv_infusion`, or `oral`. |
| **concentration_column** | pkpd | Column for measured drug concentration. |
| **dose_column** | pkpd | Column for administered dose. |
| **subject_column** | pkpd | Column for subject ID, for population (mixed-effects) PK. |
| **population_model** | pkpd | Boolean; fit a population model with per-subject random effects. Default `false`. |
| **random_effects** | pkpd | Parameters with random effects in a population model. Default `["CL", "V"]`. |
| **model_code** | custom | Your own PyMC model code, when `model_type` is `custom`. |

## Likelihood and link function

| Parameter | Options | Default |
|-----------|---------|---------|
| **likelihood** | `normal`, `student_t`, `poisson`, `binomial`, `beta` | `normal` |
| **link_function** | `identity`, `log`, `logit` | `identity` |

## Priors

Optional. Supply as `{param_name: {distribution: "Normal", params: {mu: 0, sigma: 1}}}` to override the model's default priors for one or more parameters.

## Sampler settings

| Parameter | Range | Default | Description |
|-----------|-------|---------|-------------|
| **inference_method** | `mcmc`, `variational`, `pathfinder` | `mcmc` | Posterior inference method. |
| **num_chains** | 1–8 | 4 | Number of MCMC chains. |
| **num_samples** | 500–10,000 | 2,000 | Posterior samples drawn. |
| **num_tune** | 200–5,000 | 1,000 | Tuning/warmup samples before drawing. |
| **target_accept** | 0.5–0.99 | 0.9 | Target acceptance rate (raise it if you see divergences). |

## Output options

| Parameter | Default | Description |
|-----------|---------|-------------|
| **compute_loo** | `true` | Compute leave-one-out cross-validation for model comparison. |
| **compute_waic** | `true` | Compute WAIC for model comparison. |
| **generate_plots** | `true` | Generate trace, posterior, and posterior-predictive-check plots. |

## Data requirements

- The outcome and predictor columns must be present and numeric (categorical predictors need to be encoded upstream).
- For `pkpd`, provide `time_column`, `concentration_column`, and `dose_column`; add `subject_column` for population PK.
- For `hierarchical`, provide `group_column` so the model can pool information across groups.

## Read next
