Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Probability Density Functions are where the probability of a domain on the x-axis occurring is dictated by the area of this function over this domain.
- % Search it up if still unsure. Normal distribution bell-curve is an example.
- % Area under the whole of probability density function has to 1 exactly.
- % Area is found by the definite integral of this function over the entire domain of this function (0 to pi/2)
- % Indefinite integral of a*sin(t) is -a*cos(t) + C
- % Area between 0 and pi/2 is [-a*cos(t=pi/2)+C] - [-a*cos(t=0)+C] = a = 1
- % a = 1;
- % What is the probability of a signal lasting between 0 and x? This is the area between 0 and x
- % [-a*cos(t=x)+C] - [-a*cos(t=0)+C] = -a * cos(x) + a
- x = 0 : 0.01 : pi/2;
- a = 1; b = 2; c = 1/2;
- F = -a * cos(x) + a; FF = -b * cos(x) + b; FFF = -c * cos(x) + c;
- plot(x, F, x, FF, x, FFF);
- xlabel('x'); ylabel('Probability of signal between 0 and x'); title('Probability of signal between 0 and x for varying a');
- legend('a = 1', 'a = 2', 'a = 0.5');
- % Probability of signal lasting between 0 and pi/2 has to be 1 (always certain) as this is the range of signals.
- % We can confirm a = 1 does this.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement