A nonparametric approach to solving a simple one-sector stochastic growth model

A nonparametric approach to solving a simple one-sector stochastic growth model

Economics Letters 125 (2014) 447–450 Contents lists available at ScienceDirect Economics Letters journal homepage: www.elsevier.com/locate/ecolet A...

430KB Sizes 0 Downloads 49 Views

Economics Letters 125 (2014) 447–450

Contents lists available at ScienceDirect

Economics Letters journal homepage: www.elsevier.com/locate/ecolet

A nonparametric approach to solving a simple one-sector stochastic growth model Philip Shaw ∗ Fordham University, Department of Economics, 441 East Fordham Rd., Bronx, NY 10458, United States

highlights • We introduce a nonparametric approach to solving nonlinear stochastic dynamic models. • The distinct advantage of this approach is that there are no restrictions placed on the unknown conditional expectations function. • This approach is shown to be stable and accurate when applied to a simple one-sector stochastic growth model.

article

info

Article history: Received 28 April 2014 Received in revised form 17 September 2014 Accepted 15 October 2014 Available online 6 November 2014 JEL classification: C63 C68

abstract In this paper we present a nonparametric approach to solving a simple one-sector stochastic growth model. A distinct advantage of our approach is that it does not require placing restrictions on the generally unknown conditional expectations functions. Our method is shown to be accurate and computationally stable when compared to the standard Parameterized Expectations Approach (PEA) and the traditional linear approximation. We demonstrate this using a simple stochastic general equilibrium model with a known solution. © 2014 Elsevier B.V. All rights reserved.

Keywords: Nonparametric econometrics Computational methods Parameterized expectations algorithm

1. Introduction In this paper we introduce a nonparametric method for computing equilibria in nonlinear stochastic dynamic models. The distinct advantage to this approach is that there are no restrictions placed on the functional form of the underlying conditional expectations function to be estimated. We show that the method performs very well against both the traditional Parameterized Expectations Approach (PEA) introduced by Marcet (1988) and the traditional linear approximation. 2. A general framework Following Maliar and Maliar (2003) we characterize the economy by a vector of n variables, zt , and s exogenously determined shocks, ut . Furthermore, let xt be a subset of (zt −1 , ut ) and let the



Tel.: +1 618 806 4988. E-mail address: [email protected].

http://dx.doi.org/10.1016/j.econlet.2014.10.011 0165-1765/© 2014 Elsevier B.V. All rights reserved.

process {zt , ut } be represented by the following system: g (Et [φ(zt +1 , zt )], zt , zt −1 , ut ) = 0

for all t

(1)

where g: R × R × R × R → R and φ : R → R . The conditional expectations function E [φ(zt +1 , zt )|xt ] = Φ (xt ) is generally unknown and thus the solution to the system is generally unknown. One approach to solving this problem is to use the method of Marcet (1988) which is known as the parameterized expectations approach (PEA). The basic idea behind the method is to approximate the conditional expectations functions by imposing parametric assumptions on the conditional expectations functions. This approach is viable because by definition the conditional expectations function will solely be a function of the conditioning set of variables. In theory, this means that one can select a function that can approximate the unknown functions with an arbitrary level of accuracy. The distinct advantage to using projection methods, such as the PEA, is that it is easy to implement in practice. Furthermore, they can be much faster than more accurate measures such as value function iteration or methods that rely upon numerical integration, especially when the dimension of the state space is m

n

n

s

q

2n

m

448

P. Shaw / Economics Letters 125 (2014) 447–450

large. In addition to this, projection methods do not suffer from the curse of dimensionality in the same way as value function iteration. This same advantage will be true for the nonparametric approach we lay out in this paper. The disadvantage of the PEA is that it can exhibit implosive or explosive behavior. This is a problem specifically addressed by Maliar and Maliar (2003) where they show that by placing moving bounds on the endogenous state variables, one can overcome the implosive or explosive behavior of the PEA algorithm. The basic idea of PEA can be summarized as follows:

are cross-validation or modified Akaike information criterion (AIC) procedures.2 We use the following update method for the choice of j bandwidth hj+1 = (1 −ω)hpilot +ωhˆ where hˆ is the j + 1 bandwidth calculated via ROT with ω ∈ (0, 1]. This is similar to the homotopy approach followed by Marcet (1988).

