0% found this document useful (0 votes)
4 views8 pages

Solution - HW1-2022

The document contains a solution manual for Homework 1 of IE 384 - Data Analytics in Industrial Systems, detailing various data analysis tasks using R programming. It includes plotting functions, statistical calculations, and distribution fitting related to women's height and weight data. Key results include correlation analysis, geometric distribution likelihood functions, and probability calculations for specific height thresholds.

Uploaded by

zeynep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views8 pages

Solution - HW1-2022

The document contains a solution manual for Homework 1 of IE 384 - Data Analytics in Industrial Systems, detailing various data analysis tasks using R programming. It includes plotting functions, statistical calculations, and distribution fitting related to women's height and weight data. Key results include correlation analysis, geometric distribution likelihood functions, and probability calculations for specific height thresholds.

Uploaded by

zeynep
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

IE 384- Data Analytics in Industrial Systems

Solution Manual - Homework 1


1) 25 points

a=0.25

b=2.5

c=1.6

x=seq(-1,1,length.out = 15000)

y = (a*cos((b*pi*x)/2)) + ((1-a)*sin((c*pi*x)/2))

plot(x,y,type="l",ylim=c(-1,0.8))

a=0.5

b=2.5

c=1.6

x=seq(-1,1,length.out = 15000)

y = (a*cos((b*pi*x)/2)) + ((1-a)*sin((c*pi*x)/2))

lines(x,y,type="l",col="red")

a=0.75

b=2.5

c=1.6

x=seq(-1,1,length.out = 15000)

y = (a*cos((b*pi*x)/2)) + ((1-a)*sin((c*pi*x)/2))

lines(x,y,type="l",col="blue")

legend("bottom",legend=c("a=0.25","a=0.5","a=0.75"),col=c("black","red","blue"),lty=1)
2.a) 12.5 points

(
45+ Pr \{ x ≥ 22 \} ( 1.2 )=45+ 1−
22! )
e−35.6 ( 35.6 )22
( 1.2 )=46.194 $

2.b) 12.5 points

( 35.6 ×30 × 3.6 )−[ ( 45+ Pr \{ x ≥22 \}× ( 1.2 ) ) × 2× 30 ] =3844.8−2771.64=1073.16 $

3.a) 6 points

rm(list=ls())

library(datasets)

head(women)

hist(women$height)

sum(women$height>66)/dim(women)[1] []?

The ratio is 0.4. R Plot is given below:


3.b) 7 points

hist(women$weight)

library(fitdistrplus)

plotdist(women$weight,histo=TRUE,demp=TRUE)
 Histogram of weight data looks like uniform distribution. Arguments The arguments given below
also support this. Empirical and theoretical densities are close to each other. You can find the
graph and the code below.

fitdist(women$weight,distr = "unif", method = "mle")

Fitting of the distribution ' unif ' by maximum likelihood

Parameters:

estimate Std. Error

min 115 NA

max 164 NA

plotdist(women$weight,histo=TRUE,demp=TRUE,distr = "unif", para =list(min=115,max=164))


3.c) 6 points

colvect=rep("black",dim(women)[1])

colvect[(women$height>68)&(women$weight>150)]="red"

colvect[(women$height<62)&(women$weight<129)]="blue"

plot(women$height,women$weight,col=colvect)
3.d) 6 points

cor(women$height,women$weight)

The correlation value is 0.9954948. So, there is a strong positive relationship between height and
weight.

4.a) 6 points
( k−1)
pmf =( 1− p ) p
The geometric distribution gives the probability that the first occurrence of success requires k
independent trials, each with success probability p.

Likelihood function;
n

( x 1−1) ( x 2−1 ) ( x n−1) n


∑ xi−n
L ( p )=( 1− p ) p . ( 1−p ) p … . ( 1− p ) p= p ( 1− p ) i=1

4.b) 6 points

Log-likelihood function;

(∑ )
n
lnL ( p )=nlnp+ x i−n ln ( 1− p )
i=1

Take derivative;
n

∑ x −n
d ( lnL ( p ) ) n i=1 i
= − =0
dp p 1− p
n
p= n

∑ xi
i=1

4.c) 6 points

p.data=dim(women)[1]/sum(women$height)

D=rgeom(15,p.data)

table(D)

>t.test(D)

R output:

One Sample t-test

data: D

t = 3.4126, df = 14, p-value = 0.004206

alternative hypothesis: true mean is not equal to 0

95 percent confidence interval:

19.91296 87.28704

sample estimates:

mean of x

53.6

> chisq.test(D)

R output:

Chi-squared test for given probabilities

data: D

X-squared = 966.52, df = 14, p-value < 2.2e-16


4.d) 7 points

p.data=dim(women)[1]/sum(women$height)

probability=((1-p.data)^(70-1))*p.data

The probability of observing a woman who is taller than 70 inches is 0.005278168.

You might also like