Skip to content

Commit 08568c3

Browse files
committed
Separate startpoints and priors
1 parent a77f766 commit 08568c3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

petab/v2/core.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,24 @@ def get_priors(self) -> dict[str, Distribution]:
18621862
18631863
:returns: The prior distributions for the estimated parameters.
18641864
"""
1865+
if not self.has_map_objective:
1866+
return {}
1867+
1868+
return {
1869+
p.id: p.prior_dist if p.prior_distribution else Uniform(p.lb, p.ub)
1870+
for p in self.parameters
1871+
if p.estimate
1872+
}
1873+
1874+
def get_startpoint_distributions(self) -> dict[str, Distribution]:
1875+
"""Get distributions for sampling startpoints.
1876+
1877+
This will return uniform distributions over the parameter bounds
1878+
for parameters without an explicit prior.
1879+
1880+
:returns: Mapping of parameter IDs to distributions for sampling
1881+
startpoints.
1882+
"""
18651883
return {
18661884
p.id: p.prior_dist if p.prior_distribution else Uniform(p.lb, p.ub)
18671885
for p in self.parameters

0 commit comments

Comments
 (0)