order_dependencies
- pyoptex.utils.model.order_dependencies(model, factors)[source]
Create a dependency matrix from a model where interactions and higher order effects depend on their components and lower order effects.
For example: * \(x_0\): depends only on the intercept. * \(x_0^2\): depends on \(x_0\), which in turn depends on the intercept. * \(x_0 x_1\): depends on both \(x_0\) and \(x_1\), which both depend on the intercept. * \(x_0^2 x_1\) : depends on both \(x_0^2\) and \(x_1\), which depend on \(x_0\) and the intercept.
Parameters
- modelpd.DataFrame
The model
- factorslist(
Factor) The list of factors in the design.
Returns
- depnp.array(2d)
The dependency matrix of size (N, N) with N the number of terms in the encoded model. Term i depends on term j if dep(i, j) = true.