A blog for physicists or biologists. Mainly for experimentalists interested in Statistics. R scripts detailed and explained.
wilfried.grangeu-paris.fr
Associate Professor at Université Paris Cité
How to process (filter) images with FFT using 'simple' R functions
In this post, I show how to remove some 'noisy' patterns in an image. I will use 'simple' mathematical transformations (Fourier transform) that allow to efficiently process images.
rm(list=ls()) # clear memory
if (!require(viridis)) install.packages('viridis')
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')
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')
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), this R package from R. Killick and I.A. Eckley and this paper (for a real-word application).
DataLet'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