I want to determine if the data(tmin) are Gaussian distributed or not by using Montecarlo simulation with skewness.

1 次查看(过去 30 天)
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??

回答(1 个)

Ayush
Ayush 2023-9-6
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!

产品

Community Treasure Hunt

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

Start Hunting!

Translated by