Skip to content

Update mf_all_loq.R#83

Open
MHCherkaoui wants to merge 6 commits intoandrewhooker:masterfrom
MHCherkaoui:master
Open

Update mf_all_loq.R#83
MHCherkaoui wants to merge 6 commits intoandrewhooker:masterfrom
MHCherkaoui:master

Conversation

@MHCherkaoui
Copy link

@MHCherkaoui MHCherkaoui commented Jan 21, 2026

Hi Andrew,

I was trying using PopED to evaluate the design of an experiment with three state variables. As each of those variables have a different LOQ, I wanted to use the variable loq, but I was getting the following message error.

Error in mf_all_loq(t(model_switch[i, 1:ni[i, drop = F], drop = F]), t(xt[i, :
loq or uloq not specified properly

I had a look at the code, and I noticed the following code in the function mf_all_loq:

...
if (length(loq) == n_mod) {
...

where n_mod is a vector with the index of the model. As a consequence, the if statement only evaluate the first index of n_mod (i.e. that length(loq) == n_mod it is equivalent of length(loq) == n_mod[1]), but reading the code, I would expect that the desire behaviour is to check of the number of defined loq correspond to the number of defined models, therefore, I would expect the code to be:

...
if (length(loq) == length(n_mod)) {
...

Same comment for uloq.

However, I did not test the code and I do not know if there are other parts of the package that should be adjusted for this.

Regdards

Mohammed

When multiple models are being used, the association of the LOQ to the right model was not done properly.

This was corrected
Testing if MC approaches would work
Adjusted the MC method, to first count the number of each permutation then estimate FIM for each of them to reduce computation time.

May need to review the criteria of switiching from MC to "exact", as well as number of sampling vs P-limit
Loop to decrease loq_prob_limit removed and n_mc_samples automatically estimated to make sure that the low probabilities are meaningfull (using Clopper-Pearson Interval as a criteria)
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

Successfully merging this pull request may close these issues.

1 participant

Comments