Jacob-Stevens-Haas / gen-experiments

Pysindy experiments. Composable and extensible
MIT License
1 stars 2 forks source link

Measurement Noise Spectrum for PDEs #31

Closed yb6599 closed 1 month ago

yb6599 commented 1 month ago

Hey @Jacob-Stevens-Haas, for the measurement noise spectrum, I am using

fft_values = np.abs(scipy.fft.rfft(x_train, axis=-2)) / np.sqrt(x_train.shape[-2])

where fft_values is of shape (256, 51, 1). I then average over the spatial points and plot it with

plt.loglog(fft_values.mean(axis=0))

to get a plot which looks like this

output

Is this the correct implementation? Should the argument in scipy.fft.rfft() be x_train, which is the noisy data, or should it be x_train - x_true, which would represent just the noise? The plot for x_train - x_true looks like

output2