Sometime you want to know the RMS of only some port of your signal or some part of your power spectral density.
In that case what you may is to start from the highest frequency bin, and add the power in each bin as you go. T his quantity is then the cumulative RMS of the spectrum. At each frequency point, f, the cumulative RMS is the RMS of the signal from the highest frequency to f.
def myrms(f, y_of_f):
df = np.diff(f)
df = np.append(df[0],df)