Extracting information from data, often also called data analysis, is an important scienti c task. Statistical approaches, which use methods from probability theory and numerical analysis, are wellfounded but di cult to implement: the development of a statistical data analysis program for any given application is time-consuming and requires knowledge and experience in several areas. In this paper, we describe AutoBayes, a high-level generator system for data analysis programs from statistical models. A statistical model speci es the properties for each problem variable i.e., observation or parameter and its dependencies in the form of a probability distribution. It is thus a fully declarative problem description, similar in spirit to a set of di erential equations. From this model, AutoBayes generates optimized and fully commented C C++ code which can be linked dynamically into the Matlab and Octave environments. Code is generated by schema-guided deductive synthesis. A schema consists...