Arranging a Gamma Distribution Family into Exponential Family Form

November 20th, 2016

A family of PMFs or PDFs is an exponential family if it can be arranged into the form

$f(x|\theta) = h(x)c(\theta)\exp\left(\sum_{i=1}^kw_i(\theta)t_i(x)\right)$

where $\theta$ is the vector of parameters.

Now, the shape-scale parameterization of the Gamma distribution PDF takes the form

$f_X(x) = \frac{1}{\Gamma(k)\beta(k)}x^{k-1}e^{-\frac{x}{\beta}}$

$\beta$ is typically used as the symbol for the rate parameter in the shape-rate parameterization of the Gamma PDF, but the default symbol for the scale parameter, $\theta$, would conflict with the symbol for our parameter vector.

Can we arrange that PDF into an exponential family form? Spoiler: yes.

Here, we demonstrate that a Gamma PDF given two unknown parameters, $\beta$ and $k$, is an exponential family.

$f(x|k,\beta) = \frac{1}{\Gamma(k)\beta(k)}x^{k-1}e^{-\frac{x}{\beta}}$
$ = \frac{1}{\Gamma(k)\beta(k)}e^{(k-1)\ln(x)}e^{-\frac{x}{\beta}}$
$ = \frac{1}{\Gamma(k)\beta(k)}e^{(k-1)\ln(x) – \frac{x}{\beta}}$

The log identity $x^b = e^{b\ln(x)}$ is a very useful logarithmic identity to remember when trying to arrange PDFs into exponential family form.

We observe:
$h(x) = I_{x>0}(x)$ (If you see that h(x) = 1, that is a cue to use an indicator function that ranges through the support of $x$.)
$c(k,\beta) = \frac{1}{\Gamma(k)\beta(k)}$
$w_1(k,\beta) = k – 1$
$w_2(k,\beta) = -\frac{1}{\beta}$
$t_1(x) = \ln(x)$
$t_2(x) = x$

Hence, the Gamma distribution given unknown parameters $\beta$ and $k$ is an exponential family with a two-dimensional parameter vector $\theta$.

A similar process will apply for showing that a Gamma PDF with one unknown parameter, $\beta$ or $k$ is an exponential family.

Thoughts on Lal 2008, “Carbon Sequestration.”

August 1st, 2016

From Phil. Trans. R. Soc. B

Carbon sequestration is defined as the transfer of carbon from the atmospheric carbon pool to other carbon pools. Including the atmospheric pool, there are five carbon pools, with the largest being the oceanic pool at an estimated 38,000 Pg C. The pedologic pool is the third largest at 2500 Pg and further subdivides into the soil organic carbon (SOC) and soil inorganic carbon (SIC) pools.

There are abiotic techniques for carbon sequestration comprised of engineering methods and chemical processes. Many of them consist of injecting carbon into non-atmospheric pools. There are also biotic techniques that rely on organisms, primarily plants and microbiota, for removing CO2 from the atmosphere. Theoretically, abiotic techniques can store more carbon, but there are questions about the safety and reliability of those techniques. The risk of carbon leakage and the effects of leakage on ecosystems is still uncertain. Additionally, the expensive cost of geo-engineering is a limitation. By comparison, biotic techniques are more cost-effective and less risky, while providing accompanying benefits such as improved soil and water quality and ecosystem preservation absent from abiotic methods. Biotic approaches do have a smaller cumulative carbon sink capacity than abiotic approaches.

Biotic techniques can be subdivided into oceanic sequestration and terrestrial sequestration methods. In terms of terrestrial methods, afforestation in the U.S alone can sink up to 117 Tg C per year in the U.S alone (IPCC 1999). The cost of afforestation is the drain on water resources, which can make the practice prohibitive in drought-stricken regions, like California. The family of techniques focusing on SOC and SIC sequestration can also cumulatively sink a significant amount of carbon. Land use conversion and restoration of degraded soils can increase overall microbiota concentrations and diversity in soils. Restoration of degraded soils and habitats in the tropics can potentially sequester an additional 1.1 Pg C per year (Grainger 1995). What constitutes “degraded lands … with potential for afforestation and soil quality enhancement” is something I am not clear on, as I have not read the Grainger paper. Moving away from mono to multi-cultures for agricultural crops can mitigate SOC losses and improve the ability of agricultural-use land to sequester carbon.

A lingering question — how many acres could be converted from agricultural usages and how much soil could be restored if food waste were more controlled throughout the world?

Thoughts on Li et al. 2014, “Soil carbon sensitivity to temperature and carbon use efficiency compared across microbial-ecosystem models of varying complexity.”

July 9th, 2016

Ha, that is a long auto-generated URL. Given what has happened in the past few days, one has to chuckle at and cherish the little harmless things.

