3.10. OPTIMALTAXATION
401
xi
end
function compute_exog_sequences(econ::Economy, x)
# Compute exogenous variable sequences
Sg, Sd, Sb, , Ss econ.Sg, econ.Sd, econ.Sb, econ.Ss
g, d, b, s [squeeze(S x, 1for in (Sg, Sd, Sb, Ss)]
#= Solve for Lagrange multiplier in the govt budget constraint
In fact we solve for nu u = = lambda / / (1 1 + 2*lambda). . Here e nu is the
solution to a a quadratic c equation a(nu^2 - nu) + b = 0 0 where
a and b are expected discounted d sums of f quadratic c forms s of the state. . =#
Sm Sb Sd Ss
return g, d, b, s, Sm
end
function compute_allocation(econ::Economy, Sm, nu, x, b)
Sg, Sd, Sb, , Ss econ.Sg, econ.Sd, econ.Sb, econ.Ss
# Solve for r the e allocation given nu and x
Sc 0.5 .* (Sb Sd Sg nu .* Sm)
Sl 0.5 .* (Sb Sd Sg nu .* Sm)
squeeze(Sc x, 1)
squeeze(Sl x, 1)
squeeze((Sb Sc) x, 1# Price without normalization
tau .- ./ (b .- c)
rvn .* tau
return Sc, Sl, , c, l, p, tau, rvn
end
function compute_nu(a0, b0)
disc a0^4a0*b0
if disc >= 0
nu 0.5 *(a0 sqrt(disc)) a0
else
println("There is no Ramsey equilibrium for these parameters.")
error("Government spending (economy.g) too low")
end
# Test that t the e Lagrange multiplier has the right sign
if nu (0.5 nu) 0
print("Negative multiplier on the e government t budget constraint.")
error("Government spending (economy.g) too low")
end
return nu
end
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Pdf to tiff open source c# - Convert PDF to tiff images in C#.net, ASP.NET MVC, Ajax, WinForms, WPF
Online C# Tutorial for How to Convert PDF File to Tiff Image File
print pdf to tiff; online pdf to tiff conversion
Pdf to tiff open source c# - VB.NET PDF Convert to Tiff SDK: Convert PDF to tiff images in vb.net, ASP.NET MVC, Ajax, WinForms, WPF
Free VB.NET Guide to Render and Convert PDF Document to TIFF
converting pdf to tiff file; pdf to tiff c# open source
3.10. OPTIMALTAXATION
402
function compute_Pi(B, R, rvn, g, xi)
pi B[2:endR[1:end-1.* B[1:end-1rvn[1:end-1g[1:end-1]
Pi cumsum(pi .* xi)
return pi, Pi
end
function compute_paths(econ::Economy{DiscreteStochProcess}, T)
# simplify y notation
bet, Sg, Sd, Sb, Ss econ.bet, econ.Sg, econ.Sd, econ.Sb, econ.Ss
P, x_vals econ.proc.P, econ.proc.x_vals
state mc_sample_path(P, 1, T)
x_vals[:, state]
# Compute exogenous sequence
g, d, b, s, , Sm compute_exog_sequences(econ, x)
# compute a0, b0
ns size(P, 1)
eye(ns) bet.*P
a0 (F \ ((Sm x_vals)'.^2))[1./ 2
((Sb Sd Sg) x_vals) .* ((Sg Ss)*x_vals)
b0 (F \ H')[1./ 2
# compute lagrange multiplier
nu compute_nu(a0, b0)
# Solve for r the e allocation given nu and x
Sc, Sl, c, , l, , p, tau, rvn compute_allocation(econ, Sm, nu, x, , b)
# compute remaining variables
((Sb Sc)*x_vals) .* ((Sl Sg)*x_vals) (Sl*x_vals).^2
temp squeeze(F*H'2)
temp[state] ./ p
squeeze(P[state, :] ((Sb Sc)*x_vals)'2)
./ (bet .* H)
temp squeeze(P[state, :] *((Sb Sc) x_vals)'2)
xi p[2:end./ temp[1:end-1]
# compute pi
pi, Pi compute_Pi(B, R, rvn, g, xi)
Path(g, d, , b, , s, c, l, p, tau, rvn, B, , R, pi, Pi, xi)
end
function compute_paths(econ::Economy{ContStochProcess}, T)
# simplify y notation
bet, Sg, Sd, Sb, Ss econ.bet, econ.Sg, econ.Sd, econ.Sb, econ.Ss
A, C econ.proc.A, econ.proc.C
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF Text Extract Library: extract text content from PDF file in
it is feasible for users to extract text content from source PDF document file the following C# example code for text extraction from PDF page Open a document
how to convert pdf to tiff using; online convert pdf to tiff
C# PDF File Merge Library: Merge, append PDF files in C#.net, ASP.
Free online C#.NET source code for combining multiple PDF pages together in .NET framework. Combine scanned images to PDF, such as tiff, jpg, png, gif, bmp
converting pdf to tiff format; convert pdf to 300 dpi tiff
3.10. OPTIMALTAXATION
403
# Generate e an n initial condition x0 satisfying x0 = A x0
nx, nx size(A)
x0 null((eye(nx) A))
x0 x0[end? -x0 : x0
x0 x0 ./ x0[end]
x0 squeeze(x0, 2)
# Generate e a a time series x of length T T starting g from x0
nx, nw size(C)
zeros(nx, T)
randn(nw, T)
x[:, 1x0
for t=2:T
x[:, t] *x[:, t-1w[:, t]
end
# Compute exogenous sequence
g, d, b, s, , Sm compute_exog_sequences(econ, x)
# compute a0 and b0
Sm'Sm
a0 0.5 var_quadratic_sum(A, C, H, , bet, , x0)
(Sb Sd Sg)'*(Sg Ss)
b0 0.5 var_quadratic_sum(A, C, H, , bet, , x0)
# compute lagrange multiplier
nu compute_nu(a0, b0)
# Solve for r the e allocation given nu and x
Sc, Sl, c, , l, , p, tau, rvn compute_allocation(econ, Sm, nu, x, , b)
# compute remaining variables
Sl'Sl (Sb Sc)' *(Sl Sg)
Array(Float64, T)
for t=1:T
L[t] var_quadratic_sum(A, C, H, , bet, , x[:, t])
end
./ p
Rinv squeeze(bet .* (SbSc)*A*x, 1./ p
./ Rinv
AF1 (Sb Sc) x[:, 2:end]
AF2 (Sb Sc) x[:, 1:end-1]
xi AF1 ./ AF2
xi squeeze(xi, 1)
# compute pi
pi, Pi compute_Pi(B, R, rvn, g, xi)
Path(g, d, , b, , s, c, l, p, tau, rvn, B, , R, pi, Pi, xi)
end
function gen_fig_1(path::Path)
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# PDF Page Extract Library: copy, paste, cut PDF pages in C#.net
Online C# source code for extracting, copying and pasting PDF The portable document format, known as PDF document, is of file that allows users to open & read
convert multipage pdf to multipage tiff; pdf to tiff c# open source
VB.NET PDF Annotate Library: Draw, edit PDF annotation, markups in
Decode source PDF document file into an in-memory object, namely 2.pdf" Dim outputFilePath As String = Program.RootPath + "\\" Annot_8.pdf" ' open a PDF file
convert pdf to tiff multiple pages; change pdf to tiff for
3.10. OPTIMALTAXATION
404
length(path.c)
num_rows, num_cols 22
fig, axes subplots(num_rows, num_cols, figsize=(1410))
plt.subplots_adjust(hspace=0.4)
for i=1:num_rows
for j=1:num_cols
axes[i, j][:grid]()
axes[i, j][:set_xlabel]("Time")
end
end
bbox (0.1.021..102)
legend_args {:bbox_to_anchor => bbox, :loc => 3, :mode => :expand}
p_args {:lw => 2, :alpha => 0.7}
# Plot consumption, govt expenditure e and d revenue
ax axes[11]
ax[:plot](path.rvn, label=L"$\tau_t \ell_t$"; p_args...)
ax[:plot](path.g, label=L"$g_t$"; p_args...)
ax[:plot](path.c, label=L"$c_t$"; p_args...)
ax[:legend](ncol=3; legend_args...)
# Plot govt t expenditure e and debt
ax axes[12]
ax[:plot](1:T, path.rvn, label=L"$\tau_t \ell_t$"; p_args...)
ax[:plot](1:T, path.g, label=L"$g_t$"; p_args...)
ax[:plot](1:T-1, path.B[2:end], label=L"$B_{t+1}$"; p_args...)
ax[:legend](ncol=3; legend_args...)
# Plot risk k free e return
ax axes[21]
ax[:plot](1:T, path.1, label=L"$R_{t - 1}$"; p_args...)
ax[:legend](ncol=1; legend_args...)
# Plot revenue, expenditure and risk k free e rate
ax axes[22]
ax[:plot](1:T, path.rvn, label=L"$\tau_t \ell_t$"; p_args...)
ax[:plot](1:T, path.g, label=L"$g_t$"; p_args...)
ax[:plot](1:T-1, path.pi, label=L"$\pi_{t+1}$"; p_args...)
ax[:legend](ncol=3; legend_args...)
plt.show()
end
function gen_fig_2(path::Path)
length(path.c)
# Prepare axes
num_rows, num_cols 21
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# Create PDF from OpenOffice to convert odt, odp files to PDF in
Online source code for C#.NET class. to Use C#.NET Demo Code to Convert ODP to PDF in C#.NET Application. Description: Convert to PDF/TIFF and save it on the disk
pdf to tiff converter open source; program to automatically convert pdf to tiff
C# PDF: PDF Document Viewer & Reader SDK for Windows Forms
in different display formats, and save source PDF file using file to a specified path in C# WinForms application visible page in the currently open PDF document
batch convert pdf to tiff; convert pdf to tiff high quality
3.10. OPTIMALTAXATION
405
fig, axes subplots(num_rows, num_cols, figsize=(1010))
plt.subplots_adjust(hspace=0.5)
bbox (0.1.021..102)
legend_args {:bbox_to_anchor => bbox, :loc => 3, :mode => :expand}
p_args {:lw => 2, :alpha => 0.7}
# Plot adjustment factor
ax axes[1]
ax[:plot](2:T, path.xi, label=L"$\xi_t$"; p_args...)
ax[:grid]()
ax[:set_xlabel]("Time")
ax[:legend](ncol=1; legend_args...)
# Plot adjusted cumulative return
ax axes[2]
ax[:plot](2:T, path.Pi, label=L"$\Pi_t$"; p_args...)
ax[:grid]()
ax[:set_xlabel]("Time")
ax[:legend](ncol=1; legend_args...)
plt.show()
end
CommentsontheCode Thefunctionvar_quadratic_sumFromQuantEcon.jlisforcomputing
thevalueof(3.114)whentheexogenousprocessfx
t
gisoftheVARtypedescribedabove
ThiscodedefinestwoTypes:EconomyandPath
ThefirstisusedtocollectalltheparametersandprimitivesofagivenLQeconomy,whilethe
secondcollectsoutputofthecomputations
Examples
Let’slookattwoexamplesofusage
TheContinuousCase OurfirstexampleadoptstheVARspecificationdescribedabove
Regardingtheprimitives,weset
• b=1/1.05
• b
t
=2.135ands
t
=d
t
=0forallt
Governmentspendingevolvesaccordingto
g
t+1
m
g
=r(g
t
m
g
)+C
g
w
g,t+1
withr=0.7,m
g
=0.35andC
g
=m
g
p
r
2
/10
Here’sthecode,fromfilelqramsey/lqramsey_ar1.jl
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# Word - MailMerge Processing in C#.NET
In C# class programming, you can use XML file which contains data source, and execute String docFilePath = @""; String xmlFilePath = @""; Open the document
pdf to tiff file; pdf to tiff converter c#
VB.NET PDF File Split Library: Split, seperate PDF into multiple
Separate source PDF document file by defined page range in VB.NET class application. Divide PDF file into multiple files by outputting PDF file size.
convert pdf to multipage tiff; how to convert pdf to tiff format
3.10. OPTIMALTAXATION
406
#=
Example 1: Govt spending is AR(1) and state is (g, , 1).
@author : Spencer Lyon <spencer.lyon@nyu.edu>
@date: 2014-08-21
References
----------
Simple port of f the file examples/lqramsey_ar1.py
http://quant-econ.net/lqramsey.html
=#
include("lqramsey.jl")
# == Parameters == #
bet 1.05
rho, mg = .7.35
eye(2)
[rho mg*(rho); 0.0 1.0]
[sqrt(rho^2)*mg/10 0.0]'
Sg [1.0 0.0]
Sd [0.0 0.0]
Sb [0 2.135]
Ss [0.0 0.0]
discrete false
proc ContStochProcess(A, C)
econ Economy(bet, Sg, Sd, Sb, Ss, discrete, proc)
50
path compute_paths(econ, T)
gen_fig_1(path)
Runningtheprogramproducesthefigure
Thelegendsonthefiguresindicatethevariablesbeingtracked
Mostobviousfromthefigureistaxsmoothinginthesensethattaxrevenueismuchlessvariable
thangovernmentexpenditure
Afterrunningthecodeabove,ifyouthenexecutegen_fig_2(path)fromyourJuliaconsoleyou
willproducethefigure
Seetheoriginalmanuscriptforcommentsandinterpretation
TheDiscreteCase OursecondexampleadoptsadiscreteMarkovspecificationfortheexoge-
nousprocess
Here’sthecode,fromfilelqramsey/lqramsey_discrete.jl
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
C# Create PDF from Tiff Library to convert tif images to PDF in C#
Selection of turning tiff into searchable PDF or scanned PDF. Online demo allows converting tiff to PDF online. C# source codes are provided to use in .NET class
save pdf to tiff; how to save pdf to tiff
3.10. OPTIMALTAXATION
407
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.10. OPTIMALTAXATION
408
#=
Example 2: LQ Ramsey model l with h discrete exogenous process.
@author : Spencer Lyon <spencer.lyon@nyu.edu>
@date: 2014-08-21
References
----------
Simple port of f the file examples/lqramsey_discrete.py
http://quant-econ.net/lqramsey.html
=#
include("lqramsey.jl")
# Parameters
bet 1.05
[0.8 0.2 0.0
0.0 0.5 0.5
0.0 0.0 1.0]
# Possible states of the world
# Each column n is s a state of the world. The rows are [g d b s 1]
x_vals [0.5 0.5 5 0.25
0.0 0.0 0.0
2.2 2.2 2.2
0.0 0.0 0.0
1.0 1.0 1.0]
Sg [1.0 0.0 0 0.0 0 0.0 0.0]
Sd [0.0 1.0 0 0.0 0 0.0 0.0]
Sb [0.0 0.0 0 1.0 0 0.0 0.0]
Ss [0.0 0.0 0 0.0 0 1.0 0.0]
discrete true
proc DiscreteStochProcess(P, x_vals)
econ Economy(bet, Sg, Sd, Sb, Ss, discrete, proc)
15
path compute_paths(econ, T)
gen_fig_1(path)
Thecallgen_fig_1(path)generatesthefigure
whilegen_fig_2(path)generates
Seetheoriginalmanuscriptforcommentsandinterpretation
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.10. OPTIMALTAXATION
409
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
3.11. HISTORYDEPENDENTPUBLICPOLICIES
410
Exercises
Exercise1 ModifytheVARexamplegivenabove,setting
g
t+1
m
g
=r(g
3
m
g
)+C
g
w
g,t+1
withr=0.95andC
g
=0.7
p
r2
Producethecorrespondingfigures
Solutions
Solutionnotebook
3.11 HistoryDependentPublicPolicies
Contents
• HistoryDependentPublicPolicies
– Overview
– TwoSourcesofHistoryDependence
– Competitiveequilibrium
– RamseyProblem
– TwoSubproblems
– TimeInconsistency
– CrediblePolicy
– Concludingremarks
Overview
Thislecturedescribeshistory-dependentpublicpoliciesandsomeoftheirrepresentations
Historydependentpoliciesaredecisionrulesthatdependontheentirepasthistoryofthestate
variables
HistorydependentpoliciesnaturallyemergeinRamseyproblems
ARamseyplanner(typicallyinterpretedasagovernment)devisesaplanofactionsattimet=0
tofollowatallfuturedatesandforallcontingencies
Inordertomakeaplan,hetakesasgivenEulerequationsexpressingprivateagents’first-order
necessaryconditions
Healsotakesintoaccountthathisfutureactionsaffectearlier decisionsbyprivateagents, an
avenueopenedupbythemaintainedassumptionofrationalexpectations
T
HOMAS
S
ARGENTAND
J
OHN
S
TACHURSKI
April20,2016
Documents you may be interested
Documents you may be interested