:orphan: 





.. _builtin_tut_example_tut:



First order absorption model with peripheral compartment
########################################################

[Generated automatically as a Tutorial summary]

Inputs
******



Description
===========

:Name: builtin_tut_example

:Title: First order absorption model with peripheral compartment

:Author: J.R. Hartley

:Abstract: 

| A two compartment PK model with bolus dose and
| first order absorption, similar to a Nonmem advan4trans4 model.

:Keywords: tutorial; pk; advan4; dep_two_cmp; first order

:Input Script: :download:`builtin_tut_example.pyml <builtin_tut_example.pyml>`

:Diagram: 


.. thumbnail:: compartment_diagram.pdf
    :width: 200px


True f[X] values
================

.. code-block:: pyml

    f[KA] = 0.2000
    f[CL] = 2.0000
    f[V1] = 50.0000
    f[Q] = 1.0000
    f[V2] = 80.0000
    f[KA_isv,CL_isv,V1_isv,Q_isv,V2_isv] = [
        [ 0.1000, 0.0100, 0.0100, 0.0100, 0.0100 ],
        [ 0.0100, 0.0300, -0.0100, 0.0200, 0.0200 ],
        [ 0.0100, -0.0100, 0.0900, 0.0100, 0.0100 ],
        [ 0.0100, 0.0200, 0.0100, 0.0700, 0.0100 ],
        [ 0.0100, 0.0200, 0.0100, 0.0100, 0.0500 ],
    ]
    f[PNOISE] = 0.1500



Starting f[X] values
====================

.. code-block:: pyml

    f[KA] = 1.0000
    f[CL] = 1.0000
    f[V1] = 20.0000
    f[Q] = 0.5000
    f[V2] = 100.0000
    f[KA_isv,CL_isv,V1_isv,Q_isv,V2_isv] = [
        [ 0.0500, 0.0100, 0.0100, 0.0100, 0.0100 ],
        [ 0.0100, 0.0500, 0.0100, 0.0100, 0.0100 ],
        [ 0.0100, 0.0100, 0.0500, 0.0100, 0.0100 ],
        [ 0.0100, 0.0100, 0.0100, 0.0500, 0.0100 ],
        [ 0.0100, 0.0100, 0.0100, 0.0100, 0.0500 ],
    ]
    f[PNOISE] = 0.1000



Outputs
*******



Generated data .csv file
========================


:Synthetic Data: :download:`synthetic_data.csv <synthetic_data.csv>`


Generating and Fitting Summaries
================================

* Gen: :ref:`builtin_tut_example_gen` (gen)
* Fit: :ref:`builtin_tut_example_fit` (fit)

Fitted f[X] values
==================

.. code-block:: pyml

    f[KA] = 0.1209
    f[CL] = 1.5555
    f[V1] = 33.9425
    f[Q] = 2.2223
    f[V2] = 119.5563
    f[KA_isv,CL_isv,V1_isv,Q_isv,V2_isv] = [
        [ 0.0564, 0.0202, 0.0672, -0.0035, 0.0082 ],
        [ 0.0202, 0.1257, 0.1163, -0.0664, -0.2501 ],
        [ 0.0672, 0.1163, 0.2004, -0.0317, -0.1448 ],
        [ -0.0035, -0.0664, -0.0317, 0.0584, 0.2049 ],
        [ 0.0082, -0.2501, -0.1448, 0.2049, 0.7798 ],
    ]
    f[PNOISE] = 0.1480



Plots
*****



Dense comp plots
================



.. thumbnail:: images/comp_dense/000001.svg
    :width: 200px


.. thumbnail:: images/comp_dense/000002.svg
    :width: 200px


.. thumbnail:: images/comp_dense/000003.svg
    :width: 200px


Alternatively see :ref:`builtin_tut_example_dense_comp_plots`

Comparison
**********



True objective value
====================


.. code-block:: pyml

    -873.4691



Final fitted objective value
============================


.. code-block:: pyml

    -887.8029



Compare Main f[X]
=================



.. csv-table:: 
    :file: fx_comp_main.csv
    :header-rows: 1


Compare Noise f[X]
==================



.. csv-table:: 
    :file: fx_comp_noise.csv
    :header-rows: 1


Compare Variance f[X]
=====================



.. csv-table:: 
    :file: fx_comp_variance.csv
    :header-rows: 1
