Estimation of probability density function of matlab

Source: Internet
Author: User
Matlab probabilistic density function estimate 2016-03-23 16:12:24

Category: C#/.net

Function: ksdensity
Function: estimate the probability density distribution according to the given data
Example:
1. Normal distribution
x = Randn (1,100000);
[Y,xi] = ksdensity (x);
Plot (xi,y, ' Bo ')
% verification
On
Yn=normpdf (xi,0,1); Probability density function for% standard normal distribution
Plot (Xi,yn, ' B ')


2. Rayleigh distribution
x = ABS (RANDN (1,10000) + 1I*RANDN (1,10000));
[Y,xi] = ksdensity (x);
Plot (xi,y, ' Bo ')
% verification
On
b = 1;
Yn = zeros (size (xi));
K=find (B > 0 & XI >= 0);
If any (k),
XK = XI (k);
Probability density function of the% Rayleigh distribution
YP (k) = (xk./b^2). * EXP (-xk.^2./(2*b^2));
End
Plot (XI,YP, ' B ')


3. The distribution of Les?
N = 100000;
K = 0.5;
CONST=1/(k+1);
X1=RANDN (1,n);
X2=RANDN (1,n);
X=sqrt (const* (X1+sqrt (2*k). ^2+x2.^2));
[Y,xi] = ksdensity (x);
Plot (xi,y, ' Bo ')
% verification
On
sig = 1;
v = 1;
Yn = zeros (size (xi));
K=find (B > 0 & XI >= 0);
If any (k),
XK = XI (k);
Percent Rician distribution of probability density functions
YP (k) = (xk./sig^2). * EXP ((-xk.^2 + v.^2)./(2*SIG^2)). * BesselJ (0, (xk. *v./sig^2));
End
Plot (XI,YP, ' B ')
Http://blog.chinaunix.net/uid-20692368-id-5680963.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.