Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to calculate values with the fitted curve? #34

Open
reox opened this issue Mar 26, 2024 · 0 comments
Open

How to calculate values with the fitted curve? #34

reox opened this issue Mar 26, 2024 · 0 comments

Comments

@reox
Copy link

reox commented Mar 26, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant