Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Econ 627

Assignment 10

1.  (BIC for GMM) Suppose the model is given by

Eg(Wi , θ0 ) = 0,

Wi/  = (Yi , Xi , Zi ),

g(Wi , θ) = Zi (Yi . m(X θ))i(/) ,

where Zi  is the l-vector of IVs, Xi  is the k-vector of potential regressors, θ0  e Θ c 皿k , and m :  → 皿 is a known function. Assume that

l > k,

data are iid, and the usual conditions for consistency and asymptotic normality of

GMM hold. Write

A = {j : θj   0},

gA (Wi , θA ) = Zi  Yi . m(Xi(/),A θA ),

and let A0  denote the true set of included regressors:

A0  = {j : θ0j   0}.

The efficient GMM estimator for a model A is given by

θˆA,n  = arg  min  QA,n(θA ),    where

θeΘ

QA,n(θA ) =  gA (Wi , θA )\/ A(-)   gA (Wi , θA )\ ,

and A(-)  is the corresponding consistent estimator of the efficient weight matrix. Sup- pose that the econometrician estimates A0  by

Aˆn  = arg A(mi)n ,QA,n(θˆA,n) + |A|  .

Is Aˆn  a consistent estimator of A0 ?  In other words, does P Aˆn  = A0   converge to

one? Provide detailed arguments to justify your answer.

2.  (MC simulations for Lasso) In this question, you will simulate the probabilities of Lasso including true and wrong regressors for the following model.  Let Xi  be a k-vector of potential regressors (excluding the intercept). The potential regressors are

jointly normal with zero means, unit variances, and for j  l ,

Cov(Xi,j , Xi,l ) = ρ.

Only the first two regressors have non-zero coefficients in the true model:

Yi  = α + β1Xi,1 + β2Xi,2 + Ui ,

where Ui  ~ N(0, σ2 ) and independent of Xi . Set n = 300, k = 50, and α = 1.


(a) Define a Julia function that generates n observations from the model for a given

set of parameter values: ρ, σ, β1 , β2 .

(b) Define a Julia function that given data on the dependent variable Y , potential regressors X , and a penalty parameter λn computes the Lasso estimates by solving

be皿么(m)i,ae(n) ,  |Y . Xb . a · ι|2(2) + λn |b|1  ,

where ι is the n-vector of ones. Note that we do not penalize the intercept and it is always included in the estimated model. Hints:

● Use the Julia package “Convex” with the solver “SCS”, see an example at

https://jump.dev/Convex.jl/stable/examples/general_examples/lasso_regression/

● Note that due to numerical approximation errors, the “Convex” package will produce very small estimates instead of exact zeros for the excluded regres- sors. The approximation errors will be below a set tolerance level, which you can control by adjusting the tolerance parameters. For example, you can set the tolerance parameters to 1.0e-08 and then round the estimates to 5 decimal places to report exact zeros.

● For example, to adjust the tolerance for the “SCS” solver, you can use “MOI=Convex.MOI”

followed by

“opt = MOI.OptimizerWithAttributes(SCS.Optimizer, "eps_abs"=>1.0e-08, "eps_rel"=>1.0e-08, MOI.Silent() => true)”

and then use “opt” as the solver in the “solve!()” command:

solve!(my_roblem, opt,verbose=false)”

Here “my_problem” is an optimization problem defined using the Convex” package interface, and the option “verbose=false” is used to suppress warn- ings.

● You can find more information on how to pass optional parameters to a solver at

https://jump.dev/Convex.jl/v0.13.2/solvers/

(c) Using  104   MC repetitions, simulate the following three probabilities:  i) Lasso selected the first regressor, ii) Lasso selected the second regressor, and iii) Lasso selected one of the irrelevant regressors. Use ρ = 0.2, σ = β1  = β2  = 2.0. Set the penalty parameter as

λn  = 1.1σ  .

Hint:

● Define a Julia function that computes the simulated probabilities given the values for ρ, σ, β1 , β2 . The same function can be used in parts below to avoid duplicating large chunks of the same code.

● To reduce computation time, you can use 103  MC repetitions instead.

(d) Repeat part (c) for ρ = 0.2, σ = β1  = β2  = 0.1.             (e) Repeat part (c) for ρ = 0.2, σ = β1  = 2.0 and β2  = 0.2.


(f) Repeat part (c) for ρ = 0.9, σ = β1  = β2  = 2.0.

(g) Use the Julia package “PrettyTables” to collect the results from parts (c)-(f) in a single table, and discuss the results:

● In part (c), does Lasso select the true model accurately?

● Explain the the differences/similarities between the simulated probabilities in parts (c) and (d).

● How do the results change between parts (c) and (e)? Is it expected? Explain.

● How do the results change between parts (c) and (f)? Is it expected? Explain.