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).
1672
+
1673
+
- "psis" : Pareto Smoothed Importance Sampling (default). Usually most stable.
1674
+
- "psir" : Pareto Smoothed Importance Resampling. Less stable than PSIS.
1675
+
- "identity" : Applies log importance weights directly without resampling.
1676
+
- 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).
1677
+
1671
1678
progressbar : bool, optional
1672
1679
Whether to display a progress bar (default is True). Setting this to False will likely reduce the computation time.
1673
1680
random_seed : RandomSeed, optional
@@ -1682,10 +1689,13 @@ def fit_pathfinder(
1682
1689
Additional keyword arguments for the Pathfinder algorithm.
1683
1690
compile_kwargs
1684
1691
Additional keyword arguments for the PyTensor compiler. If not provided, the default linker is "cvm_nogc".
1692
+
initvals: dict | None = None
1693
+
Initial values for the model parameters, as str:ndarray key-value pairs. Paritial initialization is permitted.
1694
+
If None, the model's default initial values are used.
1685
1695
1686
1696
Returns
1687
1697
-------
1688
-
arviz.InferenceData
1698
+
:class:`~arviz.InferenceData`
1689
1699
The inference data containing the results of the Pathfinder algorithm.
1690
1700
1691
1701
References
@@ -1695,6 +1705,14 @@ def fit_pathfinder(
1695
1705
1696
1706
model=modelcontext(model)
1697
1707
1708
+
ifinitvalsisnotNone:
1709
+
model=pm.model.fgraph.clone_model(model) # Create a clone of the model
1710
+
for (
1711
+
rv_name,
1712
+
ivals,
1713
+
) ininitvals.items(): # Set the initial values for the variables in the clone
0 commit comments