100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary Statistical computing TUe

Rating
-
Sold
4
Pages
25
Uploaded on
24-06-2020
Written in
2019/2020

This is a summary of the statistical computing (JMB050) course on the Eindhoven University of Technology. It is based on the lectures in year and the examples that we covered in class. Our teacher was K. Deun. It contains my notes of all the twelve lectures, with some screenshots of the slides.

Show more Read less
Institution
Course











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course

Document information

Uploaded on
June 24, 2020
Number of pages
25
Written in
2019/2020
Type
Summary

Subjects

Content preview

Statistical computing: JBM050 Quartile 4
2019-2020

Course organization
Books:
- Monte Carlo simulation and resampling methods for social science (lecture 1-4)
- An introduction to statistical learning (rest)


Lecture 1: Introduction

Learning from your data

Mathematical models for experiments are Analytics solutions and Simulations. For the simulations we
make data with our computer and study those values.

The data generating model in random experiments
Bernoulli distribution
Use the Bernoulli trial when you want the know the probability of, for example, head and coins. To
have a good approximation, you need a very large sample.

The outcomes of a coin toss are two values, so it is a binary variable (values 1 and 0). Each outcome
has a certain π probability; it is a binary random variable. Only 1 toss.
P ( X=1 )=π
P ( X=0 )=1−π

Random variables that are binary are a Bernoulli distribution. → X Bern(π )

Binomial distribution
It is an extension on the Bernoulli distribution, only now you toss several times. If we toss it five
times, our number of trials, n, is 5. The outcome can take values 0, 1, … ,n . The number of successes
is represented by a k.

n!
P ( X=k )= π k ( 1−π )n−k
k ! ( n−k ) !

n!
= n and it counts the number of ways k successes can occur in
The binomial coefficient
k ! ( n−k ) ! k()
a sequence of n trials. It can be described as → X Bin(n , π )

Hypergeometric distribution
The lady tasting tea: There are 8 cups of tea, in the first 4, milk was poured first, and in the last 4, tea
was poured first. She said that she could discriminate which drink was poured first.
She has 6 of the 8 cups right. But what is the probability of guessing 6 of 8 correct if you are just
guessing.

P ¿ ¿ guessing ¿=nr of sequences 6∨more ¿ ¿ =nr ¿ guessing ¿ ¿+ nr ¿ guessing ¿ ¿
total nr of possible sequences n

It is not binomial distributes, because the teacups are dependent of each other.

,Other random experiments
Monty hall paradox:
There are three doors, behind which 2 are goats, and one a car. One door is opened and has a goat
behind it. Now, the player chooses a door, and is asked to switch. Which is better? Switching. The
probability of winning after staying is 1/3 and for switching it is 2/3.

Random experiments with R
Generating data from discrete random variables (rolling dice or tossing coin)
- The sample R function
- Bernoulli, binomial, hypergeometric, multinomial, Poisson distribution

The R function sample:
[ marbles = c(‘red’, ‘blue’, ‘yellow’) ]
[ sample(x = marbles, size=2, replace=False) ]

Bernoulli and Binomial distribution in R
X Bin(n , π) is [ rbinom(n=5, size=1, prob=0.5) ]
To find the number of successes, run this line 5 times and count the number of times it has 4.
^
P ( X=4 )=^π

Pseudo code
Steps to create your own pseudo code:
1. Give the function a name and specify the arguments
2. Define the input and output
3. Show underlying procedure
a. Programming statements
b. Indentation to add clear structure
4. Make sure it returns the correct output

,Lecture 2: Basics: Sampling

Something is normally distributed with a mean and variance. Also
typed as: N ( μ , σ 2 ), they are the model parameters. It looks like this:




In statistics, a (point) estimator is an approximation of a population parameter that uses observed data.
It is also called a statistic. The rule = estimator and its value are the estimate.

Determine the population model and its values: (possibly a test question)
For example, coin tossing experiment:
- Population model: X Bern( π)
- Population parameter of interest: π
k nr .heads up
- Estimator/statistic: ^π = =
n total nr of tosses
- Estimate: ^π =0.53

The sampling distribution
It is the probability distribution of the sample statistic for a given sample size n. It describes how the
sample statistics varies over different samples of size n. the statistic is considered to be a random
variable.
Call random samples: [ rnorm(n=5, mean=x, sd=y) ]
2
σ
We know that the sample average is: ^x N (μ , )
n
The sample distribution of the average of a sample in size n is a normal distribution itself. The
standard deviation of a sample statistic is also called the standard error of that statistic.

Mean, bias, MSE, RE

Data is used to estimate the population parameter θ and yield the estimator θ^ .
The bias is θ−E( θ)^ .
2
The variance is E( ( E ( θ^ ) −θ^ ) ).
Its standard deviation is called the standard error, which is √ variance .

The MSE is the bia s 2+ variance .

, Lecture 3: Monte Carlo Simulation
Sampling distribution of the difference in means: Assume that two samples are drawn independently.
Analytical results are that under the assumptions, the sample distribution of the difference in sample
means x́ 2−x́ 1is a t-distribution with n1 +n 2−2 degrees of freedom, centered at μ2−μ 1 and a standard
2 2
1 1 ( n1 −1 ) s1 + ( n2−1 ) s 2 .
error equal to SE ( x́2 −x́1 ) =S p
√ + with S p=
n1 n 2 √n1+ n2−2

A t-test was invented to test on the difference between two independent samples:

x́ 2− x́ 1
t= t
SE (x́2 −x́1 ) n 1+n 2−2

Central limit theorem:
For large n, the sample mean of X coming from some probability distribution with
σ2
mean μ and variance σ 2, X N ( μ , σ 2 ) is approximately normal with mean μ and variance ,
n
σ2
x́ N ( μ , ).
n

Properties of statistical methods must be established so that the methods may be used with confidence.
Exact derivations are rarely possible. Analytical results may require assumptions. If these assumptions
are violated, the results may not be possible.

We can find out which assumptions are violated with MC Simulation. MC Simulation can be used for
1) QC for estimators and 2) QC for hypothesis testing. All in absence of analytical results.

MC Simulation for properties of estimators:
An estimator has a true sampling distribution under a particular set of conditions. We cannot derive
this true sampling distribution, for this we can use MC.

How to approximate:
1. Generate S independent data sets of given sample size n.
2. Compute the numerical value of the estimator for each data set.
3. If S is large enough, the summary statistics should be good approximations to the true
sampling properties of the estimator under the conditions of interest.

Compute for each of the statistics:
S
´ 1 (k)
- Average θ^ (k)= ∑ θ^ s
s s=1
- Bias ´
θ^ (k)−θ
S
1 ´^ (k ) 2
- Variance ∑ ( θ^ ¿ ¿(k)
s −θ ) ¿ ¿
S−1 s=1
S
1 ´ 2
- MSE ∑ ( θ^ ¿ ¿ (k )−θ ¿ ) ¿ ¿
S S =1

MSE ( θ^ (1))
Relative efficiency: ℜ=
MSE ( θ^ (2))

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
datasciencestudent Technische Universiteit Eindhoven
Follow You need to be logged in order to follow users or courses
Sold
39
Member since
5 year
Number of followers
31
Documents
15
Last sold
8 months ago

3.5

2 reviews

5
1
4
0
3
0
2
1
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions