# Model a mix of correlated and uncorrelated random effects

**URL:** https://discourse.pumas.ai/t/model-a-mix-of-correlated-and-uncorrelated-random-effects/1432
**Category:** How-to
**Created:** [September 8, 2026, 10:19am UTC](https://discourse.pumas.ai/t/model-a-mix-of-correlated-and-uncorrelated-random-effects/1432 "2026-09-08T10:19:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SaiAhil](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/saiahil/32/807_2.png) [@SaiAhil](https://discourse.pumas.ai/u/SaiAhil)
#### Post date: [September 8, 2026, 10:19am UTC](https://discourse.pumas.ai/t/model-a-mix-of-correlated-and-uncorrelated-random-effects/1432/1 "2026-09-08T10:19:05Z")

</div>

Hello Team,

I was trying to replicate an interesting scenario where we are required to model correlation  
between `CL` and `Vc`, but there is no correlation with `Ka`. Based on the known truth, this  
was the intended covariance structure:

```auto
          V CL Ka
 V [0.1844 0.0369 0]
 CL [0.0369 0.2089 0]
 Ka [0 0 0.1844]

```

**## How the other two tools write it**

**NONMEM** — two `$OMEGA` records, one per block:

```auto
$OMEGA BLOCK(2)
0.1844 ; IIV_V
0.0368 ; IIV_CL_IIV_V
0.2089 ; IIV_CL
$OMEGA 0.1844 ; IIV_KA

```

**Monolix** :

```auto
V = {distribution=logNormal, typical=V_pop, sd=omega_V}
Cl = {distribution=logNormal, typical=Cl_pop, sd=omega_Cl}
ka = {distribution=logNormal, typical=ka_pop, sd=omega_ka}
correlation = {level=id, r(V, Cl)=corr_V_Cl}

```

We name only the pair that correlates. Anything unnamed is uncorrelated.

**## What I have working in Pumas**

Two `@param` entries and two `@random` draws:

```julia
@param begin
    tvvc ∈ RealDomain(; lower = 0.0, init = 628.0)
    tvcl ∈ RealDomain(; lower = 0.0, init = 19.2)
    tvka ∈ RealDomain(; lower = 0.0, init = 0.75)
    Ωvc_cl ∈ PSDDomain(; init = [0.1844 0.0369; 0.0369 0.2089])
    Ωka ∈ PDiagDomain(; init = [0.1844])
    σ ∈ RealDomain(; lower = 0.0, init = 0.2)
end

@random begin
    ηvc_cl ~ MvNormal(Ωvc_cl)
    ηka ~ MvNormal(Ωka)
end

@pre begin
    Vc = tvvc * exp(ηvc_cl[1])
    CL = tvcl * exp(ηvc_cl[2])
    Ka = tvka * exp(ηka[1])
end

```

My question is whether it is the intended way of coding it.

Thanks in advance!

---

<div class="post-metadata">

### Author: ![vijay](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/vijay/32/96_2.png) [@vijay](https://discourse.pumas.ai/u/vijay)
#### Post date: [September 8, 2026, 10:45am UTC](https://discourse.pumas.ai/t/model-a-mix-of-correlated-and-uncorrelated-random-effects/1432/2 "2026-09-08T10:45:23Z")

</div>

Yes, that is the way. However, a single scalar omega could be written just as a Normal. See below

```auto
@param begin
    tvvc ∈ RealDomain(; lower = 0.0, init = 628.0)
    tvcl ∈ RealDomain(; lower = 0.0, init = 19.2)
    tvka ∈ RealDomain(; lower = 0.0, init = 0.75)
    Ωvc_cl ∈ PSDDomain(; init = [0.1844 0.0369; 0.0369 0.2089])
    omegaka ∈ RealDomain(; init = sqrt(0.1844))
    σ ∈ RealDomain(; lower = 0.0, init = 0.2)
end

@random begin
    ηvc_cl ~ MvNormal(Ωvc_cl)
    ηka ~ Normal(omegaka)
end

```

This section in the Pumas Tutorials gives you an example - [Between Subject Variability](https://tutorials.pumas.ai/html/LearningPaths/03-LP/07-Module/mod7-Random_Effects_BSV.html#scalar-approaches-for-individual-omega-elements)

Best,

Vijay

---

<div class="post-metadata">

### Author: ![SaiAhil](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.pumas.ai/saiahil/32/807_2.png) [@SaiAhil](https://discourse.pumas.ai/u/SaiAhil)
#### Post date: [September 8, 2026, 2:12pm UTC](https://discourse.pumas.ai/t/model-a-mix-of-correlated-and-uncorrelated-random-effects/1432/3 "2026-09-08T14:12:01Z")

</div>

Thanks for the clarification!
