data manipulation: increase standard deviation

Hello,
how do I increase the volatility (standard deviation) of a dataset (e.g., hourly price data)?
This is how this could look like.

답변 (1개)

Rajani Mishra
Rajani Mishra 2020년 4월 13일

0 개 추천

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

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')

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

제품

릴리스

R2019b

질문:

2020년 4월 10일

댓글:

2020년 4월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by