Random walk (based in random angles). Math help....!!
11 views (last 30 days)
Show older comments
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 Comments
Walter Roberson
on 15 Nov 2013
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
on 15 Nov 2013
Edited: Image Analyst
on 15 Nov 2013
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 ?
Answers (1)
Image Analyst
on 15 Nov 2013
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 Comments
Image Analyst
on 15 Nov 2013
Here's an earlier random walk I wrote that calculates distance and labels the points. See attached file in blue below.
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!