β ∗ = argmin ∥ψ(β, xt ) − Φ (xt )∥

To implement the nonparametric expectations approach (NPEA) in practice we must start off with an initial guess for the conditional expectations function. Given this we can calculate the sequence of variables zt . Then we update the estimate for the conditional expectations function and iterate until convergence.

(2)

β∈Rv

where the PEA seeks to find a vector of parameters that minimize the distance between the actual expectations function and a fixed approximate. One problem with this approach, as with any parametric approach, is that the approximating function can be misspecified resulting in an inaccurate solution. In practice, one could just increase the order of approximation however this approach can be costly computationally as the order of expansion increases to reduce the degree of model misspecification. Furthermore as shown by Judd et al. (2011) higher order approximations lead to an ill-posed inverse problem when using standard parametric methods to estimate the conditional expectations. They address the stability problem by offering a wide variety of parametric approximation methods, including regularization methods, which greatly increase the accuracy and stability of the parameterized expectations approach. Our approach differs from the traditional PEA in that we avoid function selection and the ill-posed problem directly. Using a nonparametric approach, we focus on estimating the conditional expectations function directly using the joint and marginal distributions of the variables given by the following expression1 : E [φ(zt +1 , zt )|xt ] =

φ(zt +1 , zt )f (zt +1 , zt , xt ) dzt +1 dzt . f (xt )



(3)

In theory, the conditional expectations operator is the best predictor in the mean squared error sense. Thus there exists no other function that predicts φ better than Eq. (3). Only under certain assumptions will a given parametric function coincide with the conditional expectations function. In practice, one can estimate this conditional expectations function nonparametrically using the generalized product kernel as presented in Li and Racine (2003):

ˆ (x) Eˆ [φ(zt +1 , zt )|xt = x] = m T 

=

φˆ t

r1 

t =1

i

r1 T   t =1 i

1 hi

1 hi

w

w





xci −xcit

 r2

hi xci −xcit hi

r3 

I (xdit ̸=xdi )

λi

state variables generated above update the conditional expecˆ i+1 . tations functions to m • Step three. Check for convergence of the conditional expectaˆ i, m ˆ i+1 ) < ϵ for some distance tions function such that D(m function D. To initialize the algorithm we use a parametric function with an uninformative prior so that our starting function is given by ψ(β = 0; xt ). This assumption allows the researcher to remain agnostic about the underlying function to be estimated. As shown later this initialization does not affect the convergence of the nonparametric method. 4. An example We follow the example as laid out by Maliar and Maliar (2003) and Duffy and McNelis (2001) where they consider a simple onesector stochastic growth model. The basic setup is as follows: max E0

{ct ,kt }∞ t =0

λi

I (xdit ̸=xdi )

λi

r3 

|xsit −xsi |

(4)

λi

i

where xc are continuous state variables, xd are discrete state variables, and xs are discrete variables with a natural ordering. Given the general form for our product kernel, the nonparametric approach can handle any type of state variable whether they be continuous or discrete. We select the bandwidth parameter using the

1/r1



1

1 rule-of-thumb: h = c T 4+r1 where c ∈ R+ and σi is i=1 σi the standard deviation of xi . Other choices for bandwidth selection

1 A similar approach has been developed by Jirnyi and Lepetyuk (2011) but their focus is particularly on solving for the dynamics of heterogeneous agent models with aggregate uncertainty. Their approach also relies on an alternative to the kernel methods presented in this paper where they use a K -nearest neighborhood approach instead of the local constant approach presented in this paper.

∞ 

1−γ

δt

t =0

ct

1−γ

,

ρ

s.t. ct + kt = (1 − d)kt −1 + θt kαt −1 (5) d

where θt = θt −1 exp(ut ) and ut ∼ N (0, σ 2 ) From the first order conditions we obtain the classic Euler equation presented as: ct

|xsit −xsi |

i

i

r

ˆ i, • Step one. Given a sequence of {ut }Tt=1 and initial guess m T ˆ calculate {zt , φt }t =1 . • Step two. Given the sequence of endogenous and exogenous

−γ

i

 r2

3. Implementation

= δE

1 − d + θ γ

t +1

ct +1

  α ktα−1  θt , kt −1 .

(6)

Just by the nature of the conditional expectation function, Eq. (6) will only be a function of the conditioning set. In general, the solution to Eq. (6) cannot be found analytically. However when γ = 1 and d = 1 we can show that ct = (1 − αδ)θt kαt −1 . Using the PEA we might try to approximate the unknown conditional expectations with the following approximate:

ψ(β; θt , kt −1 ) = exp(β0 + β1 log(θt ) + β2 log(kt −1 ) + β3 (log(kt −1 ))2 + β4 (log(θt ))2 + β5 log(kt −1 ) log(θt )).

(7)

Once the functional form is chosen and the parameter vector β is initialized, then a sequence of kt (β i−1 ) = ψ(β i−1 ; kt −1 (β i−1 ), θt ) and ct (β i−1 ) = (1 − d)kt −1 + θt kαt −1 kt (β i−1 ) is generated for an exogenous sequence of θt . Once this is done, the researcher i−1

2 For a detailed treatment of these methods see Racine and Li (2007).

P. Shaw / Economics Letters 125 (2014) 447–450 α−1

1−d+θt +1 α kt γ ct +1 3

generates Yt = kt =

γ

ct kt and then runs NLS for the

following objective function :

β i = argmin

T 1

[Yt − ψ(β i−1 ; kt −1 (β i−1 ), θt )]2 .





Yt f (Yt , θt , kt −1 )



f (θt , kt −1 )

Yt ∈S

dYt .

(9)

Given a particular sequence of observations for Yt , θt , and kt −1 we can estimate the above expression consistently without making any assumptions regarding the shape of the unknown function to be estimated. Using the kernel functions presented earlier in the paper we can estimate the expression in Eq. (9) using the following expression: T 

ˆ



E Yt |θt , kt −1



ˆ (θ , k) = =m

w

=

θt −θ hθ

t =1 T  t =1

T 



w



,

θt −θ hθ

kt −1 −k hk

,



kt −1 −k hk

Yt



w(z )Yt

t =1 T 

(10)

t =1

{mi − mi−1 }2

t =1 T 



(11)

{mi−1 }2

t =1

where we set ϵ = 10−9 throughout the various experiments. We set T = 1000 and present the remaining parameters in Table 1 below: 5. Accuracy checks Following Duffy and McNelis (2001) we implement the following accuracy check: e(g ) = log10

1 Nk Nθ

  gˆ (k, θ ) − g (k, θ ) 2 k

α

δ

γ

d

ρ

σ

k−1

θ0

ω

c

0.33

0.95

1

1

0.95

[.01 .05 .10]

kss

1

0.9

1.06

Table 2 Accuracy measures and computation time.

σ

e(g )NP

e(h)L

ρNP

ρL

Time (s)

0.01 0.05 0.1

−5.11 −3.83 −2.11

−6.48 −3.90 −1.87

1.00 1.00 1.00

1.00 1.00 1.00

3.32 3.02 8.55

The basic idea of the above equation is to generate a fixed grid of θ and k and then take the relative squared error between the approximated policy function for consumption (ˆg ) and the true policy function (g ). We generate the grid of values for θ taking the minimum and maximum realized values of θ and then generating a grid of 80 points between the two values. From this we can then 1

calculate a grid for k using the relation k = (αβθ ) 1−α . The advantage to using the above metric is that it has an economic interpretation. For example, a log10 average relative squared error of −2 represents an accuracy rate of 1 in 100, which means the approximation error costs $1 for every $100 in consumption expenditures. A value of −3 gives an accuracy rate of 1 in 1000. In addition to the accuracy measure presented above we also report the correlation between the true series and that generated by alternative approximation methods. 6. Results

w(z )

where w is chosen to be the PDF for the standard normal distribution. The basic idea behind the local constant approach to nonparametric estimation is to construct a ‘‘local average’’ of Yt as an estimate for the unknown function. This is done by constructing a weighted average of Yt using w(z ) as the weight in the neighborhood of z as defined by bandwidth parameter h. We can then think of Th as the ‘‘local sample size’’ we use to estimate the unknown function m(θ , k). For the initialization of the conditional expectations function we start with a parametric version as presented in Eq. (7) with βj = 0 for j = 0, . . . , 5. For our convergence criterion we use the following expression: T 

Table 1 Parameters across simulations.

(8)

T t =1 In theory, we can approximate the conditional expectations to an arbitrary level of accuracy. However, in practice higher order expansions are costly computationally and lead to instability. Therefore in any application the researcher might choose the simpler model and might therefore misspecify the true but unknown conditional expectations function. Our approach instead focuses on estimating the following expression: E Yt |θt , kt −1 =

449

θ

g (k, θ )

.

(12)

3 Following Judd et al. (2011) we parameterize the capital stock equation instead of the consumption Euler. As they show this can help with convergence when implementing the parametric approach.

We summarize the results of the accuracy tests in Table 2. We do not report the results for the PEA as they did not converge once for our simulations. This is a known problem of PEA directly addressed by Maliar and Maliar (2003) and Judd et al. (2011). From the results it is clear that the linear approximation dominates the NPEA when σ = .01. However as σ increases, the curvature of the policy function sets in making the linear policy function less accurate. As demonstrated in Table 2 when σ = .01 the e(g ) statistic is −6.48 for the linear approximation and −5.11 for the NPEA. When σ = .05 the accuracy of the policy functions is similar for the linear and nonparametric approximations. When σ = .10e(g ) = −2.11 for the NPEA and −1.87 for the linear approximation. In Table 2 we also report the correlation between the actual series and the approximated series. Both the NPEA and the linear approximation are perfectly correlated to the actual series as evident from Table 2. In addition to the accuracy results, we also report the computation times for the NPEA. Table 2 shows that the NPEA converges very quickly with a maximum time across simulations of only 8.55 s. To see how the pilot bandwidth impacts the results we also report the path of bandwidths over iterations for σ = .01 in Fig. 1 starting at hpilot = [hθ , hk ] = [.2, .2] and hpilot = [hθ , hk ] = [.07, .07]. It becomes evident from Fig. 1 that the pilot bandwidth has no impact on convergence. In-fact for σ = .01, σ = .05, and σ = .10 we use hpilot = [hθ , hk ] = [.2, .2] as the pilot bandwidth and experience no problems with convergence. This result suggests that very little is required from the user when supplying a guess for the pilot bandwidth. In addition to this recall that we have placed an uninformative prior on the initial conditional expectations function. This result is in stark contrast to the PEA where the initial conditions have a large impact on whether the algorithm converges. This problem was the main motivation behind the paper by Maliar and Maliar (2003) where they construct a movings bound approach to help stabilize the PEA when bad initial

450

P. Shaw / Economics Letters 125 (2014) 447–450

Fig. 1. Impact of pilot bandwidth on convergence.

conditions are chosen. Our results suggest that the NPEA does not share this problem. 7. Conclusion In this paper we present a nonparametric approach to solving stochastic general equilibrium models. A distinct advantage of our method is that it does not necessitate placing heavy restrictions on the generally unknown conditional expectations functions. Our method is shown to be accurate and computationally stable when compared to the standard Parameterized Expectations Approach (PEA) and the traditional linear approximation. We demonstrate this using a simple stochastic general equilibrium model with a known solution. Future work might look at extending the NPEA to multi-country growth models as well as to heterogeneous models with aggregate uncertainty.

References Duffy, J., McNelis, P.D., 2001. Approximating and simulating the stochastic growth model: Parameterized expectations, neural networks, and the genetic algorithm. J. Econ. Dyn. Control 25 (9), 1273–1303. Jirnyi, A., Lepetyuk, V., 2011. A reinforcement learning approach to solving incomplete market models with aggregate uncertainty, Working Papers. Serie AD 2011–21, Instituto Valenciano de Investigaciones Econmicas, S.A. (Ivie). Judd, K., Maliar, L., Maliar, S., 2011. Numerically stable and accurate stochastic simulation approaches for solving dynamic economic models. Quantit. Econom. 2, 173–210. Li, Q., Racine, J., 2003. Nonparametric estimation of distributions with categorical and continuous data. J. Multivariate Anal. 86 (2), 266–292. Maliar, L., Maliar, S., 2003. Parameterized expectations algorithm and the moving bounds. J. Bus. Econom. Statist. 21, 88–92. Marcet, A., 1988. Solving Nonlinear Stochastic Models by Parameterizing Expectations, unpublished manuscript, Carnegie Mellon University. Racine, J.S., Li, Q., 2007. Nonparametric Econometrics: Theory and Practice. Princeton University Press.