# How to define error

**URL:** <https://discourse.pumas.ai/t/how-to-define-error/82>\
**Category:** How-to\
**Created:** [November 19, 2019, 5:55am UTC](https://discourse.pumas.ai/t/how-to-define-error/82 "2019-11-19T05:55:36Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![andreasnoack](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/andreasnoack/32/22_2.png) [@andreasnoack](https://discourse.pumas.ai/u/andreasnoack)\
**Post date:** [November 20, 2019, 9:49pm UTC](https://discourse.pumas.ai/t/how-to-define-error/82/7 "2019-11-20T21:49:01Z")

</div>

In NONMEM, you write a regression type expression like `Y = F(1 + EPS(1)) + EPS(2)` which in math would be

Y = f(\theta,\eta)(1 + \varepsilon\_1) + \varepsilon\_2

where \varepsilon\_1 and \varepsilon\_2 are Gaussians with variances \sigma\_1^2 and \sigma\_2^2 and typically uncorrelated. Hence you have that

\mathrm{E}(Y|\eta) = f(\theta,\eta) \\ \mathrm{Var}(Y|\eta) = f(\theta,\eta)^2 \sigma\_1^2 + \sigma\_2^2

In Pumas, you specify the conditional (on the random effect) distribution of the dependent variable and the `Normal` in Julia is parameterized by its standard deviation so you need to take the square root and you end up with

```auto
Normal(cp, sqrt((cp*σ₁)^2 + σ₂^2))

```

if you parameterize with two standard deviation parameters. I hope it answered your question.

---

_[View the full topic](https://discourse.pumas.ai/t/how-to-define-error/82)._
