data manipulation: increase standard deviation

51 visualizaciones (últimos 30 días)
Jon Jae
Jon Jae el 10 de Abr. de 2020
Comentada: Jon Jae el 13 de Abr. de 2020
Hello,
how do I increase the volatility (standard deviation) of a dataset (e.g., hourly price data)?
This is how this could look like.

Respuestas (1)

Rajani Mishra
Rajani Mishra el 13 de Abr. de 2020
Standard Deviation gives an estimate of the size of a typical deviation from the mean. Low Standard deviation means data points are closer to mean, Whereas High Standard deviation indicates higher deviation.
For increasing standard deviation, you can try below steps:
  1. Compute mean of the data set
  2. Increase Values greater than the mean
  3. Decrease Values lesser than the mean
This would increase the deviation of all points from the mean and hence increase the Standard Deviation.
  1 comentario
Jon Jae
Jon Jae el 13 de Abr. de 2020
Thank you, Rajani! This is an interesting appraoch and it is indeed how I created the graphic above.
See executable code below. My problem with this appraoch is, that I don't get an stable / predictable overall increases of the std deviation. E.g., with the code below I have a increase/decrease for value x of 0.1 --> this leads to an overall increase of the std. dev of 0.85%. For a different data set this increase might be totaly different.
The goal would be a function that I can feed the dataset into, that will increase/decrease each datapoint to receive an overall increase/decrease of the std dev.
This is part of a sensitivity analysis, I am investigatinghow a hydro storage algroithm reacts to different price volatilities.
A = [32050,31860,31780,31510,31990,33020,34990,37930,40240,40080,39540,37930,34940,34800,34420,34940,35630,43150,49050,39390,35810,34920,33570,32960,34670,33970,33970,33610,33620,33860,34590,35490,36900,40660,44600,42400,40640,38010,35970,35870]
% manipulation setting
percVariation = 0.1
increase = 1 + variation
decrease = 1 - variation
%increasing/decreasing values
for ii = 1:numel(A)
if A(ii) >= mean(A) %no particular reason 'greater equals', negelectable in larger data set
B(ii) = A(ii) * increase;
else A(ii) < mean(A)
B(ii) = A(ii) * decrease;
end
end
% calculating increase/decrease
change = ((std(B) - std(A)) / std(A))
plot(A)
hold on
plot(B)
legend('A', 'manipulated')

Iniciar sesión para comentar.

Categorías

Más información sobre Stochastic Differential Equation (SDE) Models en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by