Random walk (based in random angles). Math help....!!

9 ビュー (過去 30 日間)
Paulo
Paulo 2013 年 11 月 15 日
編集済み: Paulo 2013 年 11 月 15 日
I created two diferent movement rules for animal path simulation in Matlab, based on some field data. I used iterated steps (iterated algorithm), ramdomizing the angle of direction.
The first path rule is a complete (I suppose) random movement, where the direction of the next step could vary ramdomly from 0 to 360 (or 180 to -180) degrees.
And in the second path rule the steps direction are more correlated with the previous steps, as the angle of the next step could vary only 30 degrees (from -15 to 15 degrees).
The randomized variable is always the angle of direction. And for these these two path patterns the path lenght does not change during the displacement.
I am trying to deal with statistical theory, but so far Iam a little confuse about the simulations, so I came ask for some help:
- I created a “random walk” and a “correlated random walk” correct ? These are non stationary process right?
- I need to symbolize mathematically those rules (for scientific writing). For this I first should specify the media, the variace, and the distribuition correct ? But particulary at this point Iam stucked. Could you help me ? I really tried the bibliography but until now I havent had sucess understanding.
Thank you in advance.
  2 件のコメント
Walter Roberson
Walter Roberson 2013 年 11 月 15 日
This appears to be essentially a correlated random walk from a random starting point on the circle one unit in radius from the origin.
Image Analyst
Image Analyst 2013 年 11 月 15 日
編集済み: Image Analyst 2013 年 11 月 15 日
I moved Paulo's "Answer" moved here since it's a comment to Walter, not reall an answer in itself: Paulo, see my answer below.
Thank you for the insight! I look for some references with circular random walk and it really seens to be the case. But I am still stucked with the measures (media, variance, distributions)
As for giving more informations:
In fact I created two movements paths. One of them I hope is a random walk and the another a correlated random walk.
The random walk I allowed to random the angle direction in every steps, so it sorted an angle from 360 options, so: media zero, and uniform distribution ? and how about the variance ?

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2013 年 11 月 15 日
Try this:
maxNumberOfSteps = 10; % or whatever
radius = 1;
x = zeros(1, maxNumberOfSteps)
y = zeros(1, maxNumberOfSteps)
for stepNumber = 2 : maxNumberOfSteps
% Pick one of the two angle strategies.
% angle(stepNumber) = 360*rand(1); % Independent.
angle(stepNumber) = angle(stepNumber-1) + 30 * rand(1) - 15; % Correlated.
x(stepNumber) = x(stepNumber - 1) + radius * cosd(angle(stepNumber));
y(stepNumber) = y(stepNumber - 1) + radius * sind(angle(stepNumber));
cla;
plot(x, y, 'bo-', 'LineWidth', 3, 'MarkerSize', 15);
grid on;
end
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
  2 件のコメント
Image Analyst
Image Analyst 2013 年 11 月 15 日
Here's an earlier random walk I wrote that calculates distance and labels the points. See attached file in blue below.
Paulo
Paulo 2013 年 11 月 15 日
編集済み: Paulo 2013 年 11 月 15 日
Thank you Image Analyst!
The code I used before is this one:
% start position
p1x=-100+(100--100)*rand;
p1y=-100+(100--100)*rand;
pr1xi(1,:)=[p1x];pr1yi(1,:)=[p1y];
% k is the step lenght (constant) and n is total steps
k=1;
n=100;
%movement iteration
azimute=360;
thp1i(1,:)=-azimute + (azimute--azimute)*rand ;
for i=2:n+1
phi1=180;
thp1i(i:i,1)=thp1i(i-1,1)+((-1+(1--1)*rand)*phi1);
%changing for cartesian coordenates
pr1xi(i:i,1)=pr1xi(i-1,1)+(k*cos((thp1i(i-1,1))*pi/180));
pr1yi(i:i,1)=pr1yi(i-1,1)+(k*sin((thp1i(i-1,1))*pi/180));
plot(pr1xi,pr1yi)
end
Now Iam strugling to deal with the writing formalization.
What is the all assumptions behind this randow walk ? I supposed that I had a uniform distribution, as at a new step the chances for each angle to be sorted is the same (from the rand function), correct ?
But if I had a sorted angle from -180 to 180, how do I formalize the mean (the mean is zero?) and the variance ?
Also, if I want to calculate the chances of two particles meet each other, under this rule, is possible ? From where should I begin...? Any sugestions abou this ? Thank you!!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by