Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noise slope as abs instead of *-1 (?) #2

Open
black-snow opened this issue Jan 27, 2023 · 2 comments
Open

Noise slope as abs instead of *-1 (?) #2

black-snow opened this issue Jan 27, 2023 · 2 comments

Comments

@black-snow
Copy link

black-snow commented Jan 27, 2023

Hi Diego,

the doc ( env_stats) states:

The spectral exponent \eqn{\theta} is then estimated as the negative slope of the linear regression of the natural log of spectral density as a function of the natural log of frequency.

And the corresponding code is:

list(slope = as.numeric(abs(coef(model)[2])),

Shouldn't it be

 list(slope = as.numeric(-1 * coef(model)[2]),

instead?

What reason is there to not just take the slope as it is in the first place? Did you intend for color to have meaning "the higher, the redder"? Or did I get something wrong?

@dbarneche
Copy link
Owner

Hi Ronald, thanks for your comment, and apologies for the late reply.
The model is actually assuming a function of the form $s = 1 / f^\beta$, or $s = f^{-\beta}$ , where $s$ is the spectrum and $f$ the frequency. Empirically we then fit $\textrm{ln}s \sim \textrm{ln}f$ as a linear model, which yields the negative slope. But we're interested in estimating the value of $\beta$ from the first equation above, that's why the absolute value is taken. I hope this makes sense? See this
https://esajournals.onlinelibrary.wiley.com/doi/abs/10.1890/02-3122

@black-snow
Copy link
Author

@dbarneche no worries and thanks for the reply!

I might lack some background in spectral analysis but don't we estimate $\beta$ via the slope of the linear regression? Or, well, $-\beta$.
When red noise means more power/energy in lower frequencies (aka "on the left") and white noise an equal amount of variance over all frequencies, shouldn't blue noise then be more power in higher frequencies (aka "on the right")? And if $\beta>=1$ is red(-ish) noise and $\beta=0$ white noise, shouldn't $\beta<0$ be indicate blue noise?
And even though we might not usually see blue noise in nature, couldn't blue noise be mistaken for red noise if we ignore the sign as mentioned in the OP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants