clone_model#

causalpy.checks.base.clone_model(model)[source]#

Create a fresh, unfitted copy of a model.

PyMC models cannot survive copy.deepcopy (the class identity is lost), so we use their _clone() method instead. For all other model types we fall back to copy.deepcopy.

Parameters:

model (Any) – The model instance to clone. PyMC models must expose a _clone() method; everything else falls back to copy.deepcopy().

Returns:

A fresh, unfitted copy of model.

Return type:

Any