How to simulate the outage probability using Matlab?

조회 수: 14 (최근 30일)
Deema42
Deema42 2016년 12월 17일
편집: Deema42 2016년 12월 18일
Can any one help me ?? i want to simulate my CDF (or outage) equation and i have never done the simulation before, can anyone send me a sample code on Matlab to learn how to do it?

답변 (1개)

the cyclist
the cyclist 2016년 12월 17일
Does the answer to this question help you?
  댓글 수: 5
Deema42
Deema42 2016년 12월 18일
function [f,F] = EstimateDistribution(X,x) % Checking Input Arguments if nargin<2||isempty(x), x = linspace(-10,10,1000);end if nargin<2||isempty(X) error('Missing Input Arguments: Please specify vector random variables'); end
% Impelementation Starts Here f = zeros(1,length(x)); % Preallocation of memory space F = f; % Preallocation of memory space h = 0.000000001; % Small value closer to zero for evaluating % numerical differentiation.
% Estimating CDF by its definition for m = 1:length(x) p = 0; % True Probability q = 0; % False Probability for n = 1:length(X) if X(n)<=x(m) % Definition of CDF p = p + 1; else q = q + 1; end end F(m) = p/(p + q); % Calulating Probability end
% Estimating PDF by differentiation of CDF for k = 1:length(x) fxph = interp1(x,F,x(k) + h,'spline'); % Interpolating value of F(x+h) fxmh = interp1(x,F,x(k) - h,'spline'); % Interpolating value of F(x-h) f(k) = (fxph - fxmh)/(2*h); % Two-point formula to compute end % Numerical differentiation f = smooth(f);
Deema42
Deema42 2016년 12월 18일
편집: Deema42 2016년 12월 18일
sorry for the delay, these are two codes i found on Mathworks, they are fine, i want to do exactly like this but for a different PDF and CDF, mine is for cascaded Rician random variable, so the pdf is different than a normal rician. how can i modify this code?? if you like, i can send you my PDF and CDF equations.

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

Community Treasure Hunt

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

Start Hunting!

Translated by