Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to use different residual error in the same model #640

Open
nlmixr-user opened this issue Mar 17, 2023 · 1 comment
Open

Comments

@nlmixr-user
Copy link

nlmixr-user commented Mar 17, 2023

Hi @mattfidler ,

I am trying to use different residual error in my model, I followed the same proposal as for #231 and it actually works for theo_sd example. When trying the same method on my data, the following error appears
Error : The simulated residual errors do not match the model specification (1=2)
In addition: Warning message:
In UseMethod("depth") :
no applicable method for 'depth' applied to an object of class "NULL"
Error: The simulated residual errors do not match the model specification (1=2)

Here is the piece of code used:
model123 <- function() {

ini({
tcl1 <- log(0.2) #Log cl1
tvl1 <- log(8) #Log vl1
tcl2 <- log(0.1) #Log cl2
tvl2 <- log(3) #Log vl2
tka <- log(0.3) #Log ka(fa)
eta.cl1 + eta.vl1 ~ c(0.05,
0.03,0.12)
eta.ka ~ 0.26 #standard error
prop.err.P1 <- 0.40
prop.err.P2 <- 0.60

})
model({
cl1 = exp(tcl1 + 0.75log(WT/76.35)+ eta.cl1);
vl1 = exp(tvl1 + 1
log(WT/76.35)+eta.vl1);
cl2 = exp(tcl2);
vl2 = exp(tvl2);
ka <- exp(tka+eta.ka);
k10 = cl1/vl1;
k12 = cl2/vl1;
k21 = cl2/vl2;

## ODEs for depot, central and peripheral compartments

d/dt(depot) = -ka*depot
d/dt(center)  = ka*depot-(k10+k12)*center+k21*peripheral
d/dt(peripheral) = k12*center-k21*peripheral
cp = center / vl1
cp ~ prop(prop.err.P1) | p1
cp ~ prop(prop.err.P2) | p2

})
}

fit123<- nlmixr2(model123, data, est="focei", foceiControl(outerOpt="nlminb"),
table=tableControl(cwres=T, npde=T))

fit123

Also, when checking with nlmixr(model123) function, it seems ok:
image

Would you have any idea?
Many thanks in advance.

@mattfidler
Copy link
Contributor

Sorry, I haven't looked at this, I don't tend to this forum as well as the nlmixr2 forum.

I will move that to the nlmixr2 for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants