Final Flashcards

1
Q

ep=randn(30,1)*5;

A

sample a normal distribution with zero mean and prescribed standard deviation/spread

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

x=10+ep;

A

shift for a prescribed mean

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

ep=randn(30,1)5;
x=10+ep;
figure(1)
dotplot(x,30,0.05,1)
function dotplot(x,nbins,delta,ymax)
[n,edges]=histcounts(x,nbins);
for i=1:length(n)
for j=1:n(i) plot((edges(i)+edges(i+1))/2,j
delta,’ob’,’markersize’,8,’markerfacecolor’,’w’); hold on end
end
set(gca,’YTick’,[]);
ylim([0 ymax])
end

A

code for dot plot

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

function dotplot(x,nbins,delta,ymax)

A

dot plot of data in x with nbins, dot spacing delta, and y-axis maximum ymax

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

[n,edges]=histcounts(x,nbins);

A

prescribe the bins and counts (matlab algorithm)

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

set(gca,’YTick’,[])

A

hide the y-axis ticks

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

plot(x,’o’,’markersize’,8,’markerfacecolor’,’w’); hold on ylabel(’value’)
xlabel(’sample number’)

A

scatter and time-series plot

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

boxplot(x)
ylabel(’value’)
xlabel(’sample’)

A

box plot

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

x=[8 4 1 8 4 7 6 9 8]; n=length(x); x=sort(x)

A

order the data for inspection.

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

q1=x(round(1/4(n+1))) q2=x(round(2/4(n+1))) q3=x(round(3/4*(n+1))) IQR=(q3-q1)

A

here, quartiles from rounding, not interpolation. Matlab interpolates

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

min(x(x>q1-1.5IQR)) max(x(x<q3+1.5IQR))

A

whiskers

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

x((q1-3IQR)<x & x<(q1-1.5IQR))
x((q3+1.5IQR)<x & x<(q3+3IQR))

A

outliers

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

x(x<(q1-3IQR)
x(x>(q3+3
IQR))

A

extreme outliers

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

histogram(x,10) xlabel(’value’) ylabel(’counts’)

A

histogram

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

scatterhist(x,y)
xlabel(’x’)
ylabel(’y’)

A

marginal plot for bivariate data

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

n=length(x)

A

number of data points

17
Q

xbar=mean(x)

A

mean of data in x

18
Q

yp=y-mean(y)
xp=x-mean(x)

A

deviations

19
Q

Syy=sum(y.^2)-nybar^2 % correlations Sxx=sum(x.^2)-nxbar^2 Sxy=sum(x.y)-nxbarybar
r1=Sxy/sqrt(Sxx
Syy)

A

gets you correlation and correlation coefficient (r1)

20
Q

f=pdf(’norm’,x,mu,sd)

A

normal PDF

21
Q

F=cdf(’norm’,x,mu,sd)

A

normal cumulative PDF

22
Q

P=cdf(’norm’,2,mu,sd)-cdf(’norm’,1,mu,sd)

A

using cumulative distributions

23
Q

P=integral(@(x)pdf(’norm’,x,mu,sd),1,2)

A

using numerical integration - gets you same value as P=cdf

24
Q

x=icdf(’Gamma’,xi,k,b);

A

evaluate the inverse cumulative PDF (this PDF has two parameters k and b)

25
Q

histogram([1,1,3,3,3,5,7,8,12],5,’BinLimits’,[0,20])

A

counts in each bin

26
Q

i=0:40
1-sum(exp(-30)*30.^i./factorial(i))
1-cdf(’Poisson’,40,30)

A

answers: what is the probability of randomly selecting 10 unit areas that contain greater than 40 defects?

27
Q

1-cdf(’Poisson’,40,30)

A

Matlab cumulative Poisson PDF