⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 poissrp.m

📁 泊松随机过程
💻 M
字号:
function [X,t] = poissrp(N,t,l)% [X,t] = poissrp(N,t,l)%% N : Number of sample paths to generate% t : Vector of time points at which to generate samples% l : Arrival rate. OPTIONAL. Default l=1.%% X : Matrix of process sample paths. Each row is a sample path, each column%     is a different time point. %% X(t) = Poisson Random process with rate l%%                   n%               (lt)   -lt% f_{X(t)}(n) = ----  e%                n!% W. C. Karl if min(size(t)) > 1  error('t must be a vector of time point')end;if max(size(N))>1  error('N must be a scalar number of sample paths to generate')end;if nargin<3  l = 1;end;t = t(:)'; % Make a row vectormaxt = max(t);% Get sizesNt = length(t);Np = N;% Generate exponential interarrival times till all samples exceed maxt% Tau contains the set of exponential interarrival times for each experiment% -- one per rowTau = randexp(Np,5,l);while min(sum(Tau')) < maxt  Tau = [Tau,randexp(Np,1,l)];end;% Generate Waiting times from interarrival timesW = cumsum(Tau')';% Generate Process values at the desired time points by summing number of% arrivals prior to each timeX = zeros(Np,Nt);for i = 1:Nt  X(:,i) = sum((W<t(i))')';end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -