:orphan: 





.. _gen_diag_fit_diag_tut:



Diagonal matrix generation diagonal matrix fit
##############################################

[Generated automatically as a Tutorial summary]

Inputs
******



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

:Name: gen_diag_fit_diag

:Title: Diagonal matrix generation diagonal matrix fit

:Author: Wright Dose Ltd

:Abstract: 

| One compartment model with absorption compartment and CL/V parametrisation.
| This script uses a diagonal covariance matrix to generate the data and a diagonal covariance matrix to fit.

:Keywords: one compartment model; dep_one_cmp_cl; diagonal matrix

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

:Diagram: 

Failed to create compartment diagram

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

.. code-block:: pyml

    f[KA] = 0.3
    f[CL] = 3
    f[V] = 20
    f[PNOISE_STD] = 0.1
    f[ANOISE_STD] = 0.05
    f[CL_isv,V_isv] = [
        [ 0.2, 0 ],
        [ 0, 0.1 ]
    ]



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

.. code-block:: pyml

    f[KA] = 0.3
    f[CL] = 3
    f[V] = 20
    f[PNOISE_STD] = 0.1
    f[ANOISE_STD] = 0.05
    f[CL_isv,V_isv] = [
        [ 0.01, 0 ],
        [ 0, 0.01 ]
    ]



Outputs
*******



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

* Gen: :ref:`gen_diag_fit_diag_gen` (gen)
* Fit: :ref:`gen_diag_fit_diag_fit` (fit)

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

.. code-block:: pyml

    f[KA] = 0.3
    f[CL] = 3
    f[V] = 20
    f[PNOISE_STD] = 0.1
    f[ANOISE_STD] = 0.05
    f[CL_isv,V_isv] = [
        [ 0.175, 0 ],
        [ 0, 0.087425 ]
    ]



Plots
*****



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



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


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


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


Alternatively see :ref:`gen_diag_fit_diag_dense_comp_plots`

Comparison
**********



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


.. code-block:: pyml

    -2170.87181473



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


.. code-block:: pyml

    -2172.76457339



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


No Main f[X] values to compare.

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


No Noise f[X] values to compare.

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



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