DynamicDiscreteChoice
Documentation for DynamicDiscreteChoice.
Base.:*DynamicDiscreteChoice.bootstrap_seriesDynamicDiscreteChoice.bootstrap_tableDynamicDiscreteChoice.choicepDynamicDiscreteChoice.choicespecificvalue!DynamicDiscreteChoice.emaxDynamicDiscreteChoice.emaxpDynamicDiscreteChoice.estimateDynamicDiscreteChoice.estimateDynamicDiscreteChoice.estimate_seriesDynamicDiscreteChoice.exante_bellmanDynamicDiscreteChoice.hotzmillerDynamicDiscreteChoice.simulateDynamicDiscreteChoice.simulateDynamicDiscreteChoice.value
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.
DynamicDiscreteChoice.bootstrap_series — Methodbootstrap_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:
payoffsestimated payoffsvestimated choice specific value functionsTlength of dataddcDDC model containing estimated transitions inddc.transitionBnumber of bootstrap replications
DynamicDiscreteChoice.bootstrap_table — Methodbootstrap_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.
DynamicDiscreteChoice.choicep — Methodchoicep(v, ddc)Given choice specific value functions, returns conditional choice probabilities.
DynamicDiscreteChoice.choicespecificvalue! — Methodchoicespecificvalue!(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]\]
DynamicDiscreteChoice.emax — Functionemax(v, d=Distributions.Gumbel())Returns E[maxᵢ v[i] + ϵ[i] ] where ϵ[i] are i.i.d. d
DynamicDiscreteChoice.emaxp — Functionemaxp(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])
DynamicDiscreteChoice.estimate — Methodestimate(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).
DynamicDiscreteChoice.estimate — Methodestimate(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.
DynamicDiscreteChoice.estimate_series — Methodestimate_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.
DynamicDiscreteChoice.exante_bellman — Methodexante_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] ]\]
DynamicDiscreteChoice.hotzmiller — Functionhotzmiller(p, a0, d::Distributions.Gumbel=Distributions.Gumbel())Given choice probabilities, return differences of choice specific value functions.
DynamicDiscreteChoice.simulate — Methodsimulate(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.
DynamicDiscreteChoice.simulate — Methodsimulate(T, ddc)
Simulates dynamic discrete choice problem for T periods.
Returns a named tuple consisting of states, state indices, actions, and action indices.
DynamicDiscreteChoice.value — Methodvalue(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.