Issue with REParamsSelect in sbiofitmixed
Show older comments
I am currently using sbiofitmixed to estimate five model parameters. For one of these parameters, I would like to estimate only the fixed effect (no random effect).
According to the documentation, the option 'REParamsSelect' is supported only when a vector of estimatedInfo objects is provided for the estimated parameters. Therefore, I defined the parameters using estimatedInfo:
paramsToEstimate = estimatedInfo({'log(k1)','log(k2)', 'log(k3)', 'log(k4)', 'log(k5)'},...
'InitialValue', [0.6, 0.002, 0.4, 0.1, 3.5]);
and specified the following option for nlmefit:
opt.REParamsSelect = [true true true true false];
I then called:
[nlmeRes, simI, simP] = sbiofitmixed(model, data, responseMap, paramsToEstimate, doses,'nlmefit', opt);
However, I received the following error:
"Arrays have incompatible sizes for this operation.
Error in SimBiology.fit.internal.calculateParametersFromMixedEffectsResults (line 18)
betaFERE(reIdx,:) = betaFERE(reIdx,:) + bRE;"
Could you please advise what might be causing this issue? Is additional configuration required when excluding random effects for a parameter?
Thank you very much for your support.
Answers (1)
Ritika Thusoo
on 27 Feb 2026 at 6:23
0 votes
Hi,
Based on the information provided, the error indicates a dimension mismatch between:
- ‘reIdx’ → the indices of the parameters selected to have random effects
- ‘bRE’ → the vector of random effects produced or expected by ‘nlmefit’
In case the first four parameters have random effects (and not the fifth), then ‘reIdx’ must have length 4. If any other part of the setup still implies random effects for all five parameters, then ‘bRE’ will have length 5, causing the assignment to fail. It may be due to the following reasons:
- In the code:
>> opt.REParamsSelect = [true true true true false];
this correctly tells ‘nlmefit’ that only the first four parameters should have random effects.
- However, ‘sbiofitmixed’ also constructs the random‑effects covariance structure and extracts random effects for each group. If this structure still includes the fifth parameter, a mismatch will occur.
For more details on ‘nlmefit’, please refer to the MATLAB documentation:
Categories
Find more on Nonlinear Mixed-Effects Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!