Wednesday, January 13, 2010
The "Burdens of Proof" of Ecological Economics
Cold Weather Running- 11 years of tips and tricks
A (logarithmic) leap of faith
where the angle brackets denote an average.
"Free energy" is defined as the sum of entropy and energy, or F = S +〈E〉, and to maximize the entropy subject to the constraint on the average energy, we set the total derivative dF = dS + β d〈E〉= 0, where β is the Lagrange multiplier for the constraint and d〈E〉= ∑i Ei dpi. The total derivative is
where α is the normalization multiplier, ∑i pi = 1, so that α ∑i dpi = 0. The resulting probability distribution is exponential:
where Q = ∑i e-β Ei is the partition function.
One assumption built into this calculation is that an average observed quantity implies a linear constraint on the underlying variable, E. For observed average energy, this is empirically true, but clearly for other quantities an experimental average would imply a nonlinear constraint on the variable: observed average momentum, P, for example, would constrain E = P2 / 2m. This quadratic constraint results in a Gaussian probability distribution, rather than exponential:
This raises an interesting question: for an arbitrary observed quantity, how do we know, a priori, what the form of the constraint on the underlying variable should be? For a multiplicative process, a logarithmic constraint might be the most natural choice. (Ok, so that's not much of an argument. Well, it's late and let's face it, if you couldn't make half-baked arguments on your blog, there wouldn't be too many blogs around, would there?) In this case, for an observed value 〈k〉, the constraint would be
This results in a probability distribution which follows a power law,
The challenge, then, is to decide what the most justifiable form is for the constraint, both in terms of curve fitting, as well as the underlying microscopic explanation. In the case of a logarithmic constraint, is there a solid argument, for example based on the principle that the constrained quantity must be extensive, that certain constraints should be logarithmic, rather than linear?
Tuesday, January 12, 2010
SAS vs. R... a fight for dominance in the statistical packages world
Anyway, we've just received our first "homework" and as nerdy as this sounds, I am excited about it... except for one little thing... it's done on SAS.
Now, I can't claim to be an expert in SAS or in R, and maybe someone who is will give me a little tip on why my opinion is complete fail, but I really think R is much more user friendly, especially for someone like me who has very little programming experience outside of making macros in Excel (prior to the great loss of VBA apps in Excel 2008 for Mac... the horror!), making a few visual basic programs that can taunt the user with insults given a certain input, or making annoying pop ups when certain coordinates on a screen are moused over. In other words, I know almost nothing about programming.
For example, I am about to begin a program in SAS for making a correlation matrix. Right, simple, a correlation matrix. Let me show you what that would look like in R.
DATANAME<-as.matrix(read.table('/R/dataname.csv', sep=","))
#possibly a few specifications about how to read the data included in that first bracket
DATACORR<-corr(dataname)
DATACORR
That's it!! That's the whole correlation matrix for R. It will show up immediately after you type in that second DATACORR (R likes to print automatically, oh, how Ilove R!)
Now let's talk about how we do THE EXACT SAME THING in SAS
DATA DATANAME;
INPUT VAR1 VAR2....etc. #not going to input vars here- worthless for the rant
# here is where you input all of the relationships between the variables if you need to
DATALINES;
#now you type in all the data, because SAS really hates reading from files... or you can be lazy like me and use Excel's export features to make files that are suitable for SAS... and easily adaptable to the variables you want to input
PROC CORR NOSIMPLE DATA= DATANAME;
VAR VAR1 VAR2 VAR3 .... etc.
WITH VAR1 VAR2 VAR3 ... etc.
RUN; QUIT;
Now, I think we can all see the problem here; as your data set gets bigger and bigger, and it will, incorporating all this stuff into SAS... pain in the butt. For SAS experts, there may be some shortcut to doing this, but let's think about it for a second. I am not a SAS expert, and many people who need to use statistical packages for large data set applications (biologists, etc.) probably aren't programming experts, either... So this seems like a lot of trouble to me.
With that being said, I think a fight needs to go down: SAS v. R... who will dominate the "Entry-Level Statistical Packages World"? I am obviously biased to R. Here's some points to think of
FOR SAS:
- more traditional package, has been around for a long time
- already incorporated into curriculums
- produces standard plots
- labels statistical tests and their solutions (for example, on the SW test it will remind you that P
- can easily run "tests" for equality of B's that help choose model form
- traditional ("old-school") programming syntax
FOR R:
- really sweet graphics
- lots of cool packages to download
- easy commands to use
- reading files is not TOO difficult (it can even work with some Excel files-- which is amazing-- it knows the data entry from the function entry!)
- calculates statistical tests
- new-school syntax
- 3D graphics that look just amazingly sweet (2 comments on the graphics, I know, but you can make just about anything on there! You can layer it with a MAP for goodness sake... I mean... hot skippy, that's amazing!)
So... it's the duel of the century in nerd world. I guess as this class progresses we will see-- will my exposure to SAS build my love for it or will my heart remain devoted to R? More of this epic saga to come.
Monday, January 11, 2010
Mass Carriers and Britain from the Sky

Well, it appears that I am now a bunch of mass carriers... :)
Friday, January 08, 2010
When Street Luge is just not hardcore enough
Sunday, December 27, 2009
Thing that make the world implode
I've heard this ordered at Starbucks(es) before... decaf americano. For those who do not know, americano is coffee language for espresso and water... aka "watered down espresso" for those who are too pansy to drink the real thing... or people like me who want the satisfaction of a whole mug without sacrificing the caffiene. But a decaf americano? What is the point of that... "Yes, hello, I would like watered-down fake coffee." FAIL.
The "luxury utility vehicle" (LUV)?
This includes all "SUVs" that are not made for "S"-- Acura MDX, Porsche Cayenne, etc. What is the point? Who buys a car for utility when it is not going to be utilized for anything more than driving around shopping. Shopping is not a sport. And SUVs should not have seat warmers. I think these cars exist to show that the consumer has the money to guzzle gas without hesitation. Either do something sporty... or don't. It's like the car version of "is cheerleading a sport?"
The Hannah Montana Guitar?
Is it Miley Cyrus? Or is is Hannah Montana? Is it a guitar... or isn't it? World ----> explode.
Snuggie?
Because it's cool to wear your blanket out of the house. If you are too lazy to take your arms from out from under the blanket to get the remote, but can still venture to walmart to stock up on all the latest consumer goods... while wearing your snuggie? Uhm. Yeah. And now they have those fashion snuggies? Making wearing blankets in public-- stylish?
The Elliptical Trainer?
So the idea is that you put your feet into these holsters that move your legs for you in a circular motion and somehow you burn more calories than running? How does that work? All I am going to say is... I have seen many fit athletes who run. I have not seen anyone who is a champion of ellipticalling. "Oh, look at me, I'm the BEST ELLIPTICALER IN THE WORLD. I can burn 100000 calories in an hour!" No.
Fur lined boots and shorts/skirts?
Why.... (EXPLODE)
Warranties on Running Shoes?
For ten dollars, you could protect your shoes against wear and tear. But running is not included in the list of actions protected against. I don't know about you, but the next time I go ice climbing in my DS Trainers I am taking that action back to sportsauthority. Unusual wear and tear? Think you got it backwards there, SA.
Jolly Ranchers and Bacon.
There is at least one thing in the world that does NOT go with bacon.
Sunday, July 19, 2009
Mathematics
- Bertrand Russell
"The mathematician does not study pure mathematics because it is useful; he studies it because he delights in it and he delights in it because it is beautiful."
- Henri Poincare
"Similarly, mathematics can achieve a proof that has no interaction with the physical world. It may even be the closest to divine truth that human beings can achieve."
- Andrew Sullivan
Solitude
- Francis Bacon
"I lived in solitude in the country and noticed how the monotony of a quiet life stimulates the creative mind."
- Albert Einstein
"Language... has created the word "loneliness" to express the pain of being alone. And it has created the word "solitude" to express the glory of being alone."
- Paul Tillich
Politics
- George Carlin
Meditation
- Li Po
Effort
- Theodore Roosevelt
Tuesday, May 19, 2009
Commencement
"Because here's something else that's weird but true: in the day-to-day trenches of adult life, there is actually no such thing as atheism. There is no such thing as not worshipping. Everybody worships. The only choice we get is what to worship. And the compelling reason for maybe choosing some sort of god or spiritual-type thing to worship--be it JC or Allah, be it YHWH or the Wiccan Mother Goddess, or the Four Noble Truths, or some inviolable set of ethical principles--is that pretty much anything else you worship will eat you alive. If you worship money and things, if they are where you tap real meaning in life, then you will never have enough, never feel you have enough. It's the truth. Worship your body and beauty and sexual allure and you will always feel ugly. And when time and age start showing, you will die a million deaths before they finally grieve you. On one level, we all know this stuff already. It's been codified as myths, proverbs, clichés, epigrams, parables; the skeleton of every great story. The whole trick is keeping the truth up front in daily consciousness.
"Worship power, you will end up feeling weak and afraid, and you will need ever more power over others to numb you to your own fear. Worship your intellect, being seen as smart, you will end up feeling stupid, a fraud, always on the verge of being found out. But the insidious thing about these forms of worship is not that they're evil or sinful, it's that they're unconscious. They are default settings.
"They're the kind of worship you just gradually slip into, day after day, getting more and more selective about what you see and how you measure value without ever being fully aware that that's what you're doing.
"And the so-called real world will not discourage you from operating on your default settings, because the so-called real world of men and money and power hums merrily along in a pool of fear and anger and frustration and craving and worship of self. Our own present culture has harnessed these forces in ways that have yielded extraordinary wealth and comfort and personal freedom. The freedom all to be lords of our tiny skull-sized kingdoms, alone at the centre of all creation. This kind of freedom has much to recommend it. But of course there are all different kinds of freedom, and the kind that is most precious you will not hear much talk about much in the great outside world of wanting and achieving.... The really important kind of freedom involves attention and awareness and discipline, and being able truly to care about other people and to sacrifice for them over and over in myriad petty, unsexy ways every day.
"That is real freedom. That is being educated, and understanding how to think. The alternative is unconsciousness, the default setting, the rat race, the constant gnawing sense of having had, and lost, some infinite thing."
- David Foster Wallace
Monday, April 20, 2009
The long way home
I got off work at about 8, and it was still warm and breezy. Instead of going up onto the highway, on an impulse, I drove west through the city, looking for a slow route home. I meandered through the colorful, off-beat Mission District until I happened on a hole-in-the-wall sushi place called Yo's Sushi Club. It felt authentic, with a clean, very Japanese aesthetic. The chef, Yo, stood behind the counter, a white towel wrapped tight around his bald head. There was no bento or teriyaki on the menu, just sushi, and I watched as Yo made all the sushi himself. The chirashi was delicious. I ate slowly, then rode the rest of the way down Mission until I found myself on the hilltop at Daly City. It was starting to cool off by the time I made my way to the road across the mountain, and saw the lights of San Francisco spread out north of me as I wound through the pass.
I've got to take the long way home more often. I hope the weather stays nice! If it's clear, tomorrow night I'm going with some friends out past Livermore in the east bay, and we're going to watch the meteor shower.
Sunday, April 19, 2009
If I had a million dollars...
A recurring theme of me-at-work, pretty much ever since I started working when I was 15, is the thought, Sigh...if only I had a few million dollars, so I could do X instead of this... Today, it struck me that, if I was independently wealthy and could do whatever I wanted, I probably would spend my time doing what I did today. I'd find somewhere quiet to sit, and learn some new physics.
On top of that, I found out a couple of weeks ago that I won a competition for a federal research fellowship, so I'll get an extra $4000 or so per year to do exactly what I'd be doing anyway, with no strings attached. (I worked out the total value of the fellowship, and was surprised at how large it is: it pays for everything for three years, which comes out to be around $150,000!) As an additional bonus, it's considered very prestigious, looks good on a CV, etc. (not that I'll be applying for jobs anytime soon...).
I hesitate to say so, but I feel honestly satisfied with the way things are going. It's the first time I've felt this way in a long time, so it's a bit alien to me, but...I'm happy. (On a related note, I also feel completely vindicated in my decision to switch research groups.)
Thursday, April 02, 2009
Everyone loves grad school!
2:49:47 PM Gheed: man grad school blows though
2:49:50 PM Me: lol
2:50:00 PM Me: WUT DO U MEAN IT'S AWESOME
2:50:01 PM Me: :\
2:50:51 PM Gheed: >:o
2:51:08 PM Me: >:o indeed
2:51:22 PM Gheed: u have any idea how useful a "masters of science" degree is?
2:51:29 PM Me: i wake up every morning and think to myself: >:o
2:51:47 PM Me: i do not
2:51:51 PM Me: inform me immediately
2:52:23 PM Me: btw i do a lot of >:o while i'm at work too
2:52:31 PM Me: then when i get home i'm all like >:o
2:52:45 PM Gheed: lol yeah that face sums me up pretty well too
2:52:47 PM Gheed: >:o
2:53:04 PM Me: there's a few :\ and :( thrown in there for good measure, too
2:53:12 PM Me: but for the most part it's all about the >:o
2:53:28 PM Gheed: >:o
2:53:32 PM Me: >:o
Thursday, March 26, 2009
Counting things
A simple way of thinking about diffusion is to imagine the cup is composed of a large set of very small blocks, big enough to hold a salt ion. Each block may be filled or empty. (This is called a lattice model.) If there is no bias built in to the particles, the probability of each system arrangement should be equal. An even distribution of particles is the most probable system configuration because it contains the highest number of total possible arrangements.
To see this, imagine there are four salt particles in a very small cup, and we partition the cup into four little boxes in the left half, and four more in the right. How many ways are there to have all four particles on the left side, and none on the right? Assuming the particles are indistinguishable (that is, we don't care what order they're in), since there are only four boxes, there is only 1 system configuration that has all four particles on the left side. On the other hand, there are 6 different ways to arrange the particles to have 2 on the left side and 2 on the right. If each individual arrangement is equally likely, the most probable state in which to find the system is with 2 particles on the left, and 2 on the right. To be precise, this would be six times more likely than having all the salt on one side! (Mathematically, these are just binomial coefficients, so if you're lazy like me and don't like doing a bunch of counting, you can get the number of arrangements by reading across the fifth row of Pascal's triangle, 1 4 6 4 1.)
The idea of maximizing the number of states is central to statistical mechanics. The number of states (or, more specifically, its natural logarithm) is a measure of the amount of disorder, or entropy, in a system. One of most important conclusions of thermodynamics is that in a system with a conserved amount of total energy (and number of particles, taking the classical view that these are distinct items), its entropy will always increase. (This has a number of interesting, and disquieting, implications for, for example, the future of our universe, if it is an isolated system.) This counting approach is a microscopic model for systems at equilibrium, but in a real system -- e.g., a real-life cup of water -- of course we don't sit there and count the number of salt ions in the cup. In one gram of table salt, there's around 3.6x1025 pairs of sodium and chloride ions. This is a ridiculously huge number: it's 36 followed by 24 zeros, or 36 trillion trillion ions in a single gram. If you consider the number of arrangements of 36 trillion trillion ions where all the ions are on one side of the cup (total: 1), versus the number of arrangements where they are approximately equally distributed (total: a stupidly big number), it's clear that in this simple lattice model, generally all the salt is not going to be on one side of the cup!
Instead of counting trillions of ions, instead what we measure are macroscopic quantities -- for example, the average concentration of ions on each side of the cup. If we take this measurement, and discover that there's actually a higher concentration on the right side than the left on average, then that tells us something about our system: it gives us a constraint that we can use to weight the entropy calculation we did before. As mentioned before, if our system contains 36 trillion trillion particles, we're probably only going to be interested in average quantities, since the stupidly big number-of-states will make shifts away from the average very improbable: the probability distribution, in this case, will be approximately Gaussian (a bell curve), with a tiny standard deviation. But, what about our oversimplified tiny cup with only four particles of salt in it? In that case, there's a 1 in 6 chance of finding all the salt on one side of the cup! Given this non-negligibly small probability, for very small systems, the microscopic fluctuations can be important. That is to say, we're interested in how the system evolves with time -- we care about its dynamics.
Let's go back to our tiny cup, and start with 2 particles on the left side, and 2 on the right. Assume there's no bias built in to the system, and that every particle is independent of the others, so that each particle has some fixed probability of jumping to the other side. The sequence of jumps and stays that a particle follows over a period of time is called its trajectory. If there are no constraints on the system, we'd predict that every trajectory is equally likely, and if we tabulate the number of trajectories that result in 0, 1, or 2 particles jumping, 6 out of 16 trajectories result in 2 particles on the left, and 2 on the right (the same result as before). However, the table also says that there is a 1 in 16 chance for 2 particles to jump from left to right, and 0 to jump from right to left, putting all the salt on one side of the cup! For a given starting distribution of particles, this quantifies how the system's fluctuations are likely to alter the overall state of the system with time, and also how the fluctuations themselves are likely to change over time. A system's trajectory multiplicity is called its caliber.
We think that the idea of maximum caliber will be a useful way to analyze systems far from equilibrium, very small systems, as well as highly correlated systems. All three are true of many biological systems, and one system I'm particularly interested in applying maximum caliber to is long term potentiation, the way we form memories. My short-term project is a little farther afield: I'd like to apply caliber to correlated stock prices, and see if the predicted fluctuations in the stock market correspond to what's actually been observed. Because stock prices can be highly correlated, the independent-particle assumption does not work, which is why random-walk statistics do not accurately describe the probability of large fluctuations in the market. Instead, markets approximately follow an inverse quartic power law, but as far as I'm aware, no one's provided a quantitative, microscopic explanation for this. It will be interesting to see if a power law distribution follows naturally from thinking about the caliber of the market.
Monday, March 23, 2009
An anecdote
He grinned at me. "That's fine. Work at your own pace."
I returned the grin. Suddenly, the future looks very bright.
