Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3. An industry furniture manufacturer is interested in the depth of cabinets. Firstly he surveyed the depths of cabinets used in various workshops and offices.
3. An industry furniture manufacturer is interested in the depth of cabinets. Firstly he surveyed the depths of cabinets used in various workshops and offices. Let d be a depth in centimeters. A large Bayes Box is constructed to work out the posterior distribution for d given some data. The R code is as follows. #possible depths d = seq(18,60, by=0.1) #prior prior = exp(-(d-40)^2/150) prior prior/sum (prior) #likelihood - let's assume that the likelihood given data is in this form. like = 2+(sin((0-5)/3)*0.8+cos((d+3)/7)/2) #we are getting the posterior h = like*prior z = sum(h) posterior = h/z plot (d, posterior, type='l',xlab='depth in cm', ylab='posterior probability') (a) Find a 95% credible interval for d (include your code) (4 marks). (b) Find the posterior median for d (include your code) (2 marks]. (c) Find the posterior probability for a depth greater than 50cm. (2 marks] (d) The length of a cabinet tends to be l = 1.5d+, e~ N(0, 2). Find the posterior mean length and posterior probability for a cabinet length shorter than 33cm. (4 marks] Hint: N(0, 2) means a normal distribution with the mean of 0 and standard deviation of 2. The R-command pnorm(q, mean, sd) com- putes the cumulative distribution function of the normal distribution N(mean, sd). 3. An industry furniture manufacturer is interested in the depth of cabinets. Firstly he surveyed the depths of cabinets used in various workshops and offices. Let d be a depth in centimeters. A large Bayes Box is constructed to work out the posterior distribution for d given some data. The R code is as follows. #possible depths d = seq(18,60, by=0.1) #prior prior = exp(-(d-40)^2/150) prior prior/sum (prior) #likelihood - let's assume that the likelihood given data is in this form. like = 2+(sin((0-5)/3)*0.8+cos((d+3)/7)/2) #we are getting the posterior h = like*prior z = sum(h) posterior = h/z plot (d, posterior, type='l',xlab='depth in cm', ylab='posterior probability') (a) Find a 95% credible interval for d (include your code) (4 marks). (b) Find the posterior median for d (include your code) (2 marks]. (c) Find the posterior probability for a depth greater than 50cm. (2 marks] (d) The length of a cabinet tends to be l = 1.5d+, e~ N(0, 2). Find the posterior mean length and posterior probability for a cabinet length shorter than 33cm. (4 marks] Hint: N(0, 2) means a normal distribution with the mean of 0 and standard deviation of 2. The R-command pnorm(q, mean, sd) com- putes the cumulative distribution function of the normal distribution N(mean, sd)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started