Chapter 3&4 Flashcards

1
Q

Importance of geometric distributions?(1)

A

SImilar to python, add one on so probability for 2 in formula would give prob less than 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Difference between d”distribution” and p”distribution” and r”distribution” for functions?(1)

A

d is pmf, p is cdf, r is a random sample from the distribution,

d for equal to probabilities, p for less than or equal to

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Answer:
: Suppose annual maximum wave heights observed off the coast at a flood-prone
town are assumed Normally distributed, with mean 2 metres and standard deviation 0.5 metres.
Write down the R command to estimate the height of a new sea wall such that we might
expect the town to be flooded, on average, once per century. Why might our modelling
assumption be invalid?

A

qnorm(0.99, 2, 0.5)

3.16 design it to 3.16m.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

For doing questions for formulas in R?(1)

A

Take care in difference in time units!!!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

1)Use R to generate a sample of size 10,000 from an exponential distribution with
rate 2.5, and store this sample in the vector x
2)Use your vector x to estimate Pr(X ≤ 0.5), where X ∼ Exp(2.5).
3) How does your estimate in part (a) compare to the true probability?

A

1) x=rexp(10000, 2.5)
2) y=x[x<=0.5], length(y)/10000=0.7109
3) pexp(0.5, 2.5)
0. 71…., pretty well, more samples=more accurate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Issues with binomial?(1)

A

Expects constant rate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you denote CDFs?(1)

A

By F(x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why does a CDF graph for a normal distribution have an asymptote at 1 rather than touching it?(1)

A

Because of the asymptotic nature of the bell shape of its distribution never touching the x-axis.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Pdf for an exponential distribution can be written in closed form as?What about the CDF?(2)

A

fsubcriptx(x)=lambdae^-lambdax

Fsubscript(x)=1-e^-lambdax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the inverse CDF method?(1)

A

Let U ∼ U(0, 1). Suppose F (x) is a well-defined CDF which is invertible. Then the random
variable X = F^−1(U) has CDF F (x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Proof for inverse CDF method.(1)

A
X=F^-1(U) therefore 
Pr(X<=x)=Pr(F^-1(U)<=x)
Pr(F(F^-1(U)<=F(x))
Pr(U<=F(x))
=F(x)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How would you do write a simulation in R to produce realisations (observed value) from the distribution?(1)

A

inv.function= function(n){
U=runif(n)
answer=inverse cdf with U in place of x
return(answer)}

Then run histograms of these with samples of 1000,10000

Could then overlay pdf by findin gthis through differentiation then making function in r by generating the coordinates and using lines command (see week 4 synchronous lecture for this solution).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the rweibull function in R?(1)

A

rweibull=(n, scale=lambda, shape=kappa)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you get from PDF to CDF? Vice versa?(1)

A

integrate, differentiate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Looking at example 4.5 in the notes, what do you need to remember?(1)

A

Look at this example at all parts as lots of things to note, eg negatives in a quadratic, how to sketch, how to convert different parts of the pdf and which parts to include. Will be useful for exam revision!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Useful checks to check inverse cdf code in r?(2)

A

See home video 4 for examples of how but

1) Do histogram of this and then lay line of pdf over the top to check
2) Do quartile of tests you have done using your values, if similar then youre good.