Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Creel committed May 27, 2024
1 parent 7834252 commit 2396273
Show file tree
Hide file tree
Showing 64 changed files with 164 additions and 2,297 deletions.
75 changes: 75 additions & 0 deletions Examples/DSGE/Bayesian/CKmcmc_cn.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Dynare version: 0.9.12
2024-05-27T11:03:33.318: Starting @dynare CKmcmc_cn.mod
["CKmcmc_cn.mod", "language=julia", "json=compute"]
Dynare preprocessor version: 6.4.0+0
2024-05-27T11:03:33.369: End of preprocessing
2024-05-27T11:03:33.427: Start parse_statements!
* Status: success

* Candidate solution
Final objective value: -1.230593e+03

* Found with
Algorithm: BFGS

* Convergence measures
|x - x'| = 1.14e-02 ≰ 0.0e+00
|x - x'|/|x'| = 4.10e-03 ≰ 0.0e+00
|f(x) - f(x')| = 7.68e-04 ≰ 0.0e+00
|f(x) - f(x')|/|f(x')| = 6.24e-07 ≤ 1.0e-05
|g(x)| = 3.48e-01 ≰ 1.0e-08

* Work counters
Seconds run: 0 (vs limit Inf)
Iterations: 16
f(x) calls: 54
∇f(x) calls: 54

Posterior mode

───────────┬──────────────────────────────────────────────────────────
Parameter │ Estimated value Standard error 80% confidence interval
──────────────────────────────────────────────────────────────────────
betta │ 0.9923 0.0022 0.9894 .. 0.9952
gam │ 1.8895 0.2858 1.5237 .. 2.2554
rho1 │ 0.9075 0.0368 0.8604 .. 0.9547
sigma1 │ 0.0089 0.0032 0.0048 .. 0.013
rho2 │ 0.6908 0.0367 0.6438 .. 0.7377
sigma2 │ 0.02 0.0014 0.0182 .. 0.0219
nss │ 0.3313 0.0017 0.3291 .. 0.3335
───────────┴──────────────────────────────────────────────────────────

Chains MCMC chain (20000×8×1 Array{Float64, 3}):

Iterations = 1:1:20000
Number of chains = 1
Samples per chain = 20000
parameters = betta, gam, rho1, sigma1, rho2, sigma2, nss
internals = lp

Summary Statistics
parameters mean std mcse ess_bulk ess_tail rhat ess_per_sec
Symbol Float64 Float64 Float64 Float64 Float64 Float64 Missing

betta 0.9922 0.0001 0.0000 43.0958 52.6142 1.1303 missing
gam 1.9438 0.1844 0.0127 212.9630 531.2424 1.0051 missing
rho1 0.9134 0.0121 0.0012 106.6110 189.5468 1.0012 missing
sigma1 0.0087 0.0002 0.0000 47.5387 60.8079 1.0289 missing
rho2 0.6930 0.0308 0.0028 121.1247 172.7737 1.0456 missing
sigma2 0.0192 0.0006 0.0001 42.2265 53.5604 1.5697 missing
nss 0.3319 0.0010 0.0001 44.1977 60.1431 1.0207 missing

Quantiles
parameters 2.5% 25.0% 50.0% 75.0% 97.5%
Symbol Float64 Float64 Float64 Float64 Float64

betta 0.9919 0.9922 0.9923 0.9923 0.9925
gam 1.6043 1.8146 1.9333 2.0667 2.3280
rho1 0.8911 0.9049 0.9136 0.9217 0.9362
sigma1 0.0081 0.0085 0.0087 0.0089 0.0090
rho2 0.6302 0.6726 0.6946 0.7136 0.7519
sigma2 0.0179 0.0188 0.0191 0.0196 0.0203
nss 0.3299 0.3313 0.3320 0.3326 0.3337

2024-05-27T11:04:18.646: End parse_statements!
2024-05-27T11:04:18.646: End parser
7 changes: 1 addition & 6 deletions Examples/DSGE/Bayesian/CKmcmc_cn.mod
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ z1 = 0;
z2 = 0;
end;

steady;

stoch_simul(order=1);


estimated_params;
// start values for the optimization
// the numbers after the comment are the true
Expand All @@ -77,6 +72,6 @@ end;
varobs c n; // experiment choosing one or two from y c n r w

// Does a single fairly short chain
estimation(order=1, datafile='dsgedata.csv', mh_replic=20000, mh_jscale=2.) ;
estimation(order=1, datafile='dsgedata.csv', mh_replic=20000, mh_nblocks=4, mh_jscale=2.) ;


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NB: this file was automatically generated by Dynare
# from CKml.mod
# from CKmcmc_cn.mod
#
function dynamic_params_derivs(y, x, params, steady_state, it_,ss_param_deriv, ss_param_2nd_deriv)
@inbounds begin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NB: this file was automatically generated by Dynare
# from CKml.mod
# from CKmcmc_cn.mod
#
function static_params_derivs(y, x, params)
@inbounds begin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NB: this file was automatically generated by Dynare
# from CKml.mod
# from CKmcmc_cn.mod
#
function steady_state!(ys_::Vector{<: Real}, exo_::Vector{<: Real}, params::Vector{<: Real})
@inbounds begin
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
6 changes: 6 additions & 0 deletions Examples/DSGE/Bayesian/Estimate.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using Dynare

context = @dynare "CKmcmc_cn.mod"

results = context.results.model_results[1]
results.estimation.posterior_mode
4 changes: 2 additions & 2 deletions Examples/DSGE/BayesianGMM/DoMCMC.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
##
cd(@__DIR__)
using Econometrics, LinearAlgebra, Statistics, DelimitedFiles, SolveDSGE, MCMCChains, Plots, Distributions
using Econometrics, LinearAlgebra, Statistics, CSV, SolveDSGE, MCMCChains, Plots, Distributions
include("DSGEmoments.jl")
include("DSGEmodel.jl") # defines prior and log-likelihood
include("CKlib.jl")

function main()
cd(@__DIR__)
data = readdlm("dsgedata.txt")
data = CSV.File("dsgedata.csv") |> CSV.Tables.matrix
lb, ub = PriorSupport()
θtrue = TrueParameters()
# start values from GMM
Expand Down
1 change: 1 addition & 0 deletions Examples/DSGE/BayesianGMM/dsgedata.csv
1 change: 0 additions & 1 deletion Examples/DSGE/BayesianGMM/dsgedata.txt

This file was deleted.

4 changes: 2 additions & 2 deletions Examples/DSGE/GMM/DoGMM.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# this computes the GMM estimator by SA minimization, for
# one of the 1000 data sets. Can be parallelized using
# threads.
using Econometrics, SolveDSGE, DelimitedFiles, Statistics, LinearAlgebra, ForwardDiff
using Econometrics, SolveDSGE, CSV, Statistics, LinearAlgebra, ForwardDiff
cd(@__DIR__)
include("DSGEmoments.jl") # computes errors
include("CKlib.jl")
Expand All @@ -11,7 +11,7 @@ global const dsge = retrieve_processed_model("../GenData/CK_processed.txt")
function main(defaultdata = true)
cd(@__DIR__)
# call program as main() for the default data, as main(false) for new random data
defaultdata ? data = readdlm("dsgedata.txt") : data = dgp(TrueParameters(), dsge, 1, rand(1:Int64(1e10)))[1]
defaultdata ? data = CSV.File("dsgedata.csv") |> CSV.Tables.matrix : data = dgp(TrueParameters(), dsge, 1, rand(1:Int64(1e10)))[1]

# define CUE GMM criterion
include("parameters.jl") # load true parameter values
Expand Down
1 change: 1 addition & 0 deletions Examples/DSGE/GMM/dsgedata.csv
1 change: 0 additions & 1 deletion Examples/DSGE/GMM/dsgedata.txt

This file was deleted.

152 changes: 0 additions & 152 deletions Examples/DSGE/GenData/CKNlib.jl

This file was deleted.

24 changes: 0 additions & 24 deletions Examples/DSGE/GenData/GenNoisyData.jl

This file was deleted.

Loading

0 comments on commit 2396273

Please sign in to comment.