COMB2PRO Probability vector of placing a cycle on a specific place given all combinations Calculates the probability vector of placing a cycle on a specific place given the number of possible places (combinations).
Generates a stationary residual from the frequency matrix. | |
Recontructs a load process given the frequency matrix (and residual). |
01 function prob=comb2pro(combinations,freq) 02 % COMB2PRO Probability vector of placing a cycle on a specific place given all combinations 03 % 04 % Calculates the probability vector of placing a cycle on a specific place 05 % given the number of possible places (combinations). 06 07 % Copyright 1993, Mats Frendahl & Igor Rychlik, 08 % Dept. of Math. Stat., University of Lund. 09 10 denominator=combinations+freq-1; 11 add=(denominator==0); 12 denominator=denominator+add; 13 nominator=combinations+add-1; 14 addcomb=(combinations==0); 15 lambda=freq./(combinations+addcomb); 16 %pp=nominator./denominator; 17 %pp=1./(1+lambda); 18 pp=(1-ones(length(combinations+add),1)./(combinations+add)).^freq; 19 %pp=exp(-lambda); 20 pp=pp'; 21 22 tmp=zeros(length(pp),1); prob=zeros(length(pp),1); 23 tmp(1)=1; 24 for i=2:length(pp), tmp(i)=tmp(i-1)*pp(i-1); end 25 prob=[tmp(length(tmp))*pp(length(pp)) (1-pp).*tmp']; 26 27 28
Comments or corrections to the WAFO group