You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"identity" : Applies log importance weights directly without resampling.
1670
-
None : No importance sampling weights. Returns raw samples of size (num_paths, num_draws_per_path, N) where N is number of model parameters. Other methods return samples of size (num_draws, N).
1669
+
1670
+
- "psis" : Pareto Smoothed Importance Sampling (default). Usually most stable.
1671
+
- "psir" : Pareto Smoothed Importance Resampling. Less stable than PSIS.
1672
+
- "identity" : Applies log importance weights directly without resampling.
1673
+
- None : No importance sampling weights. Returns raw samples of size (num_paths, num_draws_per_path, N) where N is number of model parameters. Other methods return samples of size (num_draws, N).
1674
+
1671
1675
progressbar : bool, optional
1672
1676
Whether to display a progress bar (default is True). Setting this to False will likely reduce the computation time.
1673
1677
random_seed : RandomSeed, optional
@@ -1682,10 +1686,13 @@ def fit_pathfinder(
1682
1686
Additional keyword arguments for the Pathfinder algorithm.
1683
1687
compile_kwargs
1684
1688
Additional keyword arguments for the PyTensor compiler. If not provided, the default linker is "cvm_nogc".
1689
+
initvals: dict | None = None
1690
+
Initial values for the model parameters, as str:ndarray key-value pairs. Paritial initialization is permitted.
1691
+
If None, the model's default initial values are used.
1685
1692
1686
1693
Returns
1687
1694
-------
1688
-
arviz.InferenceData
1695
+
:class:`~arviz.InferenceData`
1689
1696
The inference data containing the results of the Pathfinder algorithm.
1690
1697
1691
1698
References
@@ -1695,6 +1702,14 @@ def fit_pathfinder(
1695
1702
1696
1703
model=modelcontext(model)
1697
1704
1705
+
ifinitvalsisnotNone:
1706
+
model=pm.model.fgraph.clone_model(model) # Create a clone of the model
1707
+
for (
1708
+
rv_name,
1709
+
ivals,
1710
+
) ininitvals.items(): # Set the initial values for the variables in the clone
0 commit comments