Skip to content

Commit

Permalink
Add a real-world math-heavy example post
Browse files Browse the repository at this point in the history
Thanks @lsaravia
  • Loading branch information
kaushalmodi committed Nov 28, 2017
1 parent 80cdaa2 commit 3b34bae
Show file tree
Hide file tree
Showing 6 changed files with 262 additions and 0 deletions.
116 changes: 116 additions & 0 deletions test/site/content-org/all-posts.org
Original file line number Diff line number Diff line change
Expand Up @@ -2594,6 +2594,122 @@ auto-prefixed with the section for the current post.
:EXPORT_FILE_NAME: alias-multiple-with-section
:EXPORT_HUGO_ALIASES: /alias-test/alias-g /alias-test/alias-h
:END:
* Real Examples :real_examples:
:PROPERTIES:
:EXPORT_HUGO_SECTION: real-examples
:END:
** DONE Multifractals in ecology using R :math:equations:
CLOSED: [2017-11-28 Tue 10:48]
:PROPERTIES:
:EXPORT_FILE_NAME: multifractals-in-ecology-using-r
:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :author Leonardo A. Saravia
:EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :source https://github.com/lsaravia/MultifractalsInR/blob/master/Curso3.md
:END:
- Disclaimer :: This post is from the [[https://github.com/lsaravia/MultifractalsInR/blob/master/Curso3.md][link]] posted by GitHub user
[[https://github.com/lsaravia][*lsaravia*]] in [[https://github.com/gohugoio/hugo/issues/234#issuecomment-347532166][this comment]]. All credits for this post
go to the original author.
-----
[[file:/images/MultifractalsInR/fractal-ice.jpg]]
*** Multifractals
- Many natural systems cannot be characterized by a single number such
as the fractal dimension. Instead an infinite spectrum of dimensions
must be introduced.
[[file:/images/MultifractalsInR/C3_Clouds.png]]
*** Multifractal definition
- Consider a given object $\Omega$, its multifractal nature is
practically determined by covering the system with a set of boxes
$\{B_i(r)\}$ with $(i=1,..., N(r))$ of side lenght $r$
- These boxes are nonoverlaping and such that

$$\Omega = \bigcup_{i=1}^{N(r)} B_i(r)$$

This is the box-counting method but now a measure $\mu(B_n)$ for each
box is computed. This measure corresponds to the total population or
biomass contained in $B_n$, in general will scale as:

$$\mu(B_n) \propto r^\alpha$$
*** Box counting
[[file:/images/MultifractalsInR/C3_BoxCounting.png]]
*** The generalized dimensions
- The fractal dimension $D$ already defined is actually one of an
infinite spectrum of so-called correlation dimension of order $q$ or
also called Renyi entropies.

$$D_q = \lim_{r \to 0} \frac{1}{q-1}\frac{log \left[ \sum_{i=1}^{N(r)}p_i^q \right]}{\log r}$$

where $p_i=\mu(B_i)$ and a normalization is assumed:

$$\sum_{i=1}^{N(r)}p_i=1$$

- For $q=0$ we have the familiar definition of fractal dimension. To see
this we replace $q=0$

$$D_0 = -\lim_{r \to 0}\frac{N(r)}{\log r}$$
*** Generalized dimensions 1
- It can be shown that the inequality $D_q' \leq D_q$ holds for
$q' \geq q$
- The sum

$$M_q(r) = \sum_{i=1}^{N(r)}[\mu(B_i(r))]^q = \sum_{i=1}^{N(r)}p_i^q$$

is the so-called moment or partition function of order $q$.
- Varying q allows to measure the non-homogeneity of the pattern. The
moments with larger $q$ will be dominated by the densest boxes. For
$q<0$ will come from small $p_i$'s.
- Alternatively we can think that for $q>0$, $D_q$ reflects the scaling
of the large fluctuations and strong singularities. In contrast, for
$q<0$, $D_q$ reflects the scaling of the small fluctuations and weak
singularities.
*** Exercise
- Calculate the partition function for the center and lower images of
the figure:
[[file:/images/MultifractalsInR/C3_BoxCounting.png]]
*** Two important dimensions
- Two particular cases are $q=1$ and $q=2$. The dimension for $q=1$ is
the Shannon entropy or also called by ecologist the Shannon's index of
diversity.

$$D_1 = -\lim_{r \to 0}\sum_{i=1}^{N(r)} p_i \log p_i$$

and the second is the so-called correlation dimension:

$$D_2 = -\lim_{r \to 0} \frac{\log \left[ \sum_{i=1}^{N(r)} p_i^2 \right]}{\log r} $$

the numerator is the log of the Simpson index.
*** Application
- Salinity stress in the cladoceran Daphniopsis Australis. Behavioral
experiments were conducted on individual males, and their successive
displacements analyzed using the generalized dimension function $D_q$
and the mass exponent function $\tau_q$
[[file:/images/MultifractalsInR/C3_Cladoceran.png]]
both functions indicate that the successive displacements of male D.
australis have weaker multifractal properties. This is consistent with
and generalizes previous results showing a decrease in the complexity
of behavioral sequences under stressful conditions for a range of
organisms.
- A shift between multifractal and fractal properties or a change in
multifractal properties, in animal behavior is then suggested as a
potential diagnostic tool to assess animal stress levels and health.
*** Mass exponent and Hurst exponent
- The same information contained in the generalized dimensions can be
expressed using mass exponents:

$$M_q(r) \propto r^{-\tau_q}$$

This is the scaling of the partition function. For monofractals
$\tau_q$ is linear and related to the Hurst exponent:

$$\tau_q = q H - 1$$

For multifractals we have

$$\tau_q = (q -1) D_q$$

Note that for $q=0$, $D_q = \tau_q$ and for $q=1$, $\tau_q=0$
*** Paper
1. Kellner JR, Asner GP (2009) Convergent structural responses of
tropical forests to diverse disturbance regimes. Ecology Letters 12:
887--897. doi:10.1111/j.1461-0248.2009.01345.x.
* TODO Pre-Draft State
:PROPERTIES:
:EXPORT_FILE_NAME: draft-state-todo
Expand Down
146 changes: 146 additions & 0 deletions test/site/content/real-examples/multifractals-in-ecology-using-r.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
+++
title = "Multifractals in ecology using R"
date = 2017-11-28T10:48:00-05:00
tags = ["real-examples", "math", "equations"]
draft = false
author = "Leonardo A. Saravia"
source = "https://github.com/lsaravia/MultifractalsInR/blob/master/Curso3.md"
+++

- **Disclaimer:** This post is from the [link](https://github.com/lsaravia/MultifractalsInR/blob/master/Curso3.md) posted by GitHub user
[**lsaravia**](https://github.com/lsaravia) in [this comment](https://github.com/gohugoio/hugo/issues/234#issuecomment-347532166). All credits for this post
go to the original author.

---

{{<figure src="/images/MultifractalsInR/fractal-ice.jpg">}}


## Multifractals {#multifractals}

- Many natural systems cannot be characterized by a single number such
as the fractal dimension. Instead an infinite spectrum of dimensions
must be introduced.
{{<figure src="/images/MultifractalsInR/C3_Clouds.png">}}


## Multifractal definition {#multifractal-definition}

- Consider a given object \\(\Omega\\), its multifractal nature is
practically determined by covering the system with a set of boxes
\\(\{B\_i(r)\}\\) with \\((i=1,..., N(r))\\) of side lenght \\(r\\)
- These boxes are nonoverlaping and such that

\\[\Omega = \bigcup\_{i=1}^{N(r)} B\_i(r)\\]

This is the box-counting method but now a measure \\(\mu(B\_n)\\) for each
box is computed. This measure corresponds to the total population or
biomass contained in \\(B\_n\\), in general will scale as:

\\[\mu(B\_n) \propto r^\alpha\\]


## Box counting {#box-counting}

{{<figure src="/images/MultifractalsInR/C3_BoxCounting.png">}}


## The generalized dimensions {#the-generalized-dimensions}

- The fractal dimension \\(D\\) already defined is actually one of an
infinite spectrum of so-called correlation dimension of order \\(q\\) or
also called Renyi entropies.

\\[D\_q = \lim\_{r \to 0} \frac{1}{q-1}\frac{log \left[ \sum\_{i=1}^{N(r)}p\_i^q \right]}{\log r}\\]

where \\(p\_i=\mu(B\_i)\\) and a normalization is assumed:

\\[\sum\_{i=1}^{N(r)}p\_i=1\\]

- For \\(q=0\\) we have the familiar definition of fractal dimension. To see
this we replace \\(q=0\\)

\\[D\_0 = -\lim\_{r \to 0}\frac{N(r)}{\log r}\\]


## Generalized dimensions 1 {#generalized-dimensions-1}

- It can be shown that the inequality \\(D\_q' \leq D\_q\\) holds for
\\(q' \geq q\\)
- The sum

\\[M\_q(r) = \sum\_{i=1}^{N(r)}[\mu(B\_i(r))]^q = \sum\_{i=1}^{N(r)}p\_i^q\\]

is the so-called moment or partition function of order \\(q\\).
- Varying q allows to measure the non-homogeneity of the pattern. The
moments with larger \\(q\\) will be dominated by the densest boxes. For
\\(q<0\\) will come from small \\(p\_i\\)'s.
- Alternatively we can think that for \\(q>0\\), \\(D\_q\\) reflects the scaling
of the large fluctuations and strong singularities. In contrast, for
\\(q<0\\), \\(D\_q\\) reflects the scaling of the small fluctuations and weak
singularities.


## Exercise {#exercise}

- Calculate the partition function for the center and lower images of
the figure:
{{<figure src="/images/MultifractalsInR/C3_BoxCounting.png">}}


## Two important dimensions {#two-important-dimensions}

- Two particular cases are \\(q=1\\) and \\(q=2\\). The dimension for \\(q=1\\) is
the Shannon entropy or also called by ecologist the Shannon's index of
diversity.

\\[D\_1 = -\lim\_{r \to 0}\sum\_{i=1}^{N(r)} p\_i \log p\_i\\]

and the second is the so-called correlation dimension:

\\[D\_2 = -\lim\_{r \to 0} \frac{\log \left[ \sum\_{i=1}^{N(r)} p\_i^2 \right]}{\log r} \\]

the numerator is the log of the Simpson index.


## Application {#application}

- Salinity stress in the cladoceran Daphniopsis Australis. Behavioral
experiments were conducted on individual males, and their successive
displacements analyzed using the generalized dimension function \\(D\_q\\)
and the mass exponent function \\(\tau\_q\\)
{{<figure src="/images/MultifractalsInR/C3_Cladoceran.png">}}
both functions indicate that the successive displacements of male D.
australis have weaker multifractal properties. This is consistent with
and generalizes previous results showing a decrease in the complexity
of behavioral sequences under stressful conditions for a range of
organisms.
- A shift between multifractal and fractal properties or a change in
multifractal properties, in animal behavior is then suggested as a
potential diagnostic tool to assess animal stress levels and health.


## Mass exponent and Hurst exponent {#mass-exponent-and-hurst-exponent}

- The same information contained in the generalized dimensions can be
expressed using mass exponents:

\\[M\_q(r) \propto r^{-\tau\_q}\\]

This is the scaling of the partition function. For monofractals
\\(\tau\_q\\) is linear and related to the Hurst exponent:

\\[\tau\_q = q H - 1\\]

For multifractals we have

\\[\tau\_q = (q -1) D\_q\\]

Note that for \\(q=0\\), \\(D\_q = \tau\_q\\) and for \\(q=1\\), \\(\tau\_q=0\\)


## Paper {#paper}

1. Kellner JR, Asner GP (2009) Convergent structural responses of
tropical forests to diverse disturbance regimes. Ecology Letters 12:
887--897. <10.1111/j.1461-0248.2009.01345.x>.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3b34bae

Please sign in to comment.