# How can I make an existing time series more volatile?

I have an existing time series that I would like to make more volatile, or more variance.
I would like the highs to be higher and the lows to be lower.
The time series is somewhat stationary and I would like the amplification of the numbers in the series to keep the same slope. In other words, I would like the mean of the series to remain the same and the standard deviation of the series to increase.

Below is my attempt.
I fit a line to it with linear regression. This part works okay. The problem comes when I try to make every number above the regression line higher and every number below it low at a scale. See the picture below for how this code works. It's not giving me a spikey, volatile series I want. It's just dividing the highs and lows further apart.
Sorry, I don't know math notation, and I'm trying to do this in Python, so I'd really appreciate it if you could make your answer legible to a math illiterate like me.

def slope(series):
x = [x for x in range(int(len(series)))]
fit = np.polyfit(x, series, 1)
fit_fn = np.poly1d(fit)
return fit_fn(x)

ss = slope(time_series)

tu = []
w = 0
for n, z in enumerate(time_series):
b = z * 1.3
if ss[n] < z:
r = (z - b)
else:
r = (z + b)
w += r
tu.append(r)


This was my attempt.

This is the original.

What I want is just a time series with more extreme swings. I want everything to scale from the mean trend line.

• Isn't wanting the standard deviation to stay the same while volatility increases contradictory? If you drop the former requirement, what about fitting a linear trend, obtaining the residuals, multiplying them by $c>1$ and adding them back to the fitted trend? That would increase the amplitude of the swings $c$ times. Commented Sep 6, 2021 at 14:53
• Thank you. I fixed the standard deviation part. As for your solution, I'm not sure where to begin with that. Commented Sep 6, 2021 at 16:36
• You can begin by fitting a linear trend to your data. (I do not speak Python, so I cannot suggest a code bit.) Commented Sep 6, 2021 at 16:50
• I appreciate you paying attention to my lonely post. Yes, I fit a line with linear regression in the code. I tried a few combinations of multiplying and subtracting or adding to the time series if the the number was above or below the fit line. It's how I got the first picture in my post. It was the point I got lost at. Commented Sep 6, 2021 at 17:43
• Are you able to extract residuals after fitting a linear trend? If yes, multiply them by $c$ and add to the fitted line. It should do the trick. You do not need to condition on whether the residual is positive or negative; maybe the conditioning is messing things up. Commented Sep 6, 2021 at 18:33

• Stationarise the time series by taking differences or returns: e.g. $$x_{diff}(t) = x(t)-x(t-1)$$.
• Subtract the mean and divide by the standard deviation: $$x_{norm}(t) = \frac{x_{diff}(t)-\mu(x_{diff})}{\sigma(x_{diff})}$$