---
title: "`r projectName `"
fig: no crop
geometry: left=1mm, right=1mm, top=1mm, bottom=1mm, asymmetric
indent: TRUE
output:
  html_document:
    df_print: paged
    fig_caption: yes
  word_document: default
  pdf_document: default
header-includes: 
    - \usepackage{placeins}
    - \usepackage{indentfirst}
    - \usepackage{setspace}\doublespacing
    - \usepackage{lineno}
    - \linenumbers
author: "`r 'PFIM 6.1' `"
date: "`r paste( 'Date:' , Sys.Date())`"
---
 
```{r setup, include=FALSE}
options(kableExtra.latex.load_packages = FALSE)
options(kableExtra.auto_format = FALSE)
knitr::opts_chunk$set(echo = TRUE)
```

```{r, echo=FALSE}
title_shrinkage = FALSE
variance_components = TRUE
output = knitrFIM(object)
if ( output$typeOfFIM[1] == "BayesianFim" ){
  title_shrinkage = TRUE
  variance_components = FALSE
}
```

# Model equations 
```{r ModelEquations, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"} 
knitrModelEquations(object)
```

# Error model 
```{r ModelError, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"} 
knitrModelError(object)
```

# Model parameters 
```{r ModelParameters, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"} 
knitrModelParameters(object)
```

# Administration parameters 
```{r AdministrationParameters, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"} 
knitrAdministrationParameters(object)
```

# Initial design
```{r InitialDesigns, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"} 
knitrInitialDesigns(object)
```

# Fisher information matrix

## Fixed effects 
```{r Fixed, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"} 
output = knitrFIM(object)
output$fIMFixedEffects 
``` 
`r if ( variance_components ) '#   Variance components'`
```{r VarianceComponentsFIM,  eval = variance_components, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"} 
output = knitrFIM(object)
output$fIMRandomEffects
```

# Correlation matrix  

## Fixed effects 
```{r FixedEffectsCorrelation, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"} 
output = knitrFIM(object)
output$correlationFixedEffects 
``` 

`r if ( variance_components ) '#   Variance components'`
```{r VarianceComponentsCorrelation,  eval = variance_components, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"} 
output = knitrFIM(object)
output$correlationRandomEffects 
``` 

## Determinant, condition numbers and D-criterion of the FIM
```{r Determinant, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"}
output = knitrFIM(object)
output$criteriaFim
```

`r if ( title_shrinkage ) '##   Values for SE and RSE and shrinkage'`
```{r se_rse_bayes, eval = title_shrinkage, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"}
output = knitrFIM(object)
output$se_rse
```
`r if ( variance_components ) '##   Values for SE and RSE '`
```{r se_rse_pop_ind, eval = variance_components, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"}
output = knitrFIM(object)
output$se_rse
```

# Graphs of the responses
```{r plotResponses, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"}
for (i in 1:length(plotResponses))
{
print(plotResponses[[i]])
}
```

# Graphs of the sensitivity indices
```{r plotSensitivity, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"}
for (i in 1:length(plotSensitivity))
{
print(plotSensitivity[[i]])
}
```

# Graphs of the SE and RSE
```{r plotSE, echo = FALSE, comment='', fig.height = 5, fig.width = 10, fig.align = "center"}
SE = plotSE( object )
print(SE[[1]])
RSE = plotRSE( object )
print(RSE[[1]])
```

`r if ( title_shrinkage ) '#  Graph of shrinkage'`
```{r shrinkage, eval = title_shrinkage, echo = FALSE, fig.height = 5, fig.width = 10, fig.align = "center"}
if ( title_shrinkage ==TRUE){
shrinkage = plotShrinkage( object )
print(shrinkage[[1]])}
```







