:orphan: 

..
	What kind of biomarkers? (Tumour size, qualitative survey data, bone density, ...)
	PD Models needn't have a PK component (e.g. some disease progression models simply model the progression in the absence of drugs)
	Where there is a PK component, it becomes a PK/PD model.
	Draw attention to the fact that we can use closed form PK models within an ODE-based PD model (and that Nonmem can't).
	Indirect models have an Effect compartment which is then processed to get the actual Response.
	
..
	Possible description?
	PK    = Conc w.r.t Time
	PD    = Effect w.r.t. Conc
	PK/PD = Effect w.r.t. Time

.. _pharmacodynamic_models:
    
Pharmacodynamic Models
######################

Pharmacodynamic (PD) models can be categorised as what the drug does to the body. Some physiological process in the body is altered by the presence of a drug and this can be measured somehow. 

The pharmacodynamic response could be related to something that the drug is designed to improve such as the QT interval or blood pressure. It could also be a potential toxic effect eg. increased levels of the enzyme Alanine aminotransferase, which could indicate potential liver damage.

The amount, or concentration, of a drug in the plasma will influence the size of the PD response, either directly or indirectly.


Time Delay
==========
.. include:: pharmacodynamics/time_delay.txt


.. _direct_effect_models:

Direct Effect Models
=====================
A direct response means that the drug has a direct effect on a PD process. For example, as levels of Quinidine increase, the length of the Q-T interval increases. 

.. include:: pharmacodynamics/direct_effect_model.txt


.. _indirect_effect_models:

Indirect Effect Models
==========================
In an indirect response PD Model the drug will affect an inter-mediate process, which then influences the measured PD response. A classic example is warfarin. Warfarin inhibits the synthesis of prothrombin, which in turn inhibits the formation of blood clots. 

.. include:: pharmacodynamics/indirect_effect_model.txt


Linear Effect Model
===================
.. include:: pharmacodynamics/linear_effect_model.txt


.. _circadian_models:

Circadian Models
===============================

..
    Ditch the np.* prefix on the math functions - it isn't needed.
    Uses population parameters, which complicates the model somewhat.
    Combined model is pretty complex (which is good).
    Perhaps reconsider the m[K], m[K12] and m[K21] parameters - they are fixed by the c[X] values and can go straight into the DERIVATIVES block.
    Other m[X] values are similarly dependent/redundant.
    Dave makes the good point that because DERIVATIVES is evaluated many times per row, it is probably more efficient to do the computations in MODEL_PARAMS once per row.

A circadian rhythm is a roughly 24-hour cycle that affects physiological responses in the body. For example, the absorption and metabolisation of a drug can also be faster when taken in the morning compared to the night. Temporal cycles may affect the pharmacokinetics or pharmacodynamics of a drug and so must be taken into account by a model.


Sine Model
----------------------------
.. include:: pharmacodynamics/circ_sine_model.txt


.. comment
    Cosine Model
    ----------------------------
    .. include:: pharmacodynamics/circ_cosine_model.txt


    Combined Model
    ----------------------------
    .. include:: pharmacodynamics/circ_combined_model.txt


.. _emax_models:

Emax Models
===============================

..
    Hill coefficient is lambda on one line and gamma on the next (repeatedly)
    Perhaps introduce the concentration model first, then the next step of lambda!=1.
    Compartmental vs non-compartmental: under what circumstances would you use each?

.. include:: emax_models/emax_intro.txt


.. simple_emax_model:

Simple Emax Model
----------------------------
.. include:: emax_models/emax_simple.txt
    
    
.. complex_emax_model:

More Complex Emax Model
----------------------------
.. include:: emax_models/emax_complex.txt

    
Non-Compartmental Response Emax Model
----------------------------------------------
.. include:: emax_models/emax_noncomp_response.txt


Biomarker Emax Model
----------------------------
.. include:: emax_models/emax_biomarker.txt


.. comment
    Michaelis-Menten Elimination
    ===============================
    Content here.


Other Stuff
===================================
* binary response models 
* categorical response models
* ordered categorical modelling
* time to event/survival models
* count data 

..
    * :ref:`DP_iov`


PD Parameter Fitting
====================

In practice PKPD models can be fitted simultaneously or separately (see :ref:`simultaneous_vs_separate_fit`). 

In the simultaneous case, the model is fitted to PK and PD data at the same time and the m[X] individual PK + PD parameters. deduced at the same time.

In the separate case the PK model is fitted and the PK model parameters for each individuals recorded. The data is then merged with original data set and the PK parameters appear as c[X] variables when fitting the PD model.

In this case study the PD models are demonstrated as the second step in a separate PKPD fit. Therefore PK parameters are assumed to be known (from a prior model fit) and therefore appear as c[X] variables. The PD parameters are m[X] variables, to be deduced by the model.