I read Li et al. 2014 from Biogeochemistry. This paper compares the output of several Earth system models including the “conventional model,” German (German et al., 2012), AWB (Allison et al., 2010), and MEND (Wang et al., 2013). The models differ in carbon pool structure and interactions, parameter values, and complexity — German has the fewest parameters and pools, while MEND has the most. The models were simulated under three separate microbial carbon use efficiency (CUE) scenarios. CUE is an important parameter in describing microbial function, and the effect of rising temperatures on the CUE of global microbial populations will be a key determinant of changes to the soil organic carbon (SOC) pool size in the coming century.

The three CUE scenarios tested were:

  1. A constant CUE scenario in which the CUE parameter stayed at 0.31 and did not depend on temperature
  2. A varied CUE scenario in which CUE monotonically decreases with temperature increase
  3. A varied CUE with thermal acclimation

Another key parameter that CUE depends on in all of the models in Li et al. (with the exception of the conventional model) is m, the CUE temperature response coefficient. CUE is given by

CUE(T) = CUE_{ref} + m * (T – T_{ref})

where T is temperature, CUE_{ref} is a set reference CUE value, and T_{ref} is a set reference temperature, in this 298.15 Kelvin.

Models were simulated at initial temperatures until they reached equilibrium and then perturbed with a 5 degree Celsius temperature increase.

Now, I won’t go into too much detail since I need to go to bed at some point, but there are several results in this paper that piqued my interest. For one, for regions initiated at low temperatures, the German, AWB, and MEND models predicted the decrease of SOC pool sizes. Regions initially seeded at higher temperatures saw smaller SOC losses, or even modest gains. This prediction aligns with experimental results predicting SOC losses in Arctic soils (Xue et al., 2016; Natali et al., 2011). Additionally, the observation of damped oscillations matched my own observations in simulations I have run, which makes sense as interactive coupling between SOC and microbial soil (MBC) pools is reminiscent of that observed in predator-prey models, so I was glad to see that confirmed.

Since I really have to go to bed now, I’ll jump straight to questions and future research directions that this paper has evoked. First, instead of a constant 50% thermal acclimation scenario (where m is halved in comparison to the varied CUE scenario), I wonder how changing m to be a function dependent on time (representing adapting mutations) would change things up. Second, this is a question less related to this paper, but with these Earth system biogeochemistry models, the carbon dioxide flux does not feed back into the pools in any way and is entirely separate from the input. How could the atmospheric carbon pool size be fit into these models? As a person new to this sub-field of Earth system biogeochemistry, I’m wondering why atmospheric carbon is not accounted for as an interactive pool in these models.

Avril et le monde truqué (April and the Twisted World) Review

April 19th, 2016

Glorious cable car from the film.

I only have a bit of time before class starts, but I wanted to laud a film I saw last night, Avril et le monde truqué, while it is still fresh and vivid in my mind. The title of the film seems to have two official English translations, “April and the Twisted World” and “April and the Extraordinary World.” This makes me very curious about the adjective, truqué.

I state a lot of hyperbole on this blog and throw a lot of praise on the stuff I’ve seen. I think the reason for this is less because I am easy to please, and more because I have gotten to know my taste well enough over the years to have developed a decent intuition for what I will enjoy from marketing, trailers, and word of mouth alone.

SOME SPOILERS BELOW

Anyway, this film is extraordinary. It is set in only a somewhat twisted (but still oppressive) coalpunk world, where science is not done in the open. A free scientist risks capture by secret police and enslavement by imperial states to build war machines to fight nations in neverending wars for charcoal — or capture by cloud-manipulating tiltrotors and enslavement by lizard overlords in exoskeletons to work on a project to synthesize an invincibility serum.

The wonder in the film is not in its examination of the scientific method. You will see the familiar tropes of solo genius, no control condition, DIY science in basement, etc. Scientific developments are there not to drive a discussion of the philosophy of science, but to further the plot. Instead, perhaps as expected for an animated film, the appeal is in the aesthetic, and the wonderful sense of adventure in the story. The opening credits sequence (one of the best I have ever seen), sets the tone for a quirky ride. There are a lot of secret buttons, secret rooms, and secret bases, an absolutely treat for people like me who dig that sort of thing. The intricate coalpunk tech had me marveling and smiling at multiple points — the gargantuan cable car and plodding AT-ST-resembling mansion. At times, they evoked a dirtier version of what I’d seen in Spirited Away and Castle in The Sky. There is an emphasis on the environmental cost of industrialization that also reminded me of Hayao Miyazaki’s work. The ash-gray of soot, coal, and charcoal is the dominant color scheme for much of the film; we see a sickly Europe that has been entirely deprived of trees (there are apparently only three oak trees left in France at one point in the narrative). There is a talking cat, too. But in terms of influences, this film most obviously homages the work of Jules Verne for me. The last act clearly calls to Journey to The Center of The Earth, with its involvement of a huge, underground cavernous space.

