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