Hi,
I am very new to stan and modeling areas. I have a data and I want to test if my data resemble a levy flight algorithm (during a search; having so many small steps and very few large steps).
As far as I go, I think of fitting my data to a power-law (levy flight follows a powerlaw) vs. normal distribution to test it. And I could not find any Lévy flight model codes, or examples.
Is my logic correct, or is there a better way to test it?
Thank you so much for your help!
Sorry nobody responded @Ege_Otenen. I think it may be because we’re not familiar with Lévy flight models. It looks like they’re Markovian random walks with wide tails. If that’s all it is, you can code that very easily in Stan. According to Wikipedia, one example is just a Cauchy random walk, which in Stan would look like this for observed data:
data {
int<lower=0> N;
vector[N] y;
}
parameters {
real<lower=0> sigma;
}
model {
y[1] ~ ...; // distribution on 1st elt. for complete y likelihood
y[2:N] ~ cauchy(y[1:N-1], sigma);
}
Given data y
, this lets you infer the scale sigma
of the Cauchy distribution. It would work the same way with other distributions in Stan. The second vectorized statement is equivalent to the loop
for (n in 2:N) {
y[n] ~ cauchy(y[n - 1], sigma);
}
Then if you want to use this as a prior for something else, it’s coded the same way, but now y
is a parameter. But you might want to use a non-centered parameterization.