Comments (1)
You can use the package Interpolations to interpolate the values in result
:
using Interpolations
function simulate(m::AchdouHanLasryLionsMollModel, stategrid, result_ip)
T = 100
yT, aT, cT = zeros(T), zeros(T), zeros(T)
y, a = 1.0, 1.0
for t in 1:T
y += m.κy * (m.ybar - y) + m.σy * rand(Normal())
a += result_ip[:μa](y, a)
yT[t] = y
aT[t] = a
cT[t] = result_ip[:c](y, a)
end
return yT, aT, cT
end
m = AchdouHanLasryLionsMollModel()
stategrid = initialize_stategrid(m)
y0 = initialize_y(m, stategrid)
y, result, distance = pdesolve(m, stategrid, y0)
result_ip = Dict(x => interpolate(tuple(values(stategrid)...), result[x], Gridded(Linear())) for x in keys(result))
yT, aT, cT = simulate(m, stategrid, result_ip)
from econpdes.jl.
Related Issues (20)
- Mixed Derivative with Non Uniform Grid HOT 3
- Vector vs Elementwise
- Aiyagari Continuous Time eample using EconPDEs HOT 2
- Finite horizon boundary problem HOT 3
- CambpellCochrane.jl HOT 3
- Finite horizon consumption-saving problem HOT 2
- Bug in AchdouHanLasryLionsMoll one asset example HOT 2
- TagBot trigger issue HOT 4
- Does this work on the latest version of Julia? HOT 1
- Simple Firm Investment Problem HOT 2
- Neoclassical Growth Model Example
- Syntax error? HOT 2
- Cite this package
- More than two states HOT 1
- Order vs named
- DiTella Model HOT 3
- Allow a way to specify different boundary conditions
- Solve Kolmogorov Forward Equation together with an HJB HOT 6
- Register HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from econpdes.jl.