MATLAB question regarding demographic stochasticity

  • Context: MATLAB 
  • Thread starter Thread starter chuy52506
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary
SUMMARY

The discussion focuses on calculating the probability that a population, governed by the equation x(n+1) = 0 if x(n) ≤ 2 and p(n+1) = A*x(n) - B if P(n) > 2, reaches or exceeds 10,000 after 100 iterations in MATLAB. The parameters A and B are defined as A = Normal(1.1, 0.2) and B = Normal(100, 20). The user is guided to derive the normal distribution parameters for p(100) using properties of random variables, specifically the expected value and variance, leading to the formulation p(n) = Normal[1.1x(n) - 100, [x(n)]^2 * 0.2 + 20]. The cumulative distribution function (CDF) is then used to determine the probability.

PREREQUISITES
  • Understanding of stochastic processes and demographic stochasticity
  • Familiarity with MATLAB programming and m-files
  • Knowledge of normal distribution and its properties
  • Basic concepts of expected value and variance in statistics
NEXT STEPS
  • Learn how to implement normal distribution calculations in MATLAB
  • Research the properties of random variables and their applications in stochastic modeling
  • Explore MATLAB functions for calculating cumulative distribution functions (CDF)
  • Study demographic stochasticity in population dynamics for deeper insights
USEFUL FOR

Researchers, data scientists, and MATLAB users interested in population modeling, stochastic processes, and statistical analysis of demographic data.

chuy52506
Messages
77
Reaction score
0
A population follows this equation:
x(n+1)= 0 if x(n)≤2 and p(n+1) = A*x(n)-B if P(n)>2
Where A=Normal(1.1,0.2) and B=Normal(100,20)
Let the initial population x(0)=1000

So far i created this mfile:
xlist = [];
x0=1000;
x=x0; xlist=x; N=100;
for n=1:N
R = 1.1+.2*rand(1); a = 100+20*rand(1);
x = R*x-a;
xlist = [xlist,x];
end
plot(0:N,xlist)

I ran it for 100 time steps

The question is,
What is the probability that x(100)≥10000?
I have no idea how to calculate the probability of this using matlab, any ideas?
 
Physics news on Phys.org
chuy52506 said:
A population follows this equation:
x(n+1)= 0 if x(n)≤2 and p(n+1) = A*x(n)-B if P(n)>2
Where A=Normal(1.1,0.2) and B=Normal(100,20)
Let the initial population x(0)=1000

So far i created this mfile:
xlist = [];
x0=1000;
x=x0; xlist=x; N=100;
for n=1:N
R = 1.1+.2*rand(1); a = 100+20*rand(1);
x = R*x-a;
xlist = [xlist,x];
end
plot(0:N,xlist)

I ran it for 100 time steps

The question is,
What is the probability that x(100)≥10000?
I have no idea how to calculate the probability of this using matlab, any ideas?

Hey chuy52506.

The key thing to take note of is p(100).

What you will have to do is find the parameters of the normal distribution for p(100). Just in case you are wondering it has to be normal since a normal + another normal = a normal.

So basically if we want to get the parameters: we use the properties of Random Variables:

E[aX+bY] = aE[X] + bE[Y]
VAR(aX + bY) = a^2Var(X) + b^2VAR(Y)

E[Ax(n)] = 1.1x(n)
VAR(Ax(n)) = [x(n)]^2 x 0.2

E = 100, Var(B) = 20

By adding the means and variances we get our p(n) variable being:

p(n) = Normal [ 1.1x(n) - 100, [x(n)]^2 x 0.2 + 20 ]

Now you normalize the distribution and use a computer routine to find the CDF corresponding to p(n >= 10000) = 1 - p(n < 10000).

Also make sure you double check my work just in case.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K