Hard to swap between hierarchical and standard because of sigma
When one uses hierarchical estimation with a sigma parameter, they need to specify the bounds as [0, inf] and scale as linear. But then if they want to use non-hierarchical estimation of the same problem, the uniform sampler will fail due to infinite bounds.
It would be good to implement allowed finite bounds in case of hierarchical estimation. That might be a lot of work (to edit hierarchical estimation code to have constrained estimation of sigma with analytical solutions), so an easier solution can be to just allow finite bounds and a log10 scale, but raise a warning that the bounds for sigma will not be used in analytical hierarchical estimation.
How about somehow differentiating in the problem whether it is hierarchical or not and then allowing a conversion with either a dataframe (rows = hierarchical parameters columns = updated bounds)? that way it would just be something like problem.turn_hierachical()or problem.turn_non_hierarchical()?
How about somehow differentiating in the problem whether it is hierarchical or not and then allowing a conversion with either a dataframe (rows = hierarchical parameters columns = updated bounds)? that way it would just be something like
problem.turn_hierachical()orproblem.turn_non_hierarchical()?
Would also be helpful in general transition between hierarchical and non hierarchical, which would be important to choose between optimization method.
How about somehow differentiating in the problem whether it is hierarchical or not and then allowing a conversion with either a dataframe (rows = hierarchical parameters columns = updated bounds)? that way it would just be something like
problem.turn_hierachical()orproblem.turn_non_hierarchical()?
Truee, that would work.
There is already a HierarchicalProblem class that gets created in case hierarchical optimization is present. So if the HierarchicalProblem is being created, we can have a adjust_parameter_bounds() method that checks the bounds are what they should be for hierarchical optimization (in this case only setting all sigma bounds to 0, inf and scale to lin).
And then giving a warning that this is happening?
Do you think it would be confusing for the user? As they would specify sigma bounds and scale, but then they would not be used at all, and they would wonder why their parameter plots have sigma values outside of the bounds?
How about somehow differentiating in the problem whether it is hierarchical or not and then allowing a conversion with either a dataframe (rows = hierarchical parameters columns = updated bounds)? that way it would just be something like
problem.turn_hierachical()orproblem.turn_non_hierarchical()?Would also be helpful in general transition between hierarchical and non hierarchical, which would be important to choose between optimization method.
Currently the way one transitions between hierarchical and non-hierarchical estimation is just whether hierarchical=True/False is passed when creating the importer.
But you would suggest a possible transition afterwards? When the pypesto_problem is already created?
That might be a bit difficult, a lot of different objects get created if the problem is hierarchical (majorly InnerCalculatorCollector)
Is it really that bad to ask the user to set the bounds accordingly?
It's basically just petab_problem.parameter_df.loc[petab_problem.parameter_df.parameterType == "sigma", "upperBound"] = float("inf"), isn't it?
Regarding parameterScale: This can safely be ignored for the analytical computation of the optimal value as it's meaningless there, isn't it?