import%20marimo%0A%0A__generated_with%20%3D%20%220.18.4%22%0Aapp%20%3D%20marimo.App()%0A%0Awith%20app.setup(hide_code%3DTrue)%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20matplotlib%20as%20mpl%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20import%20seaborn%20as%20sns%0A%0A%20%20%20%20sns.set(font_scale%3D1.5)%0A%20%20%20%20sns.set_style(%22whitegrid%22)%0A%20%20%20%20sns.set_palette(%22deep%22)%0A%20%20%20%20mpl.rc(%22figure%22%2C%20figsize%3D(9%2C%205)%2C%20dpi%3D100)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Gaussian%20Process%20Regression%20with%20ChebPy%0A%0A%20%20%20%20This%20notebook%20demonstrates%20the%20%60%60gpr%60%60%20function%20in%20ChebPy%2C%20which%20performs%0A%20%20%20%20**Gaussian%20process%20regression**%20and%20returns%20the%20posterior%20mean%2C%20variance%2C%0A%20%20%20%20and%20(optionally)%20random%20samples%20as%20Chebfun%20objects.%0A%0A%20%20%20%20Because%20the%20outputs%20are%20Chebfuns%2C%20you%20can%20immediately%20differentiate%2C%0A%20%20%20%20integrate%2C%20find%20roots%2C%20and%20compose%20them%20with%20the%20full%20ChebPy%20toolkit.%0A%0A%20%20%20%20%3E%20C.%20E.%20Rasmussen%20%26%20C.%20K.%20I.%20Williams%2C%20*Gaussian%20Processes%20for%20Machine%0A%20%20%20%20%3E%20Learning*%2C%20MIT%20Press%2C%202006.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20from%20chebpy%20import%20gpr%0A%20%20%20%20return%20(gpr%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%201.%20Basic%20usage%0A%0A%20%20%20%20We%20start%20by%20sampling%20a%20smooth%20function%20%24f(x)%20%3D%20%5Csin(e%5Ex)%24%20at%20a%20handful%0A%20%20%20%20of%20random%20points%20on%20%24%5B-2%2C%202%5D%24%20and%20then%20asking%20%60%60gpr%60%60%20to%20recover%20it.%0A%0A%20%20%20%20The%20squared%20exponential%20kernel%0A%0A%20%20%20%20%24%24%0A%20%20%20%20k(x%2C%20x')%20%3D%20%5Csigma%5E2%20%5Cexp%5C!%5CBigl(-%5Cfrac%7B(x-x')%5E2%7D%7B2%5Cell%5E2%7D%5CBigr)%0A%20%20%20%20%24%24%0A%0A%20%20%20%20is%20used%20by%20default.%20The%20signal%20variance%20%24%5Csigma%24%20defaults%20to%0A%20%20%20%20%24%5Cmax%7Cy%7C%24%20and%20the%20length%20scale%20%24%5Cell%24%20is%20selected%20automatically%20by%0A%20%20%20%20maximising%20the%20log%20marginal%20likelihood.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20rng%20%3D%20np.random.default_rng(1)%0A%20%20%20%20n%20%3D%2010%0A%20%20%20%20x_obs%20%3D%20np.sort(-2%20%2B%204%20*%20rng.random(n))%0A%20%20%20%20y_obs%20%3D%20np.sin(np.exp(x_obs))%0A%20%20%20%20return%20rng%2C%20x_obs%2C%20y_obs%0A%0A%0A%40app.cell%0Adef%20_(gpr%2C%20x_obs%2C%20y_obs)%3A%0A%20%20%20%20f_mean%2C%20f_var%20%3D%20gpr(x_obs%2C%20y_obs%2C%20domain%3D%5B-2%2C%202%5D)%0A%20%20%20%20f_mean%0A%20%20%20%20return%20f_mean%2C%20f_var%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20The%20posterior%20mean%20is%20a%20Chebfun%20%E2%80%94%20let's%20plot%20it%20together%20with%20the%20data%20and%0A%20%20%20%20a%20%C2%B12%20standard-deviation%20band%20computed%20from%20the%20variance%20Chebfun.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(f_mean%2C%20f_var%2C%20x_obs%2C%20y_obs)%3A%0A%20%20%20%20_tt%20%3D%20np.linspace(-2%2C%202%2C%20500)%0A%20%20%20%20_mu%20%3D%20f_mean(_tt)%0A%20%20%20%20_sd%20%3D%20np.sqrt(np.maximum(f_var(_tt)%2C%200.0))%0A%0A%20%20%20%20_fig%2C%20(_ax1%2C%20_ax2)%20%3D%20plt.subplots(2%2C%201%2C%20figsize%3D(9%2C%206)%2C%20height_ratios%3D%5B2%2C%201%5D%2C%20sharex%3DTrue)%0A%0A%20%20%20%20_ax1.fill_between(_tt%2C%20_mu%20-%202%20*%20_sd%2C%20_mu%20%2B%202%20*%20_sd%2C%20alpha%3D0.25%2C%20label%3D%22%C2%B12%CF%83%22)%0A%20%20%20%20_ax1.plot(_tt%2C%20_mu%2C%20linewidth%3D2%2C%20label%3D%22mean%22)%0A%20%20%20%20_ax1.plot(x_obs%2C%20y_obs%2C%20%22ok%22%2C%20markersize%3D8)%0A%20%20%20%20_ax1.set_ylabel(%22y%22)%0A%20%20%20%20_ax1.legend()%0A%20%20%20%20_ax1.set_title(%22GPR%20%E2%80%94%20noiseless%20observations%22)%0A%0A%20%20%20%20_ax2.fill_between(_tt%2C%20_sd**2%2C%20alpha%3D0.35%2C%20color%3D%22C1%22)%0A%20%20%20%20_ax2.plot(_tt%2C%20_sd**2%2C%20linewidth%3D1.5%2C%20color%3D%22C1%22)%0A%20%20%20%20_ax2.set_xlabel(%22x%22)%0A%20%20%20%20_ax2.set_ylabel(%22variance%22)%0A%0A%20%20%20%20plt.tight_layout()%0A%20%20%20%20plt.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%202.%20Posterior%20samples%0A%0A%20%20%20%20Pass%20%60%60n_samples%60%60%20to%20draw%20independent%20realisations%20from%20the%20posterior.%0A%20%20%20%20Each%20sample%20is%20a%20Chebfun%20column%20in%20a%20%60%60Quasimatrix%60%60.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(gpr%2C%20x_obs%2C%20y_obs)%3A%0A%20%20%20%20f2_mean%2C%20f2_var%2C%20samples%20%3D%20gpr(x_obs%2C%20y_obs%2C%20domain%3D%5B-2%2C%202%5D%2C%20n_samples%3D10)%0A%20%20%20%20samples%0A%20%20%20%20return%20f2_mean%2C%20f2_var%2C%20samples%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(f2_mean%2C%20f2_var%2C%20samples%2C%20x_obs%2C%20y_obs)%3A%0A%20%20%20%20_tt%20%3D%20np.linspace(-2%2C%202%2C%20500)%0A%20%20%20%20_mu%20%3D%20f2_mean(_tt)%0A%20%20%20%20_sd%20%3D%20np.sqrt(np.maximum(f2_var(_tt)%2C%200.0))%0A%0A%20%20%20%20_fig%2C%20_ax%20%3D%20plt.subplots()%0A%20%20%20%20_ax.fill_between(_tt%2C%20_mu%20-%202%20*%20_sd%2C%20_mu%20%2B%202%20*%20_sd%2C%20alpha%3D0.15%2C%20color%3D%22C0%22)%0A%20%20%20%20for%20_k%20in%20range(samples.shape%5B1%5D)%3A%0A%20%20%20%20%20%20%20%20_s%20%3D%20samples%5B%3A%2C%20_k%5D%0A%20%20%20%20%20%20%20%20_ax.plot(_tt%2C%20_s(_tt)%2C%20color%3D%220.65%22%2C%20linewidth%3D0.8)%0A%20%20%20%20_ax.plot(_tt%2C%20_mu%2C%20linewidth%3D2%2C%20label%3D%22posterior%20mean%22)%0A%20%20%20%20_ax.plot(x_obs%2C%20y_obs%2C%20%22ok%22%2C%20markersize%3D8%2C%20label%3D%22observations%22)%0A%20%20%20%20_ax.legend()%0A%20%20%20%20_ax.set_title(%22GPR%20%E2%80%94%20ten%20posterior%20samples%22)%0A%20%20%20%20plt.tight_layout()%0A%20%20%20%20plt.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%203.%20Noisy%20observations%0A%0A%20%20%20%20Real%20data%20is%20rarely%20exact.%20The%20%60%60noise%60%60%20parameter%20specifies%20the%20standard%0A%20%20%20%20deviation%20%24%5Csigma_y%24%20of%20i.i.d.%20Gaussian%20observation%20noise.%20The%20kernel%0A%20%20%20%20is%20augmented%20on%20the%20diagonal%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20k'(x%2C%20x')%20%3D%20k(x%2C%20x')%20%2B%20%5Csigma_y%5E2%5C%2C%5Cdelta_%7Bxx'%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20With%20noise%2C%20the%20posterior%20mean%20**smooths**%20the%20data%20rather%20than%0A%20%20%20%20interpolating%20it%2C%20and%20the%20variance%20never%20reaches%20zero.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(gpr%2C%20rng%2C%20x_obs%2C%20y_obs)%3A%0A%20%20%20%20y_noisy%20%3D%20y_obs%20%2B%200.15%20*%20rng.standard_normal(len(y_obs))%0A%20%20%20%20fn_mean%2C%20fn_var%20%3D%20gpr(x_obs%2C%20y_noisy%2C%20domain%3D%5B-2%2C%202%5D%2C%20noise%3D0.15)%0A%20%20%20%20return%20fn_mean%2C%20fn_var%2C%20y_noisy%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(fn_mean%2C%20fn_var%2C%20x_obs%2C%20y_noisy)%3A%0A%20%20%20%20_tt%20%3D%20np.linspace(-2%2C%202%2C%20500)%0A%20%20%20%20_mu%20%3D%20fn_mean(_tt)%0A%20%20%20%20_sd%20%3D%20np.sqrt(np.maximum(fn_var(_tt)%2C%200.0))%0A%0A%20%20%20%20_fig%2C%20_ax%20%3D%20plt.subplots()%0A%20%20%20%20_ax.fill_between(_tt%2C%20_mu%20-%202%20*%20_sd%2C%20_mu%20%2B%202%20*%20_sd%2C%20alpha%3D0.25%2C%20label%3D%22%C2%B12%CF%83%22)%0A%20%20%20%20_ax.plot(_tt%2C%20_mu%2C%20linewidth%3D2%2C%20label%3D%22posterior%20mean%22)%0A%20%20%20%20_ax.plot(x_obs%2C%20y_noisy%2C%20%22ok%22%2C%20markersize%3D8%2C%20label%3D%22noisy%20data%22)%0A%20%20%20%20_ax.legend()%0A%20%20%20%20_ax.set_title(%22GPR%20%E2%80%94%20noisy%20observations%20(%CF%83_y%20%3D%200.15)%22)%0A%20%20%20%20plt.tight_layout()%0A%20%20%20%20plt.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%204.%20Chebfun%20calculus%20on%20the%20GP%20output%0A%0A%20%20%20%20Because%20the%20posterior%20mean%20is%20a%20Chebfun%2C%20all%20standard%20operations%20are%0A%20%20%20%20available.%20Here%20we%20differentiate%20the%20mean%2C%20find%20its%20roots%20(zero%0A%20%20%20%20crossings%20of%20the%20derivative%20%3D%20local%20extrema%20of%20the%20mean)%2C%20and%20integrate.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(f_mean)%3A%0A%20%20%20%20df%20%3D%20f_mean.diff()%0A%20%20%20%20df%0A%20%20%20%20return%20(df%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(df%2C%20f_mean)%3A%0A%20%20%20%20extrema%20%3D%20df.roots()%0A%0A%20%20%20%20_fig%2C%20(_ax1%2C%20_ax2)%20%3D%20plt.subplots(1%2C%202%2C%20figsize%3D(14%2C%205))%0A%0A%20%20%20%20%23%20left%3A%20mean%20with%20extrema%20marked%0A%20%20%20%20_tt%20%3D%20np.linspace(-2%2C%202%2C%20500)%0A%20%20%20%20_ax1.plot(_tt%2C%20f_mean(_tt)%2C%20linewidth%3D2)%0A%20%20%20%20_ax1.plot(extrema%2C%20f_mean(extrema)%2C%20%22or%22%2C%20markersize%3D8)%0A%20%20%20%20_ax1.set_title(%22posterior%20mean%20%26%20local%20extrema%22)%0A%20%20%20%20_ax1.set_xlabel(%22x%22)%0A%0A%20%20%20%20%23%20right%3A%20derivative%0A%20%20%20%20_ax2.plot(_tt%2C%20df(_tt)%2C%20linewidth%3D2%2C%20color%3D%22C1%22)%0A%20%20%20%20_ax2.axhline(0%2C%20color%3D%22k%22%2C%20linewidth%3D0.5)%0A%20%20%20%20_ax2.set_title(%22derivative%20of%20posterior%20mean%22)%0A%20%20%20%20_ax2.set_xlabel(%22x%22)%0A%0A%20%20%20%20plt.tight_layout()%0A%20%20%20%20plt.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(f_mean)%3A%0A%20%20%20%20integral%20%3D%20f_mean.sum()%0A%20%20%20%20return%20(integral%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(f_mean%2C%20integral)%3A%0A%20%20%20%20mo.md(rf%22%22%22%0A%20%20%20%20The%20definite%20integral%20of%20the%20posterior%20mean%20over%20%24%5B-2%2C%202%5D%24%20is%0A%0A%20%20%20%20%24%24%0A%20%20%20%20%5Cint_%7B%7B-2%7D%7D%5E%7B%7B2%7D%7D%20%5Cmu(x)%5C%2Cdx%20%5Capprox%20%7Bfloat(integral)%3A.6f%7D%0A%20%20%20%20%24%24%0A%0A%20%20%20%20and%20the%20function%20is%20represented%20by%20a%20Chebfun%20of%20length%20**%7Blen(f_mean)%7D**.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%205.%20Periodic%20kernel%0A%0A%20%20%20%20For%20data%20from%20a%20periodic%20process%2C%20pass%20%60%60trig%3DTrue%60%60.%20This%20uses%20the%0A%20%20%20%20periodic%20squared%20exponential%20kernel%3A%0A%0A%20%20%20%20%24%24%0A%20%20%20%20k(x%2Cx')%20%3D%20%5Csigma%5E2%20%5Cexp%5C!%5CBigl(-%5Cfrac%7B2%7D%7B%5Cell%5E2%7D%5Csin%5E2%5C!%5CBigl(%5Cfrac%7B%5Cpi(x-x')%7D%7BP%7D%5CBigr)%5CBigr)%0A%20%20%20%20%24%24%0A%0A%20%20%20%20where%20%24P%24%20is%20the%20period%20(the%20length%20of%20the%20domain).%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(gpr)%3A%0A%20%20%20%20x_per%20%3D%20np.linspace(0%2C%202%20*%20np.pi%2C%2015%2C%20endpoint%3DFalse)%0A%20%20%20%20y_per%20%3D%20np.sin(x_per)%20%2B%200.3%20*%20np.cos(3%20*%20x_per)%0A%20%20%20%20fp_mean%2C%20fp_var%20%3D%20gpr(x_per%2C%20y_per%2C%20domain%3D%5B0%2C%202%20*%20np.pi%5D%2C%20trig%3DTrue)%0A%20%20%20%20return%20fp_mean%2C%20fp_var%2C%20x_per%2C%20y_per%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(fp_mean%2C%20fp_var%2C%20x_per%2C%20y_per)%3A%0A%20%20%20%20_tt%20%3D%20np.linspace(0%2C%202%20*%20np.pi%2C%20500)%0A%20%20%20%20_mu%20%3D%20fp_mean(_tt)%0A%20%20%20%20_sd%20%3D%20np.sqrt(np.maximum(fp_var(_tt)%2C%200.0))%0A%0A%20%20%20%20_fig%2C%20_ax%20%3D%20plt.subplots()%0A%20%20%20%20_ax.fill_between(_tt%2C%20_mu%20-%202%20*%20_sd%2C%20_mu%20%2B%202%20*%20_sd%2C%20alpha%3D0.25)%0A%20%20%20%20_ax.plot(_tt%2C%20_mu%2C%20linewidth%3D2%2C%20label%3D%22periodic%20GP%20mean%22)%0A%20%20%20%20_ax.plot(x_per%2C%20y_per%2C%20%22ok%22%2C%20markersize%3D8%2C%20label%3D%22data%22)%0A%20%20%20%20_ax.legend()%0A%20%20%20%20_ax.set_title(%22GPR%20%E2%80%94%20periodic%20kernel%22)%0A%20%20%20%20_ax.set_xlabel(%22x%22)%0A%20%20%20%20plt.tight_layout()%0A%20%20%20%20plt.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%206.%20Effect%20of%20the%20length%20scale%0A%0A%20%20%20%20The%20length%20scale%20%24%5Cell%24%20controls%20how%20far%20correlations%20extend.%20A%20small%0A%20%20%20%20%24%5Cell%24%20fits%20local%20wiggles%3B%20a%20large%20%24%5Cell%24%20produces%20a%20smoother%20fit.%0A%20%20%20%20Here%20we%20compare%20three%20hand-picked%20values%20against%20the%20automatically%0A%20%20%20%20selected%20one.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(gpr%2C%20x_obs%2C%20y_obs)%3A%0A%20%20%20%20ls_values%20%3D%20%5B0.2%2C%200.5%2C%202.0%5D%0A%20%20%20%20gp_by_ls%20%3D%20%7B%7D%0A%20%20%20%20for%20_ls%20in%20ls_values%3A%0A%20%20%20%20%20%20%20%20_fm%2C%20_fv%20%3D%20gpr(x_obs%2C%20y_obs%2C%20domain%3D%5B-2%2C%202%5D%2C%20length_scale%3D_ls)%0A%20%20%20%20%20%20%20%20gp_by_ls%5B_ls%5D%20%3D%20_fm%0A%20%20%20%20return%20gp_by_ls%2C%20ls_values%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(f_mean%2C%20gp_by_ls%2C%20ls_values%2C%20x_obs%2C%20y_obs)%3A%0A%20%20%20%20_tt%20%3D%20np.linspace(-2%2C%202%2C%20500)%0A%0A%20%20%20%20_fig%2C%20_axes%20%3D%20plt.subplots(1%2C%203%2C%20figsize%3D(16%2C%204)%2C%20sharey%3DTrue)%0A%20%20%20%20for%20_ax%2C%20_ls%20in%20zip(_axes%2C%20ls_values%2C%20strict%3DFalse)%3A%0A%20%20%20%20%20%20%20%20_ax.plot(_tt%2C%20gp_by_ls%5B_ls%5D(_tt)%2C%20linewidth%3D2%2C%20label%3Df%22%E2%84%93%20%3D%20%7B_ls%7D%22)%0A%20%20%20%20%20%20%20%20_ax.plot(_tt%2C%20f_mean(_tt)%2C%20%22--%22%2C%20linewidth%3D1%2C%20color%3D%220.5%22%2C%20label%3D%22auto%20%E2%84%93%22)%0A%20%20%20%20%20%20%20%20_ax.plot(x_obs%2C%20y_obs%2C%20%22ok%22%2C%20markersize%3D6)%0A%20%20%20%20%20%20%20%20_ax.set_title(f%22%E2%84%93%20%3D%20%7B_ls%7D%22)%0A%20%20%20%20%20%20%20%20_ax.legend(fontsize%3D10)%0A%20%20%20%20_axes%5B0%5D.set_ylabel(%22y%22)%0A%20%20%20%20plt.tight_layout()%0A%20%20%20%20plt.show()%0A%20%20%20%20return%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_()%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%23%20Summary%0A%0A%20%20%20%20%7C%20Parameter%20%7C%20Meaning%20%7C%20Default%20%7C%0A%20%20%20%20%7C---%7C---%7C---%7C%0A%20%20%20%20%7C%20%60%60sigma%60%60%20%7C%20Signal%20variance%20%24%5Csigma%24%20%7C%20%24%5Cmax%7Cy%7C%24%20%7C%0A%20%20%20%20%7C%20%60%60length_scale%60%60%20%7C%20Length%20scale%20%24%5Cell%24%20%7C%20Maximise%20log%20marginal%20likelihood%20%7C%0A%20%20%20%20%7C%20%60%60noise%60%60%20%7C%20Observation%20noise%20%24%5Csigma_y%24%20%7C%20%240%24%20(exact%20interpolation)%20%7C%0A%20%20%20%20%7C%20%60%60trig%60%60%20%7C%20Periodic%20kernel%20%7C%20%60%60False%60%60%20%7C%0A%20%20%20%20%7C%20%60%60n_samples%60%60%20%7C%20Posterior%20draws%20%7C%20%240%24%20%7C%0A%0A%20%20%20%20All%20outputs%20are%20Chebfun%20objects%20%E2%80%94%20differentiate%2C%20integrate%2C%20find%0A%20%20%20%20roots%2C%20evaluate%2C%20and%20compose%20them%20freely.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
abe64807d5fd3ec7bdc3a2fc99ff933a