Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include additive term in the utility formulation #17

Closed
arteagac opened this issue Jun 13, 2023 · 2 comments
Closed

Include additive term in the utility formulation #17

arteagac opened this issue Jun 13, 2023 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@arteagac
Copy link
Owner

arteagac commented Jun 13, 2023

The temporary branch addit implements an additive term in the utility formulation. This additive term can help model coefficients kept at a fixed value as well as alternative specific fixed values. The additive term can be included in the fit and predict functions as follows:

model.fit(..., addit= -1*df['cost'], ...)

which would result in the following utility specification that simulates a coefficient of -1 for the cost coefficient kept fixed throughout the estimation (the portion in squared brackets is the addit term):

$$ U_{j} = \beta_0 + \beta_{1j} x_{1j} + ... + [-1\cdot x_{cost j}]$$

Note that you can also add multiple terms by simple pre-computing the addit term.

@arteagac arteagac added enhancement New feature or request help wanted Extra attention is needed labels Jun 13, 2023
@arteagac
Copy link
Owner Author

arteagac commented Jun 13, 2023

Dear @Olihno, Can you please test this feature? For this you need to uninstall your current version of xlogit and install the version in the temporary branch addit, as shown below.

pip uninstall xlogit
pip install git+https://github.com/arteagac/xlogit.git@addit

@arteagac
Copy link
Owner Author

Thank you @Olihno for the comprehensive testing of this functionality. I will proceed to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant