Skip to main content
If you continue browsing this website, you agree to our policies:
  • Condizioni di utilizzo e trattamento dei dati
Continue
x
e-Learning - UNIMIB
  • Home
  • Calendar
  • My Media
  • More
Listen to this page using ReadSpeaker
English ‎(en)‎
English ‎(en)‎ Italiano ‎(it)‎
You are currently using guest access
 Log in
e-Learning - UNIMIB
Home Calendar My Media
Percorso della pagina
  1. Economics
  2. Master Degree
  3. Biostatistica [F8205B - F8203B]
  4. Courses
  5. A.A. 2025-2026
  6. 2nd year
  1. Bayesian Inference
  2. Summary
Unità didattica Course full name
Bayesian Inference
Course ID number
2526-2-F8203B042-F8203B042M
Course summary SYLLABUS

Blocks

Back to Statistical Models and Bayesian Inference

Course Syllabus

  • Italiano ‎(it)‎
  • English ‎(en)‎
Export

Obiettivi formativi

L’insegnamento rientra nelle aree di apprendimento delle scienze statistiche, dell’informatica e delle scienze sociali e permette allo studente di apprendere le procedure analitiche ed inferenziali in ambito Bayesiano. Il ragionamento Bayesiano viene presentato in modo integrato con l’approccio all’inferenza statistica sviluppato in senso classico. L’attività formativa permette agli studenti di acquisire solidi elementi di teoria Bayesiana, di sviluppare le applicazioni attraverso un approccio di “problem solving” con dati reali e simulati in riferimento a problemi applicativi inerenti alla biostatistica. Lo studente acquisisce anche abilità comunicative testuali scritte in quanto è richiesta la stesura di testi a completamento dei risultati ottenuti dalle analisi svolte.

Conoscenza e comprensione

Lo studente viene introdotto ai principali modelli statistici Bayesiani per l’analisi di dati con diverse tipologie di variabili risposta, alle ipotesi sottostanti tali modelli e ai modelli per l’analisi dei dati longitudinali. Acquisisce inoltre la comprensione delle procedure Markov Chain Monte Carlo e dei relativi algoritmi di stima, nonché la capacità di valutarne l’efficacia.
Lo studente viene anche introdotto al linguaggio di programmazione R, nell’ambiente RMarkdown, che consente di creare documenti riproducibili contenenti codice, risultati, commenti e specifiche procedure per l’analisi Bayesiana tramite il software SAS.
Gli esempi applicativi riguardano dati reali e simulati provenienti da diversi ambiti di riferimento del corso di studi. Lo studente apprende inoltre a fornire una descrizione scritta dei risultati ottenuti alla luce delle domande di ricerca, insieme a una valutazione critica dei limiti delle analisi svolte. In questo modo sviluppa autonomia di giudizio e affina le proprie abilità comunicative, sia nella presentazione sia nella giustificazione dei procedimenti adottati per le analisi, sia nell’illustrazione dei risultati ottenuti in relazione alle domande di ricerca.

Capacità di applicare conoscenza e comprensione

L’insegnamento fornisce competenze nell'utilizzo dei modelli bayesiani coniugati, nella scelta delle distribuzioni a priori e nell’impiego degli algoritmi di stima per modelli complessi.
Attraverso l’ambiente R e RStudio, gli studenti imparano a impostare in modo organico il ragionamento statistico, mediante l’analisi dei dati e la redazione di relazioni che illustrino il codice, le analisi e i risultati.
Con l’uso del software SAS, gli studenti apprendono a stimare modelli bayesiani complessi tramite simulazioni e a impostare correttamente gli input richiesti dagli algoritmi di stima.
L’insegnamento consente agli studenti di acquisire solide basi teoriche e la capacità di applicare i modelli statistici presentati a dati reali. Gli studenti sono in grado di valutare il modello più appropriato in base ai dati disponibili e alle domande di ricerca. Imparano inoltre a scrivere e commentare il codice utilizzato per generare i risultati, adottando un approccio open source che garantisca la riproducibilità e la replicabilità delle analisi.
Al termine dell’insegnamento, grazie al materiale fornito (le dispense del docente corredate da un’ampia bibliografia, i codici per i software R e SAS e l’interfaccia RMarkdown), lo studente è in grado di proseguire in modo autonomo nell’approfondimento di questa disciplina.

L’insegnamento è indispensabile per il successivo percorso universitario in quanto fornisce i concetti essenziali per lo sviluppo dei metodi Bayesiani sia attraverso solide basi teoriche che applicative per i contesti lavorativi di sbocco (biostatistico/statistico/demografico e affini) degli studenti del corso di laurea in Biostatistica.

Contenuti sintetici

Introduzione all’inferenza Bayesiana e alla regola di Bayes.

Metodi di specificazione del modello e delle distribuzioni a priori.

Famiglie coniugate: Gaussiana, Poisson-gamma, beta-binomiale, multinomiale-Dirichelet .

Inferenza Bayesiana non parametrica.

Metodi di sintesi della distribuzione a posteriori, regioni di credibilità e intervalli con la massima densità a posteriori.

Introduzione ai processi stocastici di Markov e proprietà delle catene di Markov.

Modello passeggiata casuale. Modello di transizione per dati longitudinali.

Modello di Markov a variabili latenti per dati longitudinali ed estensioni del modello con covariate sia nel modello osservato che nel modello latente.

Metodi Markov Chain Monte Carlo: Algoritmo Metropolis-Hastings e campionamento Gibbs.

Test diagnostici per la convergenza.

Esercitazioni svolte in relazione a specifici problemi applicativi utilizzando l’ambiente R, RStudio con il maratore di testo RMarkdown ed il software SAS.

Programma esteso

Durante l’insegnamento viene ripresa la regola di Bayes e la regola delle probabilità totali attraverso l’esempio del Bayes'billard. Vengono sviluppati gli aspetti riguardanti la specificazione delle distribuzioni a priori, la stima esatta delle distribuzioni a posteriori e l’interpretazione dei modelli. Viene introdotto il modello beta-binomiale e altre famiglie coniugate: Gaussiana, modello Poisson-gamma, multinomiale-Dirichlet e enfasi viene posta anche sulla distribuzione predittiva. L’inferenza puntuale Bayesiana viene confrontata l’inferenza intesa in senso classico. Vengono illustrate le caratteristiche di scelta e di determinazione della distribuzione a priori sia informativa che non informativa. La nozione di scambiabilità viene illustrata attraverso il teorema di rappresentazione di De Finetti. La distribuzione a posteriori viene sintetizzata attraverso le regioni di credibilità, e gli intervalli con la massima densità a posteriori.

Vengono introdotti i processi stocastici Markoviani enunciando le proprietà e le caratteristiche delle catene di Markov. La passeggiata casuale viene illustrata attraverso le simulazioni delle traiettorie per matrici stocastiche con diverse dimensioni. Viene introdotto il modello di transizione per dati longitudinali, ed il modello latente di Markov. Vengono illustrati anche da un punto di vista computazionale gli algoritmi di stima utilizzati nell’ambito del metodo Markov Chain Monte Carlo (MCMC) per approssimare la distribuzione a posteriori: l’algoritmo Metropolis-Hastings e l’algoritmo Gibbs sampling. Vengono discusse diverse misure riferite sia alle analisi grafiche che ai test statistici che permettono la valutazione diagnostica della convergenza.

La teoria viene affiancata da svariati esempi di applicazione dei modelli Bayesiani nell’ambito della biostatistica attraverso dati reali e simulati riguardanti l’epidemiologia, la farmacoepidemiologia, la medicina e la biologia oltre che l’ecologia e le scienze ambientali. Si intende inoltre facilitare lo sviluppo della conoscenza della semantica in ambiente R e del software SAS. Gli esempi sono svolti in Rstudio con l’ausilio di RMarkdown. Lo studente durante le esercitazioni è incoraggiato, anche tramite l’apprendimento cooperativo, ad elaborare documenti riproducibili concernenti anche il commento critico ai risultati delle analisi. Vengono utilizzati sia l’ambiente R e Rstudio, e seguenti principali pacchetti: probBayes, learnBayes, LMest, LaplaceDemon, RMarkdown attraverso la libreria knitr per integrare il codice, i risultati delle analisi ed i commenti. L’analisi con il software SAS viene svolta attraverso la libreria proc MCMC.

Prerequisiti

Si consiglia di riprendere le nozioni impartite nei seguenti insegnamenti: Statistica, Probabilità e Inferenza Statistica, Modelli Statistici II.

Metodi didattici

Sono previste lezioni frontali svolte in modalità erogativa in presenza riguardano la parte di teoria e sono affiancate da esercitazioni pratiche. Le lezioni sono impartite presso il laboratorio informatico. Durante l’attività formativa con l'ausilio di R nell'ambiente RStudio, con il marcatore di testo RMarkdown oppure del software SAS, gli studenti imparano ad analizzare i datil, a stimare i modelli Bayesiani e a corredare le analisi con i commenti, elaborando documenti che permettono di replicare le analisi e riprodurre i risultati. Settimanalmente vengono assegnati esercizi di riepilogo da svolgere con dati reali o simulati dove gli studenti vengono incoraggiati ad affrontare il problema applicativo riferito all’ambito teorico illustrato a lezione con lo scopo ulteriore di sviluppare l'apprendimento cooperativo. Le ore previste di didattica erogativa sono 30 e quelle di didattica interattiva sono 17. Le lezioni da 3 ore in particolare sono svolte nella seconda parte in modo da coinvolgere gli studenti in modo interattivo. Le esercitazioni sono svolte in modalità interattiva in presenza presso il laboratorio informatico. Vengono rese disponibili nella pagina di e-elearning le video-registrazioni in asincrono sia delle lezioni che delle esercitazioni.

Modalità di verifica dell'apprendimento

Le seguenti modalità di verifica dell'apprendimento si applicano sia agli studenti frequentanti sia a quelli non frequentanti le lezioni frontali. L’esame è in forma scritta, con domande aperte, e include un colloquio orale facoltativo. Non sono previste prove intermedie.
La prova scritta ha una durata massima di due ore e si svolge in laboratorio informatico. Durante l'esame, gli studenti devono rispondere a domande aperte di teoria e risolvere esercizi applicativi, basandosi sugli argomenti teorici trattati e sulle esercitazioni pratiche assegnate settimanalmente.
Le domande di teoria mirano a valutare la comprensione dei concetti fondamentali dell’inferenza statistica bayesiana con metodi avanzati. Le analisi empiriche, condotte utilizzando l’ambiente R, RStudio, RMarkdown e il software SAS, consentono di verificare la capacità degli studenti di applicare modelli statistici bayesiani a dati reali o simulati, nonché di redigere report riproducibili che descrivano i dati, le procedure e i risultati ottenuti.
La prova è finalizzata a valutare la capacità dello studente di affrontare le problematiche oggetto di studio, di utilizzare il codice fornito e di comunicare in modo chiaro i risultati raggiunti, oltre a saper gestire efficacemente il tempo a disposizione.
Durante l'esame è consentito l'uso del materiale di studio e di quello fornito dal docente, compresi i codici R e SAS implementati durante lo svolgimento dell’attività didattica. Ogni punto di ogni esercizio ha una valutazione di circa 3 punti. L'esame si considera superato con una votazione minima di 18/30.

Testi di riferimento

Il materiale didattico principale consiste nelle dispense preparate dal docente, che coprono, gli argomenti teorici, le applicazioni sviluppate con il software R, gli esercizi e le soluzioni. Queste dispense saranno rese disponibili sulla pagina della piattaforma e-learning dell'università dedicata all’insegnamento. Inoltre, il docente pubblica alla fine di ogni lezione le slides, i programmi di calcolo e i dataset utilizzati. Settimanalmente vengono assegnati esercizi, e le relative soluzioni. Sulla stessa pagina web sono disponibili degli esempi di alcuni testi d'esame.

I riferimenti bibliografici principali sono elencati nella bibliografia delle dispense. I principali sono elencati nel seguito e risultano disponibili presso la biblioteca di Ateneo anche in formato ebook:

Albert, J. (2009). Bayesian computation with R. Springer Science & Business Media.

Albert, J., Hu, J. (2019). Probability and Bayesian modeling. Chapman and Hall/CRC.

Bartolucci, F., Farcomeni, A., Pennoni, F. (2013). Latent Markov Models for longitudinal data, Chapman and Hall/CRC, Boca Raton.

Migon, H. S., Gamerman, D., Louzada, F. (2014). Statistical inference: an integrated approach. Chapman & Hall.

Periodo di erogazione dell'insegnamento

1° semestre, Ciclo II, Novembre 2025 - Gennaio 2026

Lingua di insegnamento

L’insegnamento viene erogato in lingua italiana. Gli studenti Erasmus possono utilizzare il materiale didattico predisposto in lingua inglese e fornito dal docente su richiesta. Possono inoltre richiedere di svolgere la prova d’esame in lingua inglese.

Sustainable Development Goals

SALUTE E BENESSERE | ISTRUZIONE DI QUALITÁ
Export

Learning objectives

The course falls within the areas of learning in statistical sciences, computer science, and social sciences.
It enables students to learn analytical and inferential procedures within the Bayesian framework. Bayesian reasoning is presented in an integrated manner alongside the classical approach to statistical inference.
The course provides students with a solid foundation in Bayesian theory and fosters the development of applications through a problem-solving approach using real and simulated data, particularly in relation to applied problems in biostatistics. Students also acquire written communication skills, as they are required to write reports to accompany the results of the analyses performed.

Knowledge and understanding

Students are introduced to the main Bayesian statistical models for the analysis of data with different types of response variables, the assumptions underlying these models, and models for longitudinal data analysis.
They also develop an understanding of Markov Chain Monte Carlo (MCMC) procedures and the related estimation algorithms, as well as the ability to assess their effectiveness.
Furthermore, students are introduced to the R programming language within the RMarkdown environment, which enables them to create reproducible documents containing code, results, comments, and specific procedures for Bayesian analysis using SAS software.
Applied examples are based on real and simulated data from various fields relevant to the degree program. Students also learn how to write a structured report of the results obtained, considering the research questions, and to critically evaluate the limitations of the analyses carried out.
In this way, they develop independent judgment and refine their communication skills, both in presenting and justifying the analytical procedures adopted and in illustrating the results obtained in relation to the research questions.

Ability to apply knowledge and understanding

The course provides skills in the use of conjugate Bayesian models, in selecting prior distributions, and in employing estimation algorithms for complex models.
Through R and RStudio, students learn to structure statistical reasoning in an organized way, by analyzing data and drafting reports that explain the code, the analyses, and the results.
Using SAS software, students learn to estimate complex Bayesian models through simulations and to correctly configure the input required by estimation algorithms.
The course enables students to acquire a solid theoretical foundation and the ability to apply the statistical models introduced to real data. Students learn to evaluate the most appropriate model based on the available data and research questions.
They also learn to write and comment on the code used to generate results, adopting an open-source approach to ensure the reproducibility and replicability of their analyses.
By the end of the course, with the support of the provided materials—namely the instructor’s lecture notes with a comprehensive bibliography, the R and SAS code, and the RMarkdown interface—students are able to independently pursue further study of this discipline.

This teaching is fundamental for the subsequent university course as it provides essential concepts for the development of Bayesian methods in both theoretical and applied fields, relevant to the target job contexts (biostatistics/statistics/demography and related fields) of students in the Biostatistics degree course.

Contents

Introduction to Bayesian inference and Bayes' rule. Methods of model specification and prior distributions.

Determination of the posterior distribution by exact methods.

Conjugate families: Gaussian, Poisson-gamma, beta-binomial, multinomial-Dirichelet.

Introduction to Bayesian non-parametric inference.

Methods to summarize the posterior distribution: credibility intervals and intervals with the highest posterior density.

Introduction to stochastic Markov processes, random walk.

Markov chain models for longitudinal data and latent Markov models with covariates.

Introduction to the Markov Chain Monte Carlo Methods: Metropolis-Hastings algorithm and Gibbs sampler.

Diagnostic tools to assess convergence of the MCMC procedure.

R environment and RStudio interface using, in particular, the following libraries: probBayes, learnBayes, LMest, LaplaceDemon.

RMarkdown will be employed to produce reproducible documents and to integrate code and output within the knitr library. SAS software with proc MCMC.

Detailed program

The Bayesian paradigm is introduced and compared with the frequentist approach, including Bayes’rule, and the total probability rule. A short introduction to Bayesian non-parametric methods is provided, and the notions of exchangeability and De Finetti’s theorem are explained. The beta-binomial model and the other conjugate families such as Gaussian, Poisson-gamma, beta-binomial, and multinomial-Dirichlet distributions, are introduced. The choice of the prior distribution is considered. Inference is compared with the classical approach. Methods to draw conclusions from the posterior distribution include Bayesian interval estimation, credible intervals, and intervals with the highest posterior density. The prediction context is also explored along with the empirical Bayes estimation.
Several examples of the application of Bayesian models in biostatistics, using real and simulated data concerning epidemiology, drug epidemiology, medicine and biology, ecology, and environmental sciences support the theory.

An introduction to stochastic processes within the Markov random field is proposed. The properties and features of the Markov chains are illustrated and explained using simulations. The random walk process is also described. Markov chain models for longitudinal data are explained, and the latent Markov models with covariates are introduced both from a theoretical and applied perspective.
Markov Chain Monte Carlo (MCMC) algorithms are explained with a focus on Metropolis-Hastings and Gibbs sampling algorithms. Diagnostic evaluations of the convergence are considered.

Some time is devoted to explaining the theory by imparting the flavor of the applications using observed data arising from different fields. The examples are developed within the statistical environment R, RStudio, and RMarkdown to create reproducible documents. The SAS software is proposed to perform analyses to estimate Bayesian linear and logistic models using PROC MCMC. During exercises, students are encouraged, also through collaborative learning, to develop reproducible documents concerning critical comments on the results of the analyses.

Prerequisites

The student is encouraged to know the content of the following courses: Statistics, Probability, and Statistical Inference and Statistical Models II.

Teaching methods

The lectures are held in the lab and the theoretical part is developed with applications carried out using R and SAS software. Many practical examples based on real and simulated are proposed, enabling students to learn data analysis and Bayesian modeling using R through the RMarkdown interface and SAS software. They are also encouraged to engage in collaborative learning and interact with their peers and finalize the required steps of the analysis. Weekly summarizing exercises are assigned, which involve applying the proposed models to real or simulated data. During the course, with the help of R in the RStudio environment and the RMarkdown interface, students learn to create reproducible documents. The scheduled hours for lecture-based teaching are 30, while those for interactive teaching are 17. The 3-hour lessons, in particular, are structured so that the second part involves students in an interactive manner.
Exercises are conducted interactively and in person at the computer lab.
Asynchronous video recordings of both the lectures and the exercises are made available on the e-learning platform.

Assessment methods

The following assessment methods apply to both attending and non-attending students. The exam is written, with open-ended questions, and includes an optional oral interview. No midterm exams are scheduled.
The written exam has a maximum duration of two hours and takes place in the computer lab. During the exam, students must answer open-ended theoretical questions and solve applied exercises, based on the theoretical topics covered and the practical exercises assigned weekly throughout the course.
The theoretical questions aim to assess the understanding of fundamental concepts in Bayesian statistical inference using advanced methods.
Empirical analyses, conducted using the R environment, RStudio, RMarkdown, and SAS software, are used to evaluate the students' ability to apply Bayesian statistical models to real or simulated data, as well as to produce reproducible reports describing the data, procedures, and results.
The exam is designed to assess the student's ability to address the issues under study, use the provided code, and clearly communicate the results achieved, in addition to managing the available time effectively.
During the exam, the use of study materials and resources provided by the instructor is allowed, including R and SAS code developed during the course.
Each question is worth 3 points. The exam is considered passed with a minimum score of 18 out of 30.

Textbooks and Reading Materials

The teaching material consists mainly of handouts prepared by the teacher. These cover theory, applications, exercise and solutions developed with R software. All the files are available on the course page of the university's e-learning platform. In addition, the teacher publishes the following material at the end of each lesson: slides, R and SAS code, exercises, datasets, and solutions to some of the exercises. Previous exam texts are also published on the same page.

The main references are listed in the bibliography of the handouts, some of which are the following and are available in the university library, also in ebook format:

Albert, J. (2009). Bayesian computation with R. Springer Science & Business Media.

Albert, J., Hu, J. (2019). Probability and Bayesian modeling. Chapman and Hall/CRC.

Bartolucci, F., Farcomeni, A., Pennoni, F. (2013). Latent Markov Models for longitudinal data, Chapman and Hall/CRC, Boca Raton.

Migon, H. S., Gamerman, D., Louzada, F. (2014). Statistical inference: an integrated approach. Chapman & Hall.

Pennoni, F. (2024). Dispensa di Inferenza Bayesiana: Teoria e Applicazioni con R e SAS. Dipartimento di Statistica e Metodi Quantitativi, Università degli Studi di Milano-Bicocca.

Robert, C., Casella, G. (2004). Monte Carlo Statistical Methods (second edition). Springer–Verlag, New York. Dipak, D. K., Ghosh, S. K., Mallick, B. K. (2000). Generalized linear models: A Bayesian perspective. CRC press.

SAS/STAT PROC MCMC, User’s guide, SAS Institute, 2012.

R Core Team (2023). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/

Semester

Semester I, cycle II, November 2025-January 2026

Teaching language

The course is delivered in Italian. Erasmus students may use the teaching material in English and request the teacher to conduct the examination in English.

Sustainable Development Goals

GOOD HEALTH AND WELL-BEING | QUALITY EDUCATION
Enter

Key information

Field of research
MAT/06
ECTS
6
Term
First semester
Activity type
Mandatory
Course Length (Hours)
47
Degree Course Type
2-year Master Degreee
Language
Italian

Staff

    Teacher

  • LB
    Luca Brusa
  • Fulvia Pennoni
    Fulvia Pennoni

Enrolment methods

Manual enrolments

Sustainable Development Goals

GOOD HEALTH AND WELL-BEING - Ensure healthy lives and promote well-being for all at all ages
GOOD HEALTH AND WELL-BEING
QUALITY EDUCATION - Ensure inclusive and equitable quality education and promote lifelong learning opportunities for all
QUALITY EDUCATION

You are currently using guest access (Log in)
Policies
Get the mobile app
Powered by Moodle
© 2025 Università degli Studi di Milano-Bicocca
  • Privacy policy
  • Accessibility
  • Statistics