BIOphysics & SOFT Matter Department of Ultrafast Optics and Nanophotonics

Institut de Physique et Chimie des Matériaux de Strasbourg

[ -- Internship Proposals -- ]
ABOUT

A blog for physicists or biologists. Mainly for experimentalists interested in Statistics. R scripts detailed and explained.


CONTACT

wilfried.grangeu-paris.fr

Associate Professor at Université de Paris

Home Page


TAGS (on this page)


Change point Detection Part III

Posted 2020-12-22 by Wilfried. Post 12 of 12.
LikelihoodHypothesis_Testing AIC

Change point detection. Part III : multiple change points and states


In a time series, change point detection tries to identify abrupt changes. In a previous post we have learned how to identify single change points using likelihood estimates and AIC values. Here, I show how to identify multiple change points states (i.e. statistically identical data).

# packages
rm(list=ls()) # clear memory
if (!require(ggplot2)) install.packages('ggplot2')

Read More [...]

Is it all about Statistics ?

Posted 2020-12-15 by Wilfried. Post 11 of 12.
tidyversegraphs Fitting

R is not just for statistics. It is also a powerful tool for manipulating and displaying data.


I have the feeling that students sometimes think R is just for statistics. But R is also a perfect environment for organizing and displaying data without doing fancy statistics. That is what I show here using real data and taking advantage of the famous yet powerful package tidyverse.

rm(list = ls())
if (!require(tidyverse)) install.packages('tidyverse')

Read More [...]

Change point Detection Part II

Posted 2020-12-05 by Wilfried. Post 10 of 12.
LikelihoodHypothesis_Testing AIC

Change point detection. Part II : maximum likelihood estimates


In a time series, change point detection tries to identify abrupt changes. Different approaches have been proposed and here I show one of them based on maximum likelihood estimates. I also recommend to have a look at this website (which is a wonderful introduction to change point detection using Likelihood ratio tests) and this R package from R. Killick and I.A. Eckley.

Data

Let's start and define some parameters (I will come back to this latter) and generate some data.

rm(list = ls()) 
# parameters
penalty<-10 # Delta AIC penalty
display<-1 # display all graphs during calculations (good to see what is going on)
sd<-1 # sd is known and set here as 1
# data 
set.seed(50)
values<-c(rnorm(200,10,sd),rnorm(200,2.1,sd))

Read More [...]

Change point Detection Part I

Posted 2020-12-01 by Wilfried. Post 9 of 12.
ChangepointHypothesis_Testing t-test

Change point detection. Part I : rolling t-test


In a time series, change point detection tries to identify abrupt changes. Different approaches have been proposed and here I show one of them based on a simple rolling t-test.

For this example, I use ggplot2 and so you need to enter:

rm(list = ls()) 
if (!require(ggplot2)) install.packages('ggplot2')

Read More [...]