subject
Engineering, 18.11.2019 23:31 brusierlover8590

Develop a function in matlab or python for general linear least square regression with the prototype given below (in matlab): function [a, r2]=genreg(func, x,y) % generates a general regression curve and % plots the curve along with data points % [a, r2]=genreg(func, x,y) % input: % func: name of the function calculating the basis function (z) % x, y: data points % output: % a: regression curve coefficients % r2: coefficient of determination % calculate the regression curve coefficients (a) z=func(x); % calculate r2 % plot the regression curve along with the data end where the input argument func is a separate m-file function calculating the basis functions z1, . . , zm. test your function by fitting a second order polynomial y = a0 + a1x + a2x 2 to the following data. report your results for a0, a1 and a2 as well as the coefficient of determination (r 2 ). show a plot of the regression curve along with the data. x 0 1 2 3 4 5 y 2.1 7.7 13.6 27.2 40.9 61.1

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Air is to be cooled in the evaporator section of a refrigerator by passing it over a bank of 0.8-cm-outer-diameter and 0.4-m-long tubes inside which the refrigerant is evaporating at -20°c. air approaches the tube bank in the normal direction at 0°c and 1 atm with a mean velocity of 4 m/s. the tubes are arranged in-line with longitudinal and transverse pitches of sl- st 1.5 cm. there are 30 rows in the flow direction with 15 tubes in each row. determine (a) the refrigeration capacity of this system and (b) pressure drop across the tube bank. evaluate the air properties at an assumed mean temperature of -5°c and 1 atm. is this a good assumption?
Answers: 1
question
Engineering, 04.07.2019 18:20
Air is compressed isentropically from an initial state of 300 k and 101 kpa to a final temperature of 1000 k. determine the final pressure using the following approaches: (a) approximate analysis (using properties at the average temperature) (b) exact analysis
Answers: 1
question
Engineering, 04.07.2019 19:10
10 kg of co2 is initially contained at 400 kpa and 300 k. the gas constant for carbon dioxide is 189 j/lkg k) and has a specific heat ratio, k, of 1.289. isentropic expansion then occurs until the pressure is 200 kpa. a) determine the initial volume of co2 in m. b) determine the final temperature in k. c) determine the work done by the system during the expansion kl.
Answers: 2
question
Engineering, 04.07.2019 19:10
Abarometer contains mercury with a density of 13600 kg/m3. atmospheric conditions are 95.8 kpa and 20 °c at 20 °c, the vapor pressure of the mercury is 0.000173 kpa. the column of mercury will rise to a height of most nearly. select one: a)- 0.38 m b)- 0.82 m c)- 0.48 m d)- 0.72 m
Answers: 1
You know the right answer?
Develop a function in matlab or python for general linear least square regression with the prototype...
Questions
question
Law, 13.05.2021 16:30
question
Spanish, 13.05.2021 16:30
question
Mathematics, 13.05.2021 16:30
question
Mathematics, 13.05.2021 16:30
question
Spanish, 13.05.2021 16:30
Questions on the website: 13722367