The economic model of suicide: when the expected future utility stream turns negative and looks to be persistently so, or negative enough for a short period, you set it to zero instead. You can add in lots of stuff about how depression or mental illness can bias the expected future utility stream, or about irrationality in response to short term shocks, but my first-cut thought on hearing of suicide is to wonder what made the expected future utility stream seem sufficiently terrible that setting it to zero was preferable.
In the Aaron Swartz case, which has been ably and thoroughly discussed by people far closer to the case than me, it seems to have been the prospect of prison: a bullying prosecutor was insisting on a prison sentence for a relatively minor transgression, likely to make a point about how the State-Is-The-Boss-Of-You-And-Don't-You-Dare-Think-Otherwise.
I've seen lots of very appropriate wondering about prosecutorial discretion and just what the American justice system is turning into if a guy like Swartz could have been up for a prison sentence.
But what about everybody else - people who weren't as heroic as Swartz and not as worthy of laudatory accounts from around the web? Any justice system will accidentally convict at least a few innocent people. Should prison conditions really be such that gentle people can prefer suicide?
I wonder if we ought not give greater consideration to Peter Moskos's modest proposal for penal reform. I hope that the system is fixed so that cases like Swartz's do not lead to prosecutorial bullying. But even absent that kind of bullying, and it's best-case thinking to think it can be eliminated, peaceful people will continue to be jailed for small mistakes, or for things that ought not be considered crimes in the first place. And we have decent evidence (ungated version) that harsher prison conditions worsen recidivism anyway.
The conditions that Swartz seems to have deemed worse than death are home to about 1.6 million Americans.
Things could be worse though; at least real-world prisons don't have Azkaban's Dementors. Yudkowski nicely makes the case for penal reform of Magical Britain in Harry Potter and the Methods of Rationality - about two thirds of the way through Chapter 62...