JavaScript代写:BCPR280 Linear Regression Analysis

代写JS程序,进行线性回归分析,计算出最合适的参数。

Requirements

Write a program to calculate the linear regression size-estimating parameters for two arrays, each of n numbers. Enhance program 1 to work for the new calculations with minimal duplication.

Given a set of historical data for variables x and y, you want to determine if a likely value yk based on a known or estimated new value xk. An example would be the relationship between the estimated object LOC in a program and the actual new and changed program LOC.

Conditions

The historical x and y data must demonstrate a relationship.

There must be sufficient data produce a statistically significant result (at least three items and preferably five or more.)

Determine the beta0 and beta 1 parameters that best represent the relationship between these x and y data, and then calculate yk using the following formula and the available data.

Testing

Thoroughly test the program. At a minimum, use this program to calculate the beta parameters for the three provide data sets.

TEST DATA

Program NumberEstimated Object LOCEstimated New and Changed LOCActual New and Changed LOC
1130163186
2650765699
399141132
4150166272
5128137291
6302355331
795136199
894512061890
9368433788
1096111301601
Sum382846326389
Average382.8463.2638.9
  1. Use the data in above for estimated object LOC and actual new and changed LOC. The resulting values should be beta_0 = -22.55 and beta_1 = 1.7279.
  2. Calculate the beta_0 and beta_1 parameters for the regression fit of estimated new and changed LOC to actual new and changed LOC columns in Table D8. The answer in this case should be beta_0 = -23.92 and beta_1 = 1.4310.
  3. Calculate the beta_0 and beta_1 parameters for the estimated new and changed LOC and the actual new and changed LOC for the programs 2A, 3A and 4A that you have developed.

WORKED EXAMPLE

Program NumberEstimated Object LOCEstimated New and Changed LOCXiYiXi2
1113018624180
22650699454350
339913213068
4415027240800
5512829137248
6630233199962
779519918905
8894518901786050
99368788289984
101096116011538561
Sum3828638943031082540284
Average382.8638.9
]]>

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注