Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Linear Regression create a set of points like this ( all on one line ) p = [[0,3.8414709848078967],[0.6931471805599453,6.6818861490654635],[1.0986122886681098,7.5355691627323065],[1.3862943611198906,7.788374949171635],[1.6094379124341003,8.478827375073264],[1.791759469228055,9.887622378713294],[1.9459101490553132,11.440627194940042],[2.0794415416798357,12.307124413342725]] where: p[i][0] is an x value and

Linear Regression

create a set of points like this ( all on one line )

p = [[0,3.8414709848078967],[0.6931471805599453,6.6818861490654635],[1.0986122886681098,7.5355691627323065],[1.3862943611198906,7.788374949171635],[1.6094379124341003,8.478827375073264],[1.791759469228055,9.887622378713294],[1.9459101490553132,11.440627194940042],[2.0794415416798357,12.307124413342725]]

where:

p[i][0] is an x value

and p[i][1] is the corresponding y value

Find the least square curve that best matches these points using linear regression.

I need four outputs:

n = number of points

m = slope

b = y intercept

r = coefficient of regression.

formulas that might help:

n = p.length

m = (n* xy - x* y)/(n* xx - x* x)

b = ( y - m* x)/n

r = (n* xy - x* y)/sqrt((n* xx - x* x)*(n* yy- y* y))

PLEASE WRITE THE CODE IN NOTEPAD++ OR TEXTEDIT. WRITE IN JAVASCRIPT. MAKE SURE TO COPY AND PASTE CODE.

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions

Question

How will this change in the exchange rate affect them?

Answered: 1 week ago