how to calculate the probability

101 views (last 30 days)
ANKUR MAHESHWARI
ANKUR MAHESHWARI on 9 Jun 2020
Answered: Chaman Dewangan on 20 Jun 2021
How to calulate Pr(PWF<Pschedule). Pr is the probability, PWF is an array of power (24x1) say , Pschedule is the scheduled power (1x1) and its expectation value (E(PWF<Pschedule(PWF))
  1 Comment
David H
David H on 9 Jun 2020
I think you need lots more info in this question.
It looks like Pschedule is some function of PWF, but you haven't really said how. Is PWR a known array that you are inputting?
If you just want to know the probability an element of array "PWF" is smaller than the single number "Pschedule" you can do
mean(PWF<Pschedule)

Sign in to comment.

Answers (1)

Chaman Dewangan
Chaman Dewangan on 20 Jun 2021
If we have data then, the following MATLAB code can find probability.
%Create data
x=1.1:0.001:1.8;
x=x';% because fitdist function needs column vector
% Fit the probability distribution function.
% Here I have assumed normal distribution.
pd = fitdist(x,'Normal');
% mean and standard deviation are two parameters
mu1=pd.mu;
sigma1=pd.sigma;
% What is the probability? It is the area of probability density function
% for the given interval of random variable.
% Which we read as integration in mathematics.
% I want to find the probability for between 1.211 and 1.25
x2=[1.211:0.001:1.25];
y2 = pdf('Normal',x2,mu1,sigma1);
% trapz function is used to calculate the area for the given interval.
prob= trapz(x2, y2)

Categories

Find more on Mathematics in Help Center and File Exchange

Tags

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!