• Aucun résultat trouvé

Lab 3: Law of large numbers and Central Limit Theorem

N/A
N/A
Protected

Academic year: 2022

Partager "Lab 3: Law of large numbers and Central Limit Theorem"

Copied!
1
0
0

Texte intégral

(1)

Universit´e Joseph Fourier L2/STA230

Lab 3: Law of large numbers and Central Limit Theorem

Objectives: Simulate random variables and illustrate the law of large numbers and the Central Limit Theorem.

Exercise 1

1. Simulate 1000 samples of size 5 with a binomial distribution of parametersn= 10 andp= 0.2.

X5 = matrix(rbinom(5000, 10, 0.2), nrow=1000, ncol=5)

Compute the mean of each sample with the functionrowMeansand call the vector of meansmean5 2. Plot a histogram of the 1000 means. Add the theoretical density of a Gaussian distribution with

mean the mean of the 1000 means, and a variance equal to the variance of the 1000 means.

x5 = seq(min(mean5), max(mean5), 0.01)

lines(x5, dnorm(x5, mean=mean(mean5), sd=sd(mean5)), col=2) 3. Repeat with 1000 samples of size 20. Repeat with 1000 samples of size 50.

Exercise 2

1. Draw a sample of sizeN = 104of the standard normal distribution. Display its first 100 values.

2. Split the graphic window in two. Superpose a histogram and the density function on one sub- window. Superpose the empirical and theoretical CDF on the other subwindow.

3. Foriin 1, ...n, compute the sample mean, plot, add the theoretical expectation to the graphic. Do the same for the variance.

4. Sort the initial sample by increasing order with the functionsort. Compute the image of (1 :N)/N by the quantile function of the normal distribution. Plot the first vector against the second.

S <- sort(X) # increasing order Q <- qnorm((1:N)/(N+1)) # quantiles plot(Q,S,pch=".",col="blue") # qqplot abline(a=0,b=1,col="red") # add theoretical qqnorm(X)

Références

Documents relatifs

In his paper [T2] Terras obtained a central limit theorem for rotation- invariant random variables on the space of n x n real positive definite (symmetric) matrices in the case n =

Since every separable Banach space is isometric to a linear subspace of a space C(S), our central limit theorem gives as a corollary a general central limit theorem for separable

We show (cf. Theorem 1) that one can define a sta- tionary, bounded martingale difference sequence with non-degenerate lattice distribution which does not satisfy the local

Key words and phrases: Central limit theorem, spatial processes, m- dependent random fields, weak mixing..

exponential Young funtions for stationary real random elds whih are bounded.. or satisfy some nite exponential

Theorem 2.1 asserts a functional central limit theorem for the random walk XúJ when it is confined to an infinite equivalence class, under the assumption that the density

density appears as a consequence of the generalization of the central limit theorem presented in the next section. Annales de l’lnstitut Henri Poincaré - Probabilités et

Then, we want to use this speed of convergence to prove the central limit theorem and the law of the iterated logarithm for starting points having good diophantine properties.. In