I want to determine if the data(tmin) are Gaussian distributed or not by using Montecarlo simulation with skewness.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
nn=143;
for n=1:1000;
load('ERA_Livneh_Birmingham.mat')
ss(n)=std(tmin);
m(n)=mean(tmin);
med(n)=median(tmin);
nu(n)=numel(tmin)
skew_FP(n) = sum((r-m(n)).^3)/(length(n)-1)/ss(n).^3
end
hist(skew_FP())
xlabel('Skew_FP()')
ylabel('Frequency')
In this case, what do I have to change for doing montecarlo simulation by using skewness??
2 Kommentare
John D'Errico
am 29 Okt. 2022
How will that determine if your data happen to follow a normal distribution?
Antworten (1)
Ayush
am 6 Sep. 2023
Hey Chris,
I understand that you want to know the changes required in your code for doing Montecarlo simulation using skewness.
If you intend to perform a "Monte Carlo simulation" to assess the uncertainty of the skewness calculation, you will need to introduce random variations in the data or model parameters. This could involve generating random samples or perturbing the existing data in a meaningful way to simulate different scenarios. I have provided a sample code below for the same:
nn = 143;
skewness_MC = zeros(1, nn);
for n = 1:nn
load('ERA_Livneh_Birmingham.mat')
% Introduce random variations or perturbations to the data
perturbed_tmin = tmin + randn(size(tmin)); % Example: Adding Gaussian noise
ss(n) = std(perturbed_tmin);
m(n) = mean(perturbed_tmin);
med(n) = median(perturbed_tmin);
nu(n) = numel(perturbed_tmin);
skewness_MC(n) = sum((perturbed_tmin - m(n)).^3) / (length(perturbed_tmin) - 1) / ss(n).^3;
end
hist(skewness_MC)
xlabel('Skewness_MC')
ylabel('Frequency')
Hope this helps!
0 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!