Skip to content

lesson4

Alfonso Veropalumbo edited this page Mar 11, 2024 · 1 revision

Interpolation - 11/03/2024

This lecture will introduce concepts of interpolation and A&C applications.

Description

In this lesson we discuss strenghts and drawbacks of the most common interpolation techniques, applying to cases of interst for us. In particular, we will describe:

  • Nearest neighbours,
  • Polynomial fitting
  • Piecewise interpolation (Linear, polynomials, splines)
  • Multidimensional Interpolation
  • Advanced techniques (Regression techniques)

Exercises

First exercise

  • Create a linear interpolator for the distance modulus, for a fixed cosmology, as a function of z.
  • Compute residuals and check against theoretical error
  • Test different interpolation techniques

Second exercise

  • In pyACC, create a "wrapper" for the scipy interpolate functions
  • Repeat exercise #1 with this new function

Third exercise

  • Expand Ex #1 for the distance modulus $\mu$, interpolating on three parameters, $z$, $\Omega_M$, $H_0$.
  • What is the major change here? What interpolation techniques could be used?
  • Hint: do you really need a 3D interpolator?

Bonus exercise

Code profiling: how much does it take for your code to execute and integral? and an interpolation? Measure time spent by your code when computing $D_c(z)$ via integration or interpolation.

Slides

Link to slides

Video

Resources

Clone this wiki locally