파일:Phase diagram of the Ramsey model.svg

testwiki
둘러보기로 이동 검색으로 이동
    원본 파일 (SVG 파일, 실제 크기 1,313 × 1,875 픽셀, 파일 크기: 2.14 MB)

    이 파일은 위키미디어 공용에 있으며, 다른 프로젝트에서 사용하고 있을 가능성이 있습니다. 해당 파일에 대한 설명이 아래에 나와 있습니다.

    파일 설명

    설명
    English: Model based on Advanced Macroeconomics: An Easy Guide (Campante et al 2021), chapter 3.

    Notation: k = capital (stock) per capita c = consumption (flow) per capita n = population growth rate δ = capital depreciation rate ρ = utility discounting rate

    We have the dynamics in $(k, c)$ space: $$\begin{cases} \dot k = f(k) - c - (n+\delta)k\\ \dot c= (f'(k) - (\delta + \rho))\sigma c \end{cases}$$ with initial conditions $$k(0) = k(0), \quad c(0) = u'^{-1}(\lambda(0))$$ and transversality condition $$\lim_t (ku'(c) e^{(n-\rho) t} )= 0$$

    Here, $\sigma$ is the "elasticity of intertemporal substitution in consumption". $$\sigma(c) := - \frac {u'(c)}{u(c)c} > 0$$ In particular, if we let $u(c) = \ln c$, then $\sigma(c) = 1$, a constant.

    Now plot the diagram with Julia:

    ```julia using CairoMakie, LinearAlgebra

    1. n = population growth rate
    2. δ = capital depreciation rate
    3. ρ = utility discounting rate

    n, δ, ρ = 1, 1, 0.5

    1. σ = "elasticity of intertemporal substitution in consumption",
    2. which is a constant 1 if u(c) = ln c.

    σ = 1

    1. production function

    f(k) = √k df(k) = 1/(2√k) invdf(y) = 1/(4 * y^2)

    1. dynamics of (k, c)

    dotkc(k, c) = [f(k)-c-(n + δ)k

                  (df(k)-(δ + ρ)) * σ * c]
    
    1. dotkc(x, y) = [-y - x^3; x^5]
    1. the ̇c = 0 curve

    dotc0(c) = invdf(δ + ρ)

    1. the ̇k = 0 curve

    dotk0(k) = f(k) - (n + δ) * k

    using Roots invdotk0 = find_zero(dotk0, (0.1, 0.3), Roots.A42()); function plotRamsey(x, y)

       xs = repeat(x, outer=length(y))
       ys = repeat(y, inner=length(x))
       
       xlims!(minimum(x), maximum(x))
       ylims!(minimum(y), maximum(y))
    
       # the ̇c=0 curve
       lines!(dotc0.(y), y, color=:black)
       # the ̇k=0 curve
       lines!(x, dotk0.(x), color=:blue)
    
       # the equilibrium point
       scatter!([dotc0(0)],[dotk0(dotc0(0))], color=:black)
       scatter!([invdotk0],[0], color=:red)
    
       # the flow vector field
       vectors = dotkc.(xs, ys)
       norms = vec(norm.(vectors)) 
       scaled_norms = tanh.(norms)/10
    
       us = map((x) -> x[1], vectors) 
       vs = map((x) -> x[2], vectors)
       us ./= norms
       vs ./= norms
       us .*= scaled_norms
       vs .*= scaled_norms
    
       arrows!(xs, ys, us, vs, arrowsize = 6, linecolor=scaled_norms, arrowcolor = :black)
    

    end

    1. define Figure

    width, height = 1400, 2000 scene = Figure(resolution = (width, height)) fsize = 30

    Axis(scene[1:2,1:2], backgroundcolor = "white",

       xlabel = L"$k$", xlabelsize=fsize,
       ylabel = L"$c$", ylabelsize=fsize,
       title = L"Ramsey model with $f(k) = \sqrt{k}$, and $n, δ, ρ, σ = %$(n, δ, ρ, σ)$", titlesize=fsize)
    

    xmin, xmax, xres = 0.0001, 0.3, 51 ymin, ymax, yres = -0.02, 0.15, 51

    x = range(start = xmin, stop = xmax, length = xres) y = range(start = ymin, stop = ymax, length = yres)

    plotRamsey(x, y)

    1. Closeup around the interior equilibrium

    Axis(scene[3,1], backgroundcolor = "white",

       xlabel = L"$k$", xlabelsize=fsize,
       ylabel = L"$c$", ylabelsize=fsize,
       title = L"interior equilibrium at $k, c = %$(round(dotc0(0), sigdigits=2)), %$(round(dotk0(dotc0(0)), sigdigits=2))$", titlesize=fsize)
    

    ϵ = 0.01 xmin, xmax, xres = dotc0(0)-ϵ, dotc0(0)+ϵ, 31 ymin, ymax, yres = dotk0(dotc0(0))-ϵ, dotk0(dotc0(0))+ϵ, 31 scatter!([dotc0(0)],[dotk0(dotc0(0))], color=:black)

    x = range(start = xmin, stop = xmax, length = xres) y = range(start = ymin, stop = ymax, length = yres)

    plotRamsey(x, y)

    1. Closeup around all-saving equilibrium

    Axis(scene[3,2], backgroundcolor = "white",

       xlabel = L"$k$", xlabelsize=fsize,
       ylabel = L"$c$", ylabelsize=fsize,
       title = L"all-saving equilibrium at $k = %$(round(invdotk0, sigdigits=2))$", titlesize=fsize)
    

    ϵ = 0.01 xmin, xmax, xres = invdotk0-ϵ, invdotk0+ϵ, 31 ymin, ymax, yres = -ϵ, +ϵ, 31

    x = range(start = xmin, stop = xmax, length = xres) y = range(start = ymin, stop = ymax, length = yres)

    plotRamsey(x, y)

    1. display plot

    scene

    1. save("Ramsey.svg", scene)
    ```
    날짜
    출처 자작
    저자 Cosmia Nebula

    라이선스

    나는 아래 작품의 저작권자로서, 이 저작물을 다음과 같은 라이선스로 배포합니다:
    w:ko:크리에이티브 커먼즈
    저작자표시 동일조건변경허락
    이용자는 다음의 권리를 갖습니다:
    • 공유 및 이용 – 저작물의 복제, 배포, 전시, 공연 및 공중송신
    • 개작 – 저작물의 개작, 수정, 2차적저작물 창작
    다음과 같은 조건을 따라야 합니다:
    • 저작자표시 – 적절한 저작자 표시를 제공하고, 라이선스에 대한 링크를 제공하고, 변경사항이 있는지를 표시해야 합니다. 당신은 합리적인 방식으로 표시할 수 있지만, 어떤 방식으로든 사용권 허가자가 당신 또는 당신의 사용을 지지하는 방식으로 표시할 수 없습니다.
    • 동일조건변경허락 – 만약 당신이 이 저작물을 개작 또는 변형하거나 이 저작물을 기반으로 제작하는 경우, 당신은 당신의 기여물을 원저작물과 동일하거나 호환 가능한 라이선스에 따라 배포하여야 합니다.

    설명

    이 파일이 나타내는 바에 대한 한 줄 설명을 추가합니다
    phase diagram of the Ramsey model

    파일 역사

    날짜/시간 링크를 클릭하면 해당 시간의 파일을 볼 수 있습니다.

    날짜/시간섬네일크기사용자설명
    현재2023년 1월 8일 (일) 16:122023년 1월 8일 (일) 16:12 판의 섬네일1,313 × 1,875 (2.14 MB)wikimediacommons>Cosmia Nebulafix caption

    이 파일을 사용하는 문서가 없습니다.