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

  What is uml

What is UML? What does a + or - signify

  Does managerial behavior warrant reporting

Many employees are aware of reporting procedures for ethics violations, but which of the managerial behaviors would be worthy of reporting as an ethics violation? At what point does managerial behavior warrant reporting?

  The fibonacci series is defined to be the following numbers

The Fibonacci series is defined to be the following numbers: 0,1,1,2,3,5,8,... where each number is the sum of the previous two numbers. Create a pseudo code function using do-while loops and output the first number greater than 100 in the preceding ..

  Consider a demand-paging system

Consider a demand-paging system with the following time-measured utilizations.

  Digital transmission

If you have 20 stations all connected to the same wire and all using digital transmission. What method of sharing the media must be used? Why do you need a sharing method.

  What is the purpose of onedrive

What is the purpose of OneDrive

  Full subtractor

Show that a full subtractor can be implemented using a "Full Adder" device and two inverter gates - For this, you will have to create a "Full Adder" device (Note: you can use the idea of what you built in question 2)

  Information security management and framework choice

What are the major perspectives to consider in information security management and framework choice

  Design an application to take and process a pizza order

Design an application to take and process a pizza order. The user should be able to make pizza order choices from listboxes, and the application should display the order price.

  How will you run a process in background

How will you run a process in background? How will you bring that into foreground and how will you kill that process?

  Use of tcp/ip and osi models for businesses

Q: Analyze the current options available for use of TCP/IP and OSI models for businesses.

  Use the smallest possible array to solve this problem

Use the smallest possible array to solve this problem. Display the complete set of unique value input after the user inputs each new value.

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