Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( It is recommended that you spend no longer than 4 0 minutes on this question, including time to upload any file attachments. ) Following

(It is recommended that you spend no longer than 40 minutes on this question, including time to upload any file attachments.) Following program uses function linfit to find the line of best fit equation for the provided set of X-sorted X & Y data. Develop function linfit so that it receives the X & Y data set and return the coefficients (slope and y-intercept) of the line of best-fit equation. The function should return NaN if X and Y does not have the same size or does not have minimum number of elements (note that for linear fitting we need at least 2 points). The following steps can be used to find the equation of line of best fit based on least square method.
Step-1: Calculate the mean of the x-values and the mean of the y-values.
x=x1+x2+cdots+xnn and ?bar(Y)=y1+y2+cdots+ynn
Step-2: the following formula gives the slope (m) of the line of best fit,
m=(x1-(x))(y1-(?bar(Y)))+(x2-(x))(y2-(?bar(Y)))+cdots+(xn-(x))(yn-(?bar(Y)))(x1-(x))2+(x2-(x))2+cdots+(xn-(x))2
Step-3: compute the y-intercept (b) of the line by using the below formula,
b?b=ar(Y)-mx
Save your completed program as XY.f95 and upload it, also Copy-&-paste it into the provided space below.
For an online FORTRAN compiler click here. A list of Fortran90 intrinsic functions can be found here or here.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions

Question

What are the key elements of control over an investee?

Answered: 1 week ago

Question

Why is desire important for success? (p. 271)

Answered: 1 week ago