Multivariate weibull cdf using mvncdf

5 次查看(过去 30 天)
Hello,
I'm tryin to determine the system reliability using the multivariate cumulative distribution function with Weibull. I know how to do it with normal distribution (mvncdf) but I don't understand how I can transform my Weibull distribution and finally use mvncdf. I have seen example but impossible to do the same thing, so I ask for a little help.
A small precision, I don't know k and lambda for Weibull, I estimate the parameters with d.
Here is my code where I want to incorporate the multivariate function
function Rs = parameterfun(d,X,mu_L1,sig_L1,mu_L2,sig_L2,mu_L3,sig_L3,R1,R2,R3,w1,w2,w3)
%
%Weibull parameters estimation
[k(1),lambda(1)] = wblfit(X(:,1));
[k(2),lambda(2)] = wblfit(X(:,2));
[k(3),lambda(3)] = wblfit(X(:,3));
%
%Multivariate Weibull cdf
p_univariate = mvwblcdf(d, lambda, k);
%
mu_Sr1 = w1*mu_L1+wblinv(R1)*sqrt((w1*sig_L1)^2+(d(1))^2);
mu_Sr2 = w2*mu_L2+wblinv(R2)*sqrt((w2*sig_L2)^2+(d(2))^2);
mu_Sr3 = w3*mu_L3+wblinv(R3)*sqrt((w3*sig_L3)^2+(d(3))^2);
%
Y1_mean = w1*mu_L1-mu_Sr1;
Y2_mean = w2*mu_L2-mu_Sr2;
Y3_mean = w3*mu_L3-mu_Sr3;
%
Y1_std = sqrt((d(1))^2+(w1*sig_L1)^2);
Y2_std = sqrt((d(2))^2+(w2*sig_L2)^2);
Y3_std = sqrt((d(3))^2+(w3*sig_L3)^2);
%
Y_mean = [Y1_mean Y2_mean Y3_mean];
Y_std = [(Y1_std^2) (w1*w2*sig_L1*sig_L2) (w1*w3*sig_L1*sig_L3); (w2*w1*sig_L2*sig_L1) (Y2_std)^2 (w2*w3*sig_L2*sig_L3); (w3*w1*sig_L3*sig_L1) (w3*w2*sig_L3*sig_L2) (Y3_std)^2];
y = ones(size(d));
%
Rs = 1-mvncdf(y,Y_mean,Y_std).*prod(p_univariate);
%pf = 1-Rs;
%
end
Thank you in advance

回答(1 个)

albara
albara 2023-4-27
To use the multivariate cumulative distribution function with Weibull, you will need to first transform your Weibull distribution to a normal distribution using the Inverse Transform Sampling method.
The Inverse Transform Sampling method uses a random variable uniformly distributed on [0, 1] to generate random variables from any distribution, in this case, the Weibull distribution. To perform this transformation, you can use the icdf (inverse cumulative distribution function) of the Weibull distribution.
Here's an updated version of your code incorporating the transformation to a normal distribution:
function Rs = parameterfun(d,X,mu_L1,sig_L1,mu_L2,sig_L2,mu_L3,sig_L3,R1,R2,R3,w1,w2,w3)
%
%Weibull parameters estimation
[k(1),lambda(1)] = wblfit(X(:,1));
[k(2),lambda(2)] = wblfit(X(:,2));
[k(3),lambda(3)] = wblfit(X(:,3));
%
%Transform Weibull to Normal using Inverse Transform Sampling
Z = norminv(wblcdf(X, lambda, k));
%
%Estimate the mean and covariance matrix for the transformed data
Z_mean = mean(Z);
Z_cov = cov(Z);
%
%Multivariate Normal cdf
p_univariate = mvncdf(Z, Z_mean, Z_cov);
%
mu_Sr1 = w1*mu_L1+wblinv(R1)*sqrt((w1*sig_L1)^2+(d(1))^2);
mu_Sr2 = w2*mu_L2+wblinv(R2)*sqrt((w2*sig_L2)^2+(d(2))^2);
mu_Sr3 = w3*mu_L3+wblinv(R3)*sqrt((w3*sig_L3)^2+(d(3))^2);
%
Y1_mean = w1*mu_L1-mu_Sr1;
Y2_mean = w2*mu_L2-mu_Sr2;
Y3_mean = w3*mu_L3-mu_Sr3;
%
Y1_std = sqrt((d(1))^2+(w1*sig_L1)^2);
Y2_std = sqrt((d(2))^2+(w2*sig_L2)^2);
Y3_std = sqrt((d(3))^2+(w3*sig_L3)^2);
%
Y_mean = [Y1_mean Y2_mean Y3_mean];
Y_std = [(Y1_std^2) (w1*w2*sig_L1*sig_L2) (w1*w3*sig_L1*sig_L3); (w2*w1*sig_L2*sig_L1) (Y2_std)^2 (w2*w3*sig_L2*sig_L3); (w3*w1*sig_L3*sig_L1) (w3*w2*sig_L3*sig_L2) (Y3_std)^2];
y = ones(size(d));
%
Rs = 1-mvncdf(y,Y_mean,Y_std).*prod(p_univariate);
%pf = 1-Rs;
%
end
In this code, I've added the transformation of the Weibull distribution to a normal distribution using the Inverse Transform Sampling method. The rest of the code remains the same. The multivariate normal CDF is then calculated using the transformed data.
Important: There may be some mistakes in this answer Experts can tell if there are any mistakes

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by