How to Load Example Models#

In the tutorials and guides of the respy documentation, you will frequently encounter example models. These are pre-defined models that can be easily accessed with just one function call to facilitate an introductory workflow and use in explanatory material. The set of examples consists of simple as well as very advanced models to cover a wide range of use cases and challenges that come with an increasing degree of complexity in dynamic discrete choice models.

For instance, in the tutorials, you will encounter two very simple models that are based on the story of Robinson Crusoe. Other example models are based on actual economic publications and thus serve to illustrate the scalability of respy models.

You can access example models by typing

params, options, data = rp.get_example_model("model_name")

If you only want to get the params and options, set the argument with_data to False.

params, options = rp.get_example_model("model_name", with_data=False)
To API

For more information, checkout the function in theAPI

Below are the example models that are currently available.


The package provides users with two toy models. These models can be used to acquaintance oneself with respy’s functionalities and can be encountered in the tutorials.

To Tutorials

Check out the Tutorials

The models are called:

  • robinson_crusoe_basic

  • robinson_crusoe_extended

The models are centered around Robinson Crusoe, who is stranded on a desert island. In each period, Robinson decides between fishing or relaxing in a hammock. In the extended model, he might additionally ask for Friday’s advice to further develop his fishing skills.

These models are excellent examples to use for learning and prototyping: They include a small number of available choices and a low number of periods such that they are computationally feasible.

Overview of model characteristics defined by params and options:

Parameters

Number of choices

2

Work choices

Fishing

Education choices

None

Leisure choices

Hammock

Number of parameters

7

Shock Correlations

Negative between fishing and hammock

Options

Number of periods

5

Solution draws

100

Estimation draws

100

Solution seed

456

Simulation seed

132

Estimation seed

100

Estimation tau

0.001