DynamicDiscreteChoice

Documentation for DynamicDiscreteChoice.

Base.:*Method

*(c1::MarkovChain, c2::MarkovChain)

Assuming c1 and c2 are independent, create a new MarkovChain representing the evolution of the combination of states in c1 and c2.

source
DynamicDiscreteChoice.bootstrap_seriesMethod
bootstrap_series(payoffs,v,T,ddc; B=999)

Use the parametric bootstrap for inference for a dynamic discrete choice model. Data is assumed to come from a single time series of length T.

Inputs:

  • payoffs estimated payoffs
  • v estimated choice specific value functions
  • T length of data
  • ddc DDC model containing estimated transitions in ddc.transition
  • B number of bootstrap replications
source
DynamicDiscreteChoice.bootstrap_tableMethod
bootstrap_table(θ,θb;coverage=0.95)

Given a matrix of parameter estimates, θ, and a vector of matrices of bootstrap replicants, θb, returns an array with rows alternating between rows of θ and rows of tuples containing confidence intervals with coverage coverage probability.

source
DynamicDiscreteChoice.choicespecificvalue!Method
choicespecificvalue!(v, V,ddc)

Given a dynamic discrete choice model, ddc, and exante value function V, sets v equal to the choice specific value functions.

\[v[a,s] = u[a,s] + δ E[V(s') | a, s]\]

source
DynamicDiscreteChoice.emaxpFunction
emaxp(p, i0=1, d=Distributions.Gumbel())

Returns E[maxᵢ v[i] - v[i0] + ϵ[i] ] where ϵ[i] are i.i.d. d and p[i] = P(i = argmaxⱼ v[j] - v[i0] + ϵ[j])

source
DynamicDiscreteChoice.estimateMethod
estimate(p, transition, ddc::DDC; zero_action=first(ddc.actions)[1])

Estimate payoffs of dynamic discrete choice model. p should be estimates of the conditional choice probabilities. transition should be a "states" by "states" by "actions" array, with transition[new,old,action]=P(s=new|s=old,a=action).

source
DynamicDiscreteChoice.estimateMethod
estimate(p, transition, ddc::DDC; zero_action=first(ddc.actions)[1])

Estimate payoffs of dynamic discrete choice model. p should be estimates of the conditional choice probabilities. transition should be a ControlledMarkovChain representing the transitions when action a is chosen.

source
DynamicDiscreteChoice.estimate_seriesMethod
estimate_series(action_data, state_data, discount; zero_action=action_data[1],
                Fϵ=Distributions.Gumbel(),
                actions = OrderedDict(a => i for (i,a) ∈ enumerate(unique(action_data))),
                states = OrderedDict(s => i for (i,s) ∈ enumerate(unique(state_data))))

Given a vector of observed actions, action_data, and states, state_data, and discount rate, computes an estimate of the payoffs of the associated dynamic discrete choice model.

Normalizes the payoff of zero_action to 0 in all states.

action_data and state_data should be single time-series realizations of the game. Conditional sample means are used to estimate conditional choice probabilities and transition probabilities. Use estimate(p, ddc::DDC; zero_action=first(ddc.actions)[1]) if you want to use other estimates for choice and transition probabilities.

source
DynamicDiscreteChoice.exante_bellmanMethod
exante_bellman(V,v, ddc)

Compute the exante (before ϵ is known) Bellman operator for dynamic discrete choice model ddc. i.e. returns

\[Ṽ[s] = E[maxₐu[a,s] + ϵ[a] + δ E[V[s'] | a, s] ]\]

source
DynamicDiscreteChoice.hotzmillerFunction
hotzmiller(p, a0, d::Distributions.Gumbel=Distributions.Gumbel())

Given choice probabilities, return differences of choice specific value functions.

source
DynamicDiscreteChoice.simulateMethod
simulate(T, ddc, v)

Simulates dynamic discrete choice problem for T periods with choice specific value functions v.

Returns a named tuple consisting of states, state indices, actions, and action indices.

source
DynamicDiscreteChoice.simulateMethod

simulate(T, ddc)

Simulates dynamic discrete choice problem for T periods.

Returns a named tuple consisting of states, state indices, actions, and action indices.

source
DynamicDiscreteChoice.valueMethod
value(ddc; kwargs...)

Compute the value function for the dynamic discrete choice model ddc.

NLsolve.fixedpoint is used to compute the value functions. kwargs are options passed to NLsolve.fixedpoint.

Returns a name tuple containing the value function at each state, V, the choice specific value function, v, and the output of NLsolve.fixedpoint, solver_output.

source