I am trying to make an approximation of a noisy data with scipy, but it seems it doesn't work at this specific function. Applying the smoothing factor "s" does not change anything. I end up with interpolation instead of approximation. Oddly it approximates the same type of function (x^-2) normaly. How can it be changed ?
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import UnivariateSpline as unis
h = 11
data = {'d':12, 'f':0.22, 'h':11, 'G':250}
HA = np.linspace(data['d']*data['f'], h, 50)
FA = (data['G'] * ((np.arcsin((data['d']*data['f'])/(2*HA)))))+np.random.normal(scale=1, size=len(HA))
app = unis(HA, FA, s=2)
HA2 = np.linspace(np.min(HA), np.max(HA), 1000)
plt.plot(HA, FA, 'ro')
plt.plot(HA2, app(HA2))