Code Monkey home page Code Monkey logo

Comments (2)

ptoche avatar ptoche commented on May 13, 2024 1

There is a Julia translation of Ben Moll's Matlab code to Julia here. It does not use EconPDE.jl, but can at least get you started.

from econpdes.jl.

matthieugomez avatar matthieugomez commented on May 13, 2024 1

Yes, it is possible: you simply need to add a fourth argument in pdesolve for the time grid you want to use. For instance

m = AchdouHanLasryLionsMollModel()
distribution = Gamma(2 * m.κy * m.ybar / m.σy^2, m.σy^2 / (2 * m.κy))
stategrid = OrderedDict(
        :y => range(quantile(distribution, 0.001), quantile(distribution, 0.999), length = 10), 
        :a =>  range(m.amin, m.amax, length = 100)
)
# value function at terminal time
yend = OrderedDict(:v => [max(a + y)^(1-m.γ)/(1-m.γ) for y in stategrid[:y], a in stategrid[:a]]) 
# time grid with terminal value at 100 years
τs = range(0, stop = 100, step = 1)
# solve pde
ys, results, distances = pdesolve(m, stategrid, yend, τs)

let me know if that solves your issue!

from econpdes.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.