openest.swapbin.transform module

openest.swapbin.transform.swap_beta(beta, T)[source]
openest.swapbin.transform.swap_vcv(V, T)[source]
openest.swapbin.transform.transform(predcount, bins, dropbin, totals)[source]

Construct a transform matrix from an old set of predictors to a bin swapped set.

The intercept is assumed to be the first predictor.

Parameters:
  • predcount (int) – the number predictors, including the intercept.
  • bins (list[int]) – the indices of the bins amongst the predictors.
  • dropbin (int) – an index into bins
  • totals (float) – the value that all bin values would sum to, e.g. 1 if the bins are indicators e.g., 365 if the bins are daily over a year