MixedLogit.make_fixed_coefs#
- MixedLogit.make_fixed_coefs(X_fixed, n_obs, n_alts)[source]#
Create alternative-varying coefficients for fixed (non-varying) covariates.
Each fixed covariate gets a separate coefficient for each alternative, allowing the effect of individual characteristics (e.g., income, age) to vary by choice. The reference alternative (last) has all coefficients constrained to zero for identification.
- Parameters:
- X_fixed
np.ndarrayorNone Fixed covariates matrix of shape (n_obs, n_fixed_covariates)
- n_obs
int Number of observations
- n_alts
int Number of alternatives
- X_fixed
- Returns:
- W_contrib
TensorVariable Contribution to utility from fixed covariates, shape (n_obs, n_alts)
- W_contrib