.. _estimating_parameters_index:

Estimating Population Parameters
#################################

Assume we have data for a population of individuals, 
where for each individual we are given:

* measured covariates such as age or body weight 
* the parameters of the study they were involved in such as 
  the amount of drug administered
* a time series of one or more observed variables such as 
  drug or biomarker concentration

For a given mathematical model of the |pkpd| for any individual 
drawn from the population, we now want to estimate the population averages
(fixed effects) and deviations from those averages (random effects) 
giving rise to model parameters that best predict the observed time series.

Being able to estimate parameters enables us to:

* compare different mathematical models based on their ability to 
  predict observed data
* sample new populations with similar properties and analyse the predicted
  |pkpd| to predict the effect of a drug on a new, random population

In this part, we explore concepts related to estimating parameters
of the mathematical model ("fitting the model") using |popy| examples
to generate data and figures to aid our explanations.

.. comment
    We could show parameter estimation for a single individual
    here, though it might seem weird. FOCE, however, doesn't 
    connect REs to FE updates directly, so we could just use
    m[X] = f[X] 
    for everything to demonstrate gradient descent.
    This would then lead nicely to JOE that exploits the
    fact that the REs tell us something useful about the 
    FE updates.

.. toctree::
    :maxdepth: 1

    computational_considerations
    uncertainty
    diagnostics
    blq_example
    
    .. identifiability
    .. /tutorials/examples/simple_fit_example
    .. /tutorials/examples/simple_tut_example