Marion Cotillard does an impressive job voice-acting the protagonist. What makes or break voice acting for me is often the non-verbal sounds the character makes. Cotillard is spot on with her sighs and grunts, no sexual innuendo intended.

Finally, I really enjoyed the whimsical and absurdist sense of humor that stays constant through the whole film. You cannot have an adventure narrative without humor. During the transition to the epilogue, a narrator cheerily announces that after the events of the climax, the world enters an era of peace and proceeds to move from dirty coal to clean and environmentally friendly oil.

And now, I gotta go to class. Watch this film if you can.

Fire Emblem Fates Easy Seize Castle (including Corrin with Movement +1)

March 25th, 2016

For Fire Emblem players, I submit my easy-seize, no-hacked-units castle for those interested in collecting some skills. I am building my characters and castle back up after beating Conquest and beginning Revelations, so Heart Seals should be available again soon. Not having hacked units means characters will not have personal skills they should not have. This means that aside from Mozu, no units will have Aptitude.

Castle Code: 12953-01599-79461-61023

Castle Name: Legal Skills

MU Name: Wallace (too many Corrins makes it harder to differentiate castles)

Food Resources: Cabbage, Fish

Mineral Resources: Lapis, Ruby

Defenses: Level 28 Lilith (subject to change, but should be easy to get out of her range), Dawn Dragon (easy to ignore, since my units are on hold and won’t attack)

Excerpted Units and Skills (subject to rotation and periodic shifts — let me know if you have a request):

Note — current units in rotation bolded; inactive skills will be placed between brackets

MU: Movement +1, Dragon Fang, Luna, Draconic Hex, Hoshidan Unity [Skill +2, Defense +2, Rally Skill, Astra, Pavise, Dragon Ward, Nohrian Trust, Quick Draw, Armored Blow, Swordbreaker, Axebreaker, Shurikenbreaker, Bowbreaker, Tomebreaker, Quixotic, Nobility, Locktouch]

Azura: Movement +1, Inspiring Song, Aegis, Amaterasu, Rally Speed [Luck +4, Darting Blow, Voice of Peace, Foreign Princess, Camaraderie]

Takumi: Seal Defense, Certain Blow, Lifetaker, Amaterasu, Bowfaire [Skill +2, Seal Magic, Swap, Quick Draw, Malefic Aura, Air Superiority, Heartseeker]

Elise: Tomebreaker, Renewal, Rally Resistance, Savage Blow, Aegis [Strength +2, Resistance +2, Lunge, Trample, Demoiselle, Swordbreaker, Live to Serve]

Camilla: Swordbreaker, Pass, Lifetaker, Savage Blow, Rally Defense [Strength +2, Aegis, Lunge, Malefic Aura, Lancebreaker, Bowbreaker, Heartseeker, Renewal]

Xander: Armored Blow, Savage Blow, Sol, Luna, Aegis [Seal Strength, Astra, Pavise, Vantage, Shelter, Lunge, Replicate, Elbow Room, Life and Death, Duelist’s Blow, Trample, Swordfaire, Defender, Swordbreaker, Tomebreaker]

Ryoma: Duelist’s Blow, Astra, Seal Strength, Luna, Swordfaire [Vantage, Shelter, Elbow Room, Life and Death, Armored Blow]

Hinoka: Seal Speed, Rend Heaven, Amaterasu, Rally Speed, Warding Blow [Seal Defense, Swap, Darting Blow, Lancefaire, Air Superiority, Quixotic, Camaraderie]

Sakura: Miracle, Amaterasu, Camaraderie, Rally Speed, Darting Blow [Rally Magic, Rally Luck]

Selena: Movement +1, Good Fortune, Shurikenbreaker, Rally Defense, Air Superiority [Strength +2, Rally Skill, Lunge, Strong Riposte, Darting Blow, Camaraderie]

Felicia: Tomebreaker, Resistance +2, Live to Serve, Counter, Shurikenfaire [Demoiselle]

Laslow: Good Fortune, Locktouch, Poison Strike, Lethality, Sol [Vantage, Golembane, Strong Riposte, Death Blow]

Keaton: Beastbane, Odd Shaped, Rend Heaven, Sol, Better Odds [HP +5, Magic +2, Gamble, Future Sight]

Kaden: Beastbane, Evenhanded, Sol, Rend Heaven, Even Better [HP +5, Magic +2, Rally Magic, Gamble, Future Sight]

Kaze: Locktouch, Poison Strike, Shurikenfaire, Vantage, Pass

Kagero: Poison Strike, Locktouch, Magic +2, Future Sight

Oboro: Seal Defense, Swap, Potent Potion, Quick Salve

Sakura: Miracle, Rally Luck, Amaterasu

Rinkah: Seal Resistance, Axefaire, Shove, Locktouch

Arthur: HP +5, Sol, Swordfaire, Elbow Room, Shelter [Gamble]