Calculate the equation of this best fit straight line

Assignment Help Basic Computer Science
Reference no: EM13861887

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 

Reference no: EM13861887

Questions Cloud

What is the companys magnitude of operating leverage : What is this company's magnitude of operating leverage? (Do not round intermediate calculations. Round your final answer to 2 decimal places.)
Explain what the value of the standard error : Explain what the value of the standard error of the mean indicates about the true value of the measurement if it is assumed that the variation is due only to random variation
It budget on security : What you need to convey to your CEO is that network attacks are continuing to make the news and organizations have reacted by increasingly spending more of their overall IT budget on security. Business executives are starting to have questions about ..
What is totals interest expense for swiss franc debt : What is Totals net Swiss franc cash flow each year that is exposed to exchange rate changes - What is Totals interest expense for the Swiss franc debt for year 2015, measured in €?
Calculate the equation of this best fit straight line : 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 c..
Explain tcp protocol is asymmetric over wireless link : The following wireless TCP protocol is asymmetric over wireless link in terms of transmission power and bandwidth
Description of blue ocean strategy and its importance : A description of blue ocean strategy and its importance
Explain what each process means and what is involved : Explain what each process means and what is involved with the five that you picked. For clarification, these are the interconnected leadership tasks that are listed- Understanding the context and Understanding the people involved, including oneself
What is the role of leadership in creating : What is the role of leadership in creating, managing, and sustaining innovation in your organization?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Class templates are typically used to replace overloaded

1.How would you overload the comparison operators == and !=? What is the format to overload these operators? 2. Class templates are typically used to replace overloaded functions. Can you compare the two?

  What can help prevent issues related to downloading

What can help prevent issues related to downloading

  Assume that you have the following context free grammar

What string came from this sequence of derivations? (It should be obvious whether this is a left derivation or a right derivation.)

  What is a client-server network

What is a client-server network?

  Describe and assess the evaluation method by the testing

Describe and assess the evaluation method being used by the testing company, i.e., nonvisual and verbal recording of browser activities and tester's vocal comments.

  Install easy php and my sql

Install EasyPHP and MySQL and take a screen shot that shows the MySQL prompt on your screen.

  Most cost-effective in terms of both time and money

Search the Web for security education and training programs in your area. Keep a list and see which category has the most examples. See if you can determine the costs associated with each example. Which do think would be most cost-effective in terms ..

  Airline business upgraded to the same application

Few things in the airline business are more daunt-ing than upgrading to a new reservations system. Do it well, and customers are none the wiser; mess it up, and a carrier risks losing customers and tarnishing its brand. Discount carriers JetBlue A..

  Ensure that you logged on to the computer as administrator

Step 1 ? Ensure that you logged on to the computer as an administrator. ? Navigate to the "Control Panel" by clicking Start > Control Panel > System and Security. Click the System link.

  A power level of 100 w is 6 db above what power level

A power level of 100 W is 6 dB above what power level?

  Storage of an unordered collection of items

Storage of an unordered collection of items that facilitates efficient, random access of items based on an item's position in the collection.

  Describe the reasons for disney''s adoption of itil

Describe the reasons for Disney's adoption of ITIL. Examine the results that were attained by Disney.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd