Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Linear regression is a method for calculating the equation of the "best" straight line that passes through a set of points. By "best," we mean the "best fit" straight line—the one that passes as closely as possible to as many points as possible. To calculate the equation of this best fit straight line, you begin with a set of N data points, y;), for i = 0,1, 2, 3....., N — 1. You then calculate: Sum of Sum of 

Sum of squares of 

Yi Sum of products of x,y,: sP-1 

E"n E x‘Y‘ The equation of the "best fit" straight line b will then have slope m given by 

And y-intercept b as: 

b= 

M = 

— 

(Y-)(.')-(")(2 xtYll N — x,) 

However, a linear regression is only as good as its fit. While it is not the best goodness-of-fit test for a linear regression, the le value is commonly accepted as a decent enough indicator of how well a line fits the data it is supposed to represent. Commonly, an le value of .9 or higher is considered a good fit. Anything below .6 is considered inconsequential, and anything in between ranks from mediocre to decent. The le value can be calculated as shown below. 

where, y 

The difference between )7 (the value or y as estimated by the line) and y (the original data value) should be noted. 

Your program should: 

• Read two sets of data from a file (11W7dateMB and store them as arrays of length 20. The data is presented as x y form (on each line there will be a value for and a value for y) where isod  an integer and y is a float value. Continue reading the file and allocating the data into two arrays. The data file is located in the Documents section on Blackboard. • Find the estimated slope, m. • Find the estimated intercept, b. • Find the 12' value for the line created using the previously found estimated slope and intercept. • Output the equation of the line as well as Melt.' value onto thc screen. 

Notes: 

• Ideally the user should ace very little on the screen and have no input at all. • You will probably need more than the two originally defined arrays. However, recognize that SUMS and meant are only net value and therefore do not need to be stored as arrays. • It may help to break up calculations into numerators and denominators as well • To read the values from HW7datamt, use the following code fragment. 

int x[20]; float y[20]; FILE app; fp = fopen("HW7datuter,Y); for(i=0; i<20; t-m) 

MeauF(FIVYul %Di 804ili &Yli1); //Reads new linc from Elk every time the Rop executes 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91522642
  • Price:- $30

Guranteed 24 Hours Delivery, In Price:- $30

Have any Question?


Related Questions in Computer Engineering

Question social networks have become popular media among

Question : Social networks have become popular media among individuals of all ages to stay connected with friends, family, colleagues and coworkers. However, many users are unaware of the dangers of sharing vast amounts ...

Briefly explain the meaning of the t-test for regression

Briefly explain the meaning of the t-test for regression analysis. How can the "rule of two" be used to evaluate t-ratios?

What type of monopoly is sydney water describe the main

What type of monopoly is Sydney Water? Describe the main characteristics of this monopoly type in general and in relation to Sydney Water.

Task create an array that holds a 20 random integers

Task : Create an Array that holds a 20 random integers between 1-50. Create an iterator that will return the memory address and value for each integer present in the Array.

Refer to the reading e-business strategy how to benefit

Refer to the reading, "E-Business Strategy: How to Benefit From a Hype" and review its alignment between such models as SWOT and Five Forces and the e-business that it uses as a model. In your posting, address the follow ...

Do you believe corporation pose as a risk to our national

Do you believe corporation pose as a risk to our national economy and to domestic employees based upon external shocks to our economy as well as government regulations and Obamacare?

What would be examples of valid selection methods used by

What would be examples of valid selection methods used by the human resource department to ensure selecting the appropriate candidate for a job.

Can someone design a small program for me in java that do

Can someone design a small program for me in Java that do the following: Implement at least four classes (showing inheritance) with suitable constructors and methods to set/retrieve values of from the properties. Try to ...

Question you recently have been hired as the director of

Question: You recently have been hired as the Director of Systems Administration operations for ViralMedia, a provider of software tools for graphics artists. The company's core product, DigiWorld, runs under Windows and ...

Suppose that on your birthday you checked the balance on

Suppose that on your birthday you checked the balance on your retirement account and you decided to make a $1,000 payment at the end of every month until you retire at the specified age. If you disreagard the inflation ( ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As