Engineering Statics & matlab

Engineering Statics & matlab

PROBLEM 1 (30pts) Let X=The act of measuring the torque that it takes to rotate the shaft of a small rotary AC compressor, and let Y=The act of measuring the noise level of that compressor when running on a test stand. Assume that, in truth, X and Y are correlated with large enough so that the linear prediction model is appropriate.
(a)(5pts) We have shown that . Give the expression for the model parameter, m, in terms of , , and . Solution:

(b)(4pts) Give the expression for the model parameter, b, in terms of m and other distributional parameters associated with the 2-D random variable (X,Y). Solution:
(c)(14pts) Let be a set of iid data collection random variables, each having the pdf parameters given in (a). Give explicit equations for the estimators (not estimates!) of every parameter in both (a) and (b) in terms of . [Note: Once an explicit expression for a parameter has been given, that estimator symbol should be used, if needed for another parameter estimator. Also, for a parameter, say, b, use the symbol to denote the corresponding estimator.] [Note: There are a total of 7 parameters.]
Solution:
(d)(12pts) Suppose that the 2-D random variable has and . Use the Matlab command ‘xy=mvnrnd to simulate a set of measurements, , Then use the commands muXYhat=mean(xy) and covXYhat=cov(xy) to arrive estimates of m and b. Finally, overlay your linear model estimate on a scatter plot of the data. [Note: Be sure to label your plot axes and to include your Matlab code HERE]
Solution:

Figure 1(d) Scatter plot and linear model.

PROBLEM 2(40pts) In the Tuesday (10/20) class we constructed a Matlab code that would arrive at the pdf for the estimator, , for a true value in relation to a sample of 50 paired measurements of , which are the initial velocity and angle of a ball tossed into the air. We arrived at histogram-based and a beta pdf models shown at the right. The simulations gave and . Using these numbers and an equation solver, we arrived at the beta parameter values and .
Figure 2 Histogram-based and beta pdf’s
(a)(5pts) Use the beta pdf to compute .
Solution:
(b)(10pts) The Matlab code that resulted in Figure 2 is given in Appendix A. Mathematically verify that the code used to arrive at the beta parameter values is correct. To this end, begin with the expressions for and as functions of α and β that we found at the wikipedia website.
Solution:

READ ALSO :   Political Criminal Profiler

(c)(15pts) Run the code in Appendix A1, but now with true (i) Include
your plot here. (ii) Give your beta pdf parameter values. (iii) comment on the
accuracy of the beta pdf at the tails of the distribution.
Solution:
(ii)

(iii)
Figure 2(c) Histogram-based and beta pdf’s for .

(d)(5pts) Suppose that your company’s division will undertake a study if your sample set of size 50 results in . Use your beta pdf to compute the probability that a study will be undertaken, when in fact .
Solution:

(e)(5pts) Describe a procedure that you would carry out in order to find the minimum sample size, such that the probability in (d) is no more than .05.
Answer:

Appendix A1. Matlab code provided for Problem 2

%PROGRAM NAME: balltoss.m
muV=25;sigV=3;
muTH=30; sigTH=2;
rho=.75;
sigVTH=rho*sigV*sigTH;
MU=[muV;muTH];
COV=[sigV^2 , sigVTH ; sigVTH , sigTH^2];
m=50; % Numbr of throws
nsim=10^5;
rhohat=zeros(nsim,1);
for n = 1:nsim
vth=mvnrnd(MU,COV,m);
C=corrcoef(vth);
rhohat(n)=C(2,1);
end
figure(1)
[h,bctr]=hist(rhohat,50);
db=bctr(2) – bctr(1);
fhist = h/(nsim*db);
bar(bctr,fhist)
grid
title(‘Histogram-Based PDF for RHOHAT’)
%===================================
%Compute Beta PDF:
%Solve for Beta (a,b) values:
mR=mean(rhohat); vR=var(rhohat);
g=(1-mR)/mR;
apb=g/((1+g)^2*vR) -1;
a=mR*apb;
b=g*a;
xbeta=0.4:.01:1.0;
fbeta=betapdf(xbeta,a,b);
hold on
plot(xbeta,fbeta,’r’,’LineWidth’,2)

APPENDIX Your Matlab Code