Skip to content

How to calculate values with the fitted curve? #34

@reox

Description

@reox

I would like to use the fitted curve to calculate values on it, for example, to calculate RMSE or to predict the y-value for some other given x-values:

import numpy as np
import smoothfit

x0 = np.linspace(-1.0, 1.0, 21)
y0 = 1 / (1 + 25 * x0 ** 2)

basis, coeffs = smoothfit.fit1d(x0, y0, -1.5, 1.5, 1000, degree=1, lmbda=1.0e-6)

# Calculate the fitted value for the given x values
y_fitted = basis.????(x0)
# Calculte the y value for some other x values
y_new = basis.????([1.2, 0.5, 1.333])

There is a method interpolator on the CellBasis object, but I have no idea how that works, as I have to give it some y-values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions