2007-12-25

ruminations on mcmc storage

DBI provides a connection manager that the thing looks up against when a db-specific call is made. Here is an example of closing the connection in rmysql:
s_object * 
RS_MySQL_closeConnection(Con_Handle *conHandle)
{
    S_EVALUATOR
  
    RS_DBI_connection *con;
    MYSQL *my_connection;
    s_object *status;
  
    con = RS_DBI_getConnection(conHandle);
.
.
.  
    my_connection = (MYSQL *) con->drvConnection;
    mysql_close(my_connection);

…

}
and the same thing from rsqlite:
SEXP
RS_SQLite_closeConnection(Con_Handle conHandle)
{
  RS_DBI_connection *con;
  sqlite3 *db_connection;
  SEXP status;
  int      rc;

  con = RS_DBI_getConnection(conHandle);
  db_connection = (sqlite3 *) con->drvConnection;

  rc = sqlite3_close(db_connection);  /* it also frees db_connection */

.
.
.

  return status;
}
and here's RS_MySQL_exec to run a generic query.
    /* Here is where we actually run the query */
    state = mysql_query(my_connection, dyn_statement);
    if(state) { 
        char errMsg[256];
        free(dyn_statement);
        (void) sprintf(errMsg, "could not run statement: %s",
                  mysql_error(my_connection));
        RS_DBI_errorMessage(errMsg, RS_DBI_ERROR);
    }
So it looks like: 1) new storage.h will need include configure options for whether to include rs-dbi.h, rs-mysql.h, and rs-sqlite.h, defaulting to all of the above. 2) MCMCstore will be templated for each storagetype. 3) the connection will be opened from R, when tables are created, then the connection id passed to the model-fitting c++ code. The model-fitting code will initialize an object of class MCMCstore. The MCMCstore class store() function will call appropriate db-specific code (sqlite_bind_double, whatever mysql bind syntax is, insert, exec, reset,… etc.).

2007-12-24

fuck louis vuitton

Among the offerings, a handful dominate: Moët & Chandon and Veuve Clicquot together account for 55 percent of Champagne sold in the United States. These two blockbuster brands, along with Krug, Ruinart and Mercier, are owned by the luxury giant LVMH. In fact, the top Champagne brands are almost all owned by conglomerates, which churn out millions of bottles annually while spending heavily to market an image of luxury.

2007-12-23

things to make

  • aloo gobi, garlic naan
  • Bolognese
  • jeweled rice, lamb (1,2)
  • chicken marsala; risotto or polenta
  • tiramisù
  • lamb-apple brat
  • chicken paprikás & spätzle
  • green lentil soup
  • potato-chorizo soup
  • borszch, crusty bread
  • falafel
potential newyears items
  • falafel
  • tiramisù
  • pumpkin soup?
  • cocktail-samosas
  • some form of sweet potato
  • stuffed eggs

Lili's favorite brand sauce bases

spicy king / superlucky

2007-12-22

end of winter csa

The end of our Nov–Dec Vicki CSA is here, and we were able because of travel to get last week’s box and this week’s together. So we now have an abundance of root vegetables, four dozen eggs (er, well, after brunch… a little less than 3dz), and a lot of apples.
  • lots of carrots
  • red potatoes
  • broccoli
  • beets
  • turnips
  • onions
  • sweet potatoes
  • chard
  • apples

2007-12-20

Next on my list of things to code

Kinney, S. K. and D. B. Dunson (2007), “Fixed and random effects selection in linear and logistic models,” Biometrics (63), 690–698. (PDF; R code)
We also compute credible intervals for the random effects variances; whereas, there is no good approach for estimating uncertainty for PQL [penalized quasi-likelihood] variance estimates, or other frequentist variance estimates. In addition we are able to simultaneously compute marginal posterior inclusion probabilities for both the fixed effects and random effects and correctly locate the true model as the one with highest posterior probability.

2007-12-18

crazy american policy bundles


and crazy Ron Paul, from motherjones.

some LTH roundup from today

lamb cumin hotpot at double li, img by gwiv
chicken mushroom hotpot at springworld

Threadless is amazing

Just when I think I am satisfied with a nice collection of fun tshirts comes along something that I don't think I can live without.

2007-12-16

apsa: check.

This is a confirmation email to let you know that your 2008 Annual Meeting paper proposal has been received by APSA.

PROPOSAL TITLE: Unmasking the ECJ: National Governemnts, Appointment, and Strategic Justices

PAPER ABSTRACT: Rulings of the European Court of Justice have profoundly affected member states, national governments, and European citizens. The court by some accounts has seized power and overstepped its bounds, or by others, duly done its delegated duty. Almost always “the Court” is treated as an agent of the member-state principals. I argue that member states view not the full Court, but their individual appointed justice, as their agent – despite the court's mask of formalism and the secrecy afforded by its en banc decisions. I show that governments use their power of appointment as a measure of control over the ECJ. I propose a dynamic measure of justices’ preferences that exploits the fact that while justice-votes are unobserved, the organization of the court into panels (subsets) systematically reveals information about individual voting behavior. I show that justices are re-appointed or replaced as functions of information available to the national governments who appoint them. Finally, I explore the role that member state “observations” (briefs submitted to the court) play in justices' decisionmaking, and in terms of what national governments learn from tendering observations and then seeing the court’s ruling.
Submitted to the following divisions:
Div 14 Div. 14 - Comparative Politics of Advanced Industrial Societies
Div 11 Div. 11 - Comparative Politics

2007-12-08

things to make

  • green curry with chicken and eggplants
  • prik khing with chicken or beef and longbeans
  • leang soup with bamboo shoot, mushroom
  • salad of cilantro, mint, tomato, mung bean sprouts, dried shrimp
  • cabbage sprouts and tofu with oyster sauce
  • a vegetable lasagna for the freezer (spinach, mushrooms, ricotta)
  • smoked chicken tamales
  • pan fried tofu with marsala cream sauce; salad of romaine, pomegranate, satsuma