# Tut Script

This script performs data generation using a Gen Script, then fits the model using a Fit Script and compares the fitting parameters to the true parameters using a Comp Script.

See Generate data and Fit using Simple PopPK Model and Generate data and Fit using a Two Compartment Model for walk through examples.

## Main Sections of a Tut Script

- METHOD_OPTIONS
- DESCRIPTION
- FILE_PATHS
- DATA_FIELDS
- LEVEL_PARAMS
- MODEL_PARAMS
- STATES
- DERIVATIVES
- PREDICTIONS
- ODE_SOLVER
- FIT_METHODS
- COVARIANCE
- OUTPUT_SCRIPTS

## Full Structure of a Tut Script

- METHOD_OPTIONS
  - py_module
  - rand_seed
  - float_format
- DESCRIPTION
  - name
  - title
  - author
  - abstract
  - keywords
- FILE_PATHS
  - output_folder
  - log_folder
  - output_file_ext
  - output_iteration_results
- DATA_FIELDS
  - type_field
  - id_field
  - time_field
- LEVEL_PARAMS
  - split_field
  - split_dict
  - gen_params
  - fit_params
- MODEL_PARAMS
- STATES
- DERIVATIVES
- PREDICTIONS
- ODE_SOLVER
  - NO_SOLVER
  - ANALYTIC
  - SCIPY_ODEINT
    - atol
    - rtol
    - max_nsteps
    - use_sens
- FIT_METHODS
  - JOE
    - max_n_main_iterations
    - CONVERGER
      - NONE
      - OBJ_INC
      - OBJ_SIM
    - recompute_jacobians_flag
    - use_chain
    - reset_re_flag
- COVARIANCE
  - NO_COVARIANCE
  - FINITE_DIFF
    - var_covariance_flag
    - inv_hessian_flag
- OUTPUT_SCRIPTS
  - GEN
    - output_mode
    - sim_time_step
    - share_axes
  - FIT
    - output_mode
    - sim_time_step
    - share_axes
  - COMP
    - output_mode
  - TUTSUM
    - output_mode