Hi,
I need to ask for help regarding splines/interpolation. I just implemented value function iteration code (simple discretization), and now, I need to interpolate resulting discrete policy function (for purpose of model simulation).
I followed this notebook https://lectures.quantecon.org/jl/general_packages.html (section multivariate interpolation). Examples from this notebook worked fine (except scatter plotting function). However, when I tried to use same function to my data (discretized policy function), I get following error:
julia> Policy = CubicSplineInterpolation((hcat(GridK),A),PolicyDiscrete)
ERROR: MethodError: no method matching CubicSplineInterpolation(::Tuple{Array{Float64,2},Array{Float64,2}}, ::Array{Float64,2})
Closest candidates are:
CubicSplineInterpolation(::Tuple{Vararg{AbstractRange,N}}, ::AbstractArray{T,N}; bc, extrapolation_bc) where {N, T} at C:\Users\janze.julia\packages\Interpolations\jXoPW\src\convenience-constructors.jl:19
Stacktrace:
[1] top-level scope at none:0
My imput arguments are following:
julia> typeof(GridK)
Array{Float64,1}
julia> size(GridK)
(1500,)
julia> typeof(A)
Array{Float64,2}
julia> size(A)
(1, 3)
julia> typeof(PolicyDiscrete)
Array{Float64,2}
julia> size(PolicyDiscrete)
(1500, 3)
julia> versioninfo()
Julia Version 1.0.3
Commit 099e826241 (2018-12-18 01:34 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel® Core™ i7-8750H CPU @ 2.20GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Environment:
JULIA_EDITOR = “C:\Users\janze\AppData\Local\atom\app-1.38.2\atom.exe” -a
JULIA_NUM_THREADS = 6
Any advice/guidance will be wellcomed!
Best
Jan Žemlička