stats_Chapter 6


View on GitHub | Download Local

Click to view slide text

Chapter 6 Dr Wayne Stewart

Go through all examples!!

Proof β€’ π‘£π‘Žπ‘Ÿ β€’ π‘£π‘Žπ‘Ÿ

𝑋 π‘Œ + πœŽπ‘‹ πœŽπ‘Œ 𝑋 π‘Œ βˆ’ πœŽπ‘‹ πœŽπ‘Œ

β‰₯0 β‰₯0

Example

The true density

w method of sampling

rmyexp=function(n, …){ graphics.off() w=runif(n,0,1) y=-2*log(1-w) h=hist(y,plot=FALSE, …) coll = rgb(hdensity),.4,.1) windows() hist(y,freq=FALSE,main=β€œUniform W”,col = coll, …)# col=rainbow(length(h$mids)),…) curve( exp(-x/2)/2,add=TRUE,col=β€œBlue”,lwd=2) text(10,.3, paste0(β€œSimulation using\n w uniform method ”, β€œn=β€œ,n,β€œ\n ”, β€œ1/2exp(-x/2)”)) legend(β€œtopright”, legend = c(β€œSimulation”, β€œSimulation”,β€œTruth”), fill=c(coll[1],coll[length(coll)], β€œBlue”)) dev.new(noRStudioGD = TRUE) df=data.frame(y) library(ggplot2) g = ggplot(df, aes(x=y)) + geom_histogram(aes(fill=..density..), bins = 50) + geom_density( col = β€œRed”) g = g + stat_function(fun = function(x) exp(-x/2)/2) print(g) } rmyexp(100000, nclass = 40)

Order Statistics β€’ Sample of size β€œn” what is the distribution of: π‘Œπ‘šπ‘–π‘› , π‘Œπ‘šπ‘Žπ‘₯ ?

Taken From Larsen and Marx

Make: dpqr functions for order statistics

Suppose that the following is true: πΉπ‘Š 𝑀 = 2𝑀 βˆ’ 𝑀 2

π‘“π‘Š 𝑀 = 2 βˆ’ 2𝑀 = 2(1 βˆ’ 𝑀)

Create dpqr functions!

Follow the R code

Go through all examples

Get these examples

In R the standard error is the estimate of the standard deviation of the sampling statistic

Normal approximation to the Binomial

Condition to be satisfied

Continuity correction

This will be difficult to remember – please use first principles to perform continuity corrections

Sampling distributions – related to Normal

Find 𝑓𝑍 (𝑧)

Definition of T random variable

Go through all examples