This is the exact code I ran:

This is the csv file i used - (from the one you made)

id,Group,time,dv,amt,evid

1, 0.03 mg/kg ,0,0,0.03,1

1, 0.03 mg/kg ,0.0034722,0.293033,0,0

1, 0.03 mg/kg ,0.25,0.151067,0,0

1, 0.03 mg/kg ,1,0.0420333,0,0

1, 0.03 mg/kg ,2,missing,0,0

1, 0.03 mg/kg ,2.99,missing,0,0

2, 0.1 mg/kg ,0,0,0.1,1

2, 0.1 mg/kg ,0.0034722,2.12803,0,0

2, 0.1 mg/kg ,0.25,1.07887,0,0

2, 0.1 mg/kg ,1,0.7315,0,0

2, 0.1 mg/kg ,2,0.4226,0,0

2, 0.1 mg/kg ,2.99,0.3219,0,0

3, 0.3 mg/kg ,0,0,0.3,1

3, 0.3 mg/kg ,0.0034722,5.51947,0,0

3, 0.3 mg/kg ,0.25,3.18253,0,0

3, 0.3 mg/kg ,1,2.52407,0,0

3, 0.3 mg/kg ,2,2.0864,0,0

3, 0.3 mg/kg ,2.99,1.3471,0,0

```
df = CSV.read("Data//FixedData.csv", missingstring="missing", copycols=true)
PK = @model begin
@param begin
θ ∈ VectorDomain(6,lower=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], init=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
# Ω ∈ PSDDomain(5)
σ_prop ∈ RealDomain(init=0.1)
end
@random begin
η ~ MvNormal(Matrix{Float64}(0.04I, 5, 5))
# η ~ MvNormal(Ω)
end
@pre begin
CL_adc = θ[1]
CLD_adc = θ[2]*exp(η[1])
V1_adc = θ[3]*exp(η[2])
V2_adc = θ[4]*exp(η[3])
Vmax = θ[5]*exp(η[4])
Km = θ[6]*exp(η[5])
end
@dynamics begin
A1' = -CL_adc*C1 - CLD_adc*(C1-C2) - Vmax*C1/(Km+C1)
A2' = CLD_adc*(C1-C2)
end
@vars begin
C1 := A1/V1_adc
C2 := A2/V2_adc
end
@derived begin
# a1 = A1
Conc_Mean = C1
dv ~ @. Normal(Conc_Mean, sqrt(Conc_Mean^2*σ_prop)+eps())
end
end
param = init_param(PK)
sims = simobs(PK,PKdata,param)
plot(sims)
```

thats it -

A not so bad set of initial parameters according to literature (1st) and Phoenix fit (second) is:

```
param = (θ = [
2.4 # CL_adc Clearance ADC 2.4 ml/d/kg
17 # CLD_adc Clearance distribution ADC 17 ml/d/kg
29 # V1_adc Centarl Compartment Distribution Volume 29 ml/kg
30 # V2_adc Peripheral Compartment Distribution Volume 30 ml/kg
51 # Vmax Ask Gabby 51 ug/d/kg
0.93 # Km Ask Gabby 0.93 ug/ml ])
or
param=(θ = [
5.64445E-05 # CL_adc Clearance ADC 2.4 ml/d/kg
143.927 # CLD_adc Clearance distribution ADC 17 ml/d/kg
51.0108 # V1_adc Centarl Compartment Distribution Volume 29 ml/kg
59.4517 # V2_adc Peripheral Compartment Distribution Volume 30 ml/kg
56.5194 # Vmax Ask Gabby 51 ug/d/kg
0.93 # Km Ask Gabby 0.93 ug/ml ])
```

Thanks so much! I appreciate all the help!