26
Analysis of RT distributions with R Emil Ratko-Dehnert WS 2010/ 2011 Session 02 – 16.11.2010

Analysis of RT distributions with R

Embed Size (px)

DESCRIPTION

Analysis of RT distributions with R. Emil Ratko-Dehnert WS 2010/ 2011 Session 02 – 16.11.2010. Last time. Organisational Information ->see webpage Why response times? -> ratio-scaled, math. treatment Why use R? -> standard, free, powerful, extensible - PowerPoint PPT Presentation

Citation preview

Page 1: Analysis of RT distributions with R

Analysis of RT distributionswith R

Emil Ratko-DehnertWS 2010/ 2011

Session 02 – 16.11.2010

Page 2: Analysis of RT distributions with R

Last time ...

• Organisational Information ->see webpage

• Why response times? -> ratio-scaled, math. treatment

• Why use R? -> standard, free, powerful, extensible

• Sources of randomness in the brain -> neurons,

bottom-up and top-down factors, measuring procedure

• Mathematical modelling of phenomena in the world

3

Page 3: Analysis of RT distributions with R

INTRODUCTION TOPROBABILITY THEORY

4

I

Page 4: Analysis of RT distributions with R

Probability space

5

0

1

Ω

P

A

I

Subsets of interest

Probability measure

Probability space

Page 5: Analysis of RT distributions with R

Probability Space (Ω, A, P)

{ 1 }{ }

{ 2 } { 3 }{ 1; 2 }

{ 1; 3 }{ 2; 3 }

{ 1; 2; 3 }1

23

0 1/21/4 3/4 1

Ω A

P

Sample space:

set of all possible outcomes

Set of events :

collection of subsets (σ-Algebra)

Probability measure:

Governed by Kolmogorov-Axioms 6

I

Page 6: Analysis of RT distributions with R

Probability measure P • Is governed by „Kolmogorov-Axioms“

P(A) ≥ 0; A event (non-negativity)

P({}) = 0 and P(Ω) = 1 (normality)

P(Σ Ai) = Σ P(Ai); for Ai disjoint (σ-additivity)

7

I

Page 7: Analysis of RT distributions with R

Example: Rolling a die

• Ω = {1, 2, 3, 4, 5, 6}

• A = Powerset(A) = { {1}, {2}, ..., {6}, {1, 2},

{1,3} , ..., {5, 6}, {1,2,3}, ..., {1, 2, 3, 4, 5, 6} }

• P(ω) = 1/6, for all ω є Ω

• A = { „even pips“ } = {2, 4, 6}

• P(A) = 3/6 = 1/2

8

I

Page 8: Analysis of RT distributions with R

Example: RT Distribution

9

y

yyf

2

2

2exp

1),,|(

I

Ex-Gaussian distribution

Page 9: Analysis of RT distributions with R

Modelling behavioural experiments

„Response times to a pop-out experiment?“

• What is the probability space (Ω, A, P)?

• ΩRT= („all times between 0 and +∞ ms“)

• A = B(R) = ( [x, y); x, y є R )

• P([x, y)) = ? this will be addressed in

10

I

II

Page 10: Analysis of RT distributions with R

Important Laws in Probability theory

• Law of large numbers

• Central limit theorem

11

I

Page 11: Analysis of RT distributions with R

Law of large numbers

• „The sample average Xn (of a random variable

Xn) converges towards the theoretical

expectation μ of X“

• Example:

– Expected value of rolling a die is 3.5

– Average value of 1000 dice should be

3500 / 1000 = 3.5 12

I

Page 12: Analysis of RT distributions with R

13

Page 13: Analysis of RT distributions with R

Importance of Law of large numbers

• It justifies aggregation of data to its mean

• (will be important again in )

14

I

III

Page 14: Analysis of RT distributions with R

Central limit theorem

• The average of many iid random variables

with finite variance tends towards a normal

distribution irrespective of the distribution

followed by the original random variables.

15

Nn ∞

I

Page 15: Analysis of RT distributions with R

• Binomial distributions

B(n, p), e.g. Tossing a

coin n-times with

prob(head) = p

• increasing n Normal

distribution

16

Page 16: Analysis of RT distributions with R

Importance of Central limit theorem

• Why is this important:

– It argues that the sum of many random processes

(whatever distribution they may follow) behaves like

a normal random process

– i.e. If you have a system, where many random

processes interact, you can just treat the overall

effect like a normal error/ noise(!)17

I

Page 17: Analysis of RT distributions with R

MATRIX CALCULUSExcursion

18

Page 18: Analysis of RT distributions with R

Excursion: Matrix Calculus

• Def: A matrix A = (ai,j) is an array of numbers

• It has m rows and n columns (dim = m*n)

19

nmm

n

aa

aa

aaa

A

,1,

2,21,2

,12,11,1

m

n

Page 19: Analysis of RT distributions with R

Matrix operations (I)

• Addition of two 2-by-2 matrices A, B performed

component-wise:

• Note that „+“ is commutative, i.e. A+B = B+A 20

11

33

11

12

20

41

A B A+B

Page 20: Analysis of RT distributions with R

Matrix operations (II)

• Scalar Multiplication of a 2-by-2 matrix A with

a scalar c

• Again commutativity, i.e. c*A = A*c21

40

82

20

412

c A cA

Page 21: Analysis of RT distributions with R

Matrix operations (III)

• Transposition of a 2-by-3 matrix A AT

• It holds, that ATT= A.22

94

62

01

960

421T

AAT

Page 22: Analysis of RT distributions with R

Matrix operations (IV)

• Matrix multiplication of matrices C (2-by-3)

and D (3-by-2) to E (2-by-2):

23

24

15

01

12

13

131

201

CD E

Page 23: Analysis of RT distributions with R

Matrix operations (V)

!Warning!

One can only multiply matrices if their dimensions

correspond, i.e. (m-by-n) x (n-by-k) (m-by-k)

• And generally: if A*B exists, B*A need not

• Furthermore: if A*B, B*A exists, they need not be

equal!24

Page 24: Analysis of RT distributions with R

Geometric interpretation

• Matrices can be interpreted as linear

transformations in a vector space

25

Page 25: Analysis of RT distributions with R

Significance of matrices

• Matrix calculus is relevant for

– Algebra: Solving linear equations (Ax = b)

– Statistics: LLS, covariance matrices of r. v.

– Calculus: differentiation of multidimensional functions

– Physics: mechanics, linear combinations of quantum

states and many more...

26

Page 26: Analysis of RT distributions with R

AND NOW TO

27