next up previous index
Next: Estimation Up: Choice Model Previous: Choice Model   Index

Initialization

Suppose we would like to simulate a process of households deciding among 3 choices using the discrete choice model theory. The number of persons in each household should influence their decisions. We will model this behavior by multinomial logit using a system of utility functions:

\begin{displaymath}
\begin{array}{rcrr}
v_1 & = &\beta_{01} & \\
v_2 & = & &...
..._{12}x \\
v_3 & = & \beta_{03} & + \beta_{13}x
\end{array}
\end{displaymath}

Here, $ \beta_{01}$ and $ \beta_{03}$ are alternative specific constants and $ x$ is a household variable ``persons''.

The model is initialized by

>>> from opus_core.choice_model import ChoiceModel
>>> choicemodel = ChoiceModel(choice_set=[1,2,3],
                       utilities = "opus_core.linear_utilities",
                       probabilities = "opus_core.mnl_probabilities",
                       choices = "opus_core.random_choices")
Thus, the model is composed by external implementations of model steps, such as computing utilities, computing probabilities and computing choices, specified as package.module_name. Those modules must contain a class of the same name and a method run() that performs the actual computation (see Section 7.5.3 and Sections 7.6.1-7.6.3 for more details).


next up previous index
Next: Estimation Up: Choice Model Previous: Choice Model   Index
info (at) urbansim.org