QuantEcon / lecture-julia.myst

Lecture source for "Quantitative Economics with Julia"
https://julia.quantecon.org/intro.html
54 stars 44 forks source link

Add back in ApproxFun example without dependencies #200

Closed jlperla closed 1 week ago

jlperla commented 1 year ago

In the iterative_methods_sparsity section on orthogonal polynomials, I removed the following code, which we can add back in at some point - hopefully compartmentalized.

    using ApproxFun
    N = 10000
    S = Chebyshev(-1.0..1.0)  # form Chebyshev basis
    x = points(S, N)  # chooses Chebyshev nodes
    y = g.(x)
    g_approx = Fun(S,ApproxFun.transform(S,y))  # transform fits the polynomial
    @show norm(g_approx.(x) - g.(x), Inf)
    plot(x_display, g_approx.(x_display), label = L"P_{10000}(x)")
    plot!(x_display, g.(x_display), w = 3, label = L"g(x)")
jlperla commented 1 week ago

Too many dependencies.