Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am implementing a stochastic version of logistic equation in MATLAB. Keeping track of distribution of time it takes to for the population to reach 500 I experiment with various number of realisations to see how it affects the AVERAGE and the SPREAD of my distribution. Arbitrarily I chose to use 40 bins when plotting the histogram of distribution of time.

My question is: should the average time taken to reach 500 change if I increase the number of realisations? Why or why not? I suck at statistical analysis... It seems to me my average value is growing, but maybe it is nothing but some numerical error. Also my distribution seems to be skewed to the right (if compared to normal distribution), why is that? And should the spread of the distribution change if I increase realisations? It seems (maybe naively) that if you increase realisations you increase possibilities so the distribution should spread? But it seems wrong as, say, if you check the gender of a baby 1 or 1 000 000 times there is still 50% chance to find it is a girl.

Thanks, Aina.

Here is my code:

dt = 0.01;
K = 1000;
mu = 0.01;
stepNumber = 1000; % Total number of steps
M = 1000; % number of realisations: trie 10, 100, 1000 and 10000
t = linspace(0,stepNumber*dt,stepNumber);
x(:,1) = ones(M,1)*10; % initial condition
x(M,stepNumber) = 0; % define the size of the matrix
% exactSolution = 1000*exp(10*t)./(99+exp(10*t)); Time taken to reach K/2 is around 0.46
timeTaken(M) = 0;

for m = 1:M    
    for step = 1:stepNumber-1
        dW = randn*dt^(1/2);
        dx = (mu*K*x(m,step)-mu*x(m,step)^2)*dt + sqrt(mu*x(m,step)*(K+x(m,step)))*dW;  % E-M method for logistic equation
            x(m,step+1) = x(m,step) + dx;
        if or(x(m,step+1)<0,x(m,step)+1>K/2) % finish when population reached K/2
            break
        end
    end
    timeTaken(m) = step*dt;
end

figure
hist(timeTaken,40)
share|improve this question

1 Answer 1

up vote 1 down vote accepted

The setting is that one considers some independent realizations $(R_n)_{n\geqslant1}$ of the same theoretical quantity $r$. The average of the $n$ first realizations is $A_n$ and their spread is $S_n$, where $$ A_n=\frac1n\sum\limits_{k=1}^nR_k,\qquad S_n=\max\{R_k\mid1\leqslant k\leqslant n\}-\min\{R_k\mid1\leqslant k\leqslant n\}. $$ Here are some facts about the average.

  • For every given $n$, $A_n$ is a random variable with mean $\mathrm E(A_n)=r$. This means that if one repeats the experiment of measuring $A_n$ on independent samples of size $n$, and if the average of sample $k$ is $A_n^{(k)}$, then the average $\frac1i\sum\limits_{k=1}^iA^{(k)}_n$ converges to $r$ when $i\to\infty$.
  • The distribution of $A_n$ concentrates on $r$ when $n\to\infty$. This means for example that, for every fixed $\varepsilon\gt0$, $\mathrm P(|A_n-r|\geqslant\varepsilon)\to0$ when $n\to\infty$.
  • The departure of $A_n$ from $r$ is approximately normal, in the following sense. Let $B_n=\sqrt{n}(A_n-r)$, then $\mathrm P(B_n\leqslant x)\to\Phi(x)$ when $n\to\infty$, for every fixed $x$, where $\Phi$ denotes the standard normal CDF.

Hence the average values are not growing and nothing says their distributions should be skewed to the right or to the left in general (note that replacing each $R_n$ by $-R_n$ would yield another statistical sample, with a reversed skew). If yours are skewed to the right, this reflects a property of the common distribution of the random variables $R_n$ in your specific setting.

Here are some facts about the spread.

  • The sequence of spreads $(S_n)_n$ is nondecreasing, for example in the sense that $\mathrm P(S_{n+1}\geqslant x)\geqslant\mathrm P(S_{n}\geqslant x)$, for every $n$ and $x$.
  • When $n\to\infty$, $S_n\to s$ almost surely, where $s$ in $[0,+\infty]$ is the span of the (theoretical) common distribution of the random variables $R_n$.

Hence if the possible realizations are unbounded, $S_n\to+\infty$ while if the realizations are either $1$ (for male gender) or $2$ (for female gender), then $S_n\to2-1=1$.

share|improve this answer
    
thanks so much for answering. So if I understand correctly, my average should not change when I increase # of realisations, right? Also with the spread do I understand correctly you are saying that the spread goes to infinity as the number of realisations grow? –  Aina May 13 '12 at 11:23
    
Yes. $ $ $ $ $ $ –  Did May 13 '12 at 12:02
    
thanks so much again for your time, I really appreciate it : ) –  Aina May 13 '12 at 13:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.