Exemple #1
0
def eval_s(itp: object, exo_grid: EmptyGrid, endo_grid: CartesianGrid,
           interp_type: Cubic, s: object):
    from interpolation.splines import eval_cubic
    assert (s.ndim == 2)
    coeffs = itp.coefficients
    gg = endo_grid.__numba_repr__()
    return eval_cubic(gg, coeffs, s)
def eval_is(itp, exo_grid: UnstructuredGrid, endo_grid: CartesianGrid, interp_type: Cubic, i, s):

    from interpolation.splines import eval_cubic
    assert(s.ndim==2)

    grid = endo_grid # one single CartesianGrid
    coeffs = itp.coefficients[i]
    d = len(grid.n)
    gg = tuple( [(grid.min[i], grid.max[i], grid.n[i]) for i in range(d)] )

    return eval_cubic(gg, coeffs, s)
def eval_ms(itp, exo_grid: CartesianGrid, endo_grid: CartesianGrid, interp_type: Cubic, m, s):

    from interpolation.splines import eval_cubic

    assert(m.ndim==s.ndim==2)

    grid = cat_grids(exo_grid, endo_grid) # one single CartesianGrid
    coeffs = itp.coefficients
    d = len(grid.n)
    gg = tuple( [(grid.min[i], grid.max[i], grid.n[i]) for i in range(d)] )

    x = np.concatenate([m, s], axis=1)

    return eval_cubic(gg, coeffs, x)
Exemple #4
0
def eval_ms(itp: object, exo_grid: CartesianGrid, endo_grid: CartesianGrid, interp_type: Cubic, m: object, s: object):

    from interpolation.splines import eval_cubic

    assert(m.ndim==s.ndim==2)

    grid = exo_grid + endo_grid # one single CartesianGrid
    coeffs = itp.coefficients

    gg = grid.__numba_repr__()

    x = np.concatenate([m, s], axis=1)

    return eval_cubic(gg, coeffs, x)
Exemple #5
0
def eval_is(
    itp: object,
    exo_grid: UnstructuredGrid,
    endo_grid: CartesianGrid,
    interp_type: Cubic,
    i: object,
    s: object,
):

    from interpolation.splines import eval_cubic

    assert s.ndim == 2
    coeffs = itp.coefficients[i]
    gg = endo_grid.__numba_repr__()
    return eval_cubic(gg, coeffs, s)