Question
This is the algorithm i came up with i dont knowwhere to go from here: Start prompt for and read in fileName open inputFile while
This is the algorithm i came up with i dont knowwhere to go from here:
Start prompt for and read in fileName open inputFile while open unsuccessful display error message prompt for and read in fileName open inputFile end while sumX = 0.0 sumX2 = 0.0 sumY = 0.0 sumY2 = 0.0 sumXY = 0.0 n = 0 read-skip 1st line with column headings while there are records read from file: iSp, exitV, mach, maxV, actualV
n = n + 1 sumX = sumX + exitV sumX2 = sumX2 + exitV*exitV sumY = sumY + actualV sumY2 = sumY2 + actualV*actualV sumXY = sumXY + exitV*actualV
end while close inputFile if n
stop end if meanX = sumX / n meanY = sumY / n stdDevX = sqrt((n*sumX2 - sumX*sumX) / (n * (n - 1))) stdDevY = sqrt((n*sumY2 - sumY*sumY) / (n * (n - 1)))
r = sqrt((sumXY - n*meanX*meanY) / ((n-1)*stdDevX*stdDevY)) display meanX, meanY, stdDevX, stdDevY, r if fabs(r) >= 0.7 m = (sumXY - meanY*sumX) / (sumX2 - meanX*sumX)
b = meanY - m*meanX display m, b
else
display "Correlation between Exhost Velocity and Actual Max. " "Velocity is weak; regression coefficients not calculated" end if End
REQUIREMENTS Develop a C+HFortran program that prompt and read the name of an input data file (input stream). Then, it will read data from the file (stream) and calculate the following statistical metrics: l. Means 2. Standard deviations 3. Correlation coefficient 4. Linear regression coefficients The correlation coefficient (it measures the reliability of the estimation) is: And the standard deviation for x (or comespondingly for y values is n(n -1) Calculate the linear regression coefficients only if ryl 20.7. In such a case, these coefficients are computed with the formulas Thus, for a given value (x) of an independent random variable, the estimated value of a dependent variable (y) will be y mx b. Where, number of samples mean x and y, respectively Sx, Sy x and y standard deviations Ex sum of x values Ey sum of y values Ex sum of squares of x values sum of squares of values Exy sum of xy products Use the following value for acceleration of gravity, if necessary G 9.81 m 3 2 REQUIREMENTS Develop a C+HFortran program that prompt and read the name of an input data file (input stream). Then, it will read data from the file (stream) and calculate the following statistical metrics: l. Means 2. Standard deviations 3. Correlation coefficient 4. Linear regression coefficients The correlation coefficient (it measures the reliability of the estimation) is: And the standard deviation for x (or comespondingly for y values is n(n -1) Calculate the linear regression coefficients only if ryl 20.7. In such a case, these coefficients are computed with the formulas Thus, for a given value (x) of an independent random variable, the estimated value of a dependent variable (y) will be y mx b. Where, number of samples mean x and y, respectively Sx, Sy x and y standard deviations Ex sum of x values Ey sum of y values Ex sum of squares of x values sum of squares of values Exy sum of xy products Use the following value for acceleration of gravity, if necessary G 9.81 m 3 2Step 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