Probability density function calculation from data
    조회 수: 11 (최근 30일)
  
       이전 댓글 표시
    
I have  daily rain data  of a particuler area for past 20 years i.e  20 vecotrs of 1*365.  My supervisour asked to calculate its pdf(probability density function) and use this function to calculate rain on a particuler day. But, I am unable to code this.  I would highly appriciate your help. 
댓글 수: 0
답변 (1개)
  Bjorn Gustavsson
      
 2021년 1월 12일
        Step 1, combine the daily rain-data to a 20-by-365 matrix:
for iY = 20:-1:1
    rain_20years(iY,:) = rain_daily{iY}; % You'll have to adjust this to match your data-organisation
end
Step 2: plot, analyze the precipitation for a couple of random days:
plot(1:20,rain_20years([1 3 5 7 11 17],:),'.-')
Have a look at the help and documentation of hist, histogram and ksdensity functions. 20 samples is not much to build up a precipitation-probability from, so you could combine a couple of days (+/-1, 2 days perhaps, you'll have to test) to get some more samples, to do that you might have to reshape the input to the above functions, for that have a look at the help and documentation to reshape
HTH
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!