Suggested languages for you:

Americas

Europe

Q8E

Expert-verified
Found in: Page 331

### Linear Algebra and its Applications

Book edition 5th
Author(s) David C. Lay, Steven R. Lay and Judi J. McDonald
Pages 483 pages
ISBN 978-03219822384

# A simple curve that often makes a good model for the variable costs of a company, a function of the sales level $$x$$, has the form $$y = {\beta _1}x + {\beta _2}{x^2} + {\beta _3}{x^3}$$. There is no constant term because fixed costs are not included.a. Give the design matrix and the parameter vector for the linear model that leads to a least-squares fit of the equation above, with data $$\left( {{x_1},{y_1}} \right), \ldots ,\left( {{x_n},{y_n}} \right)$$.b. Find the least-squares curve of the form above to fit the data $$\left( {4,1.58} \right),\left( {6,2.08} \right),\left( {8,2.5} \right),\left( {10,2.8} \right),\left( {12,3.1} \right),\left( {14,3.4} \right),\left( {16,3.8} \right)$$ and $$\left( {18,4.32} \right)$$, with values in thousands. If possible, produce a graph that shows the data points and the graph of the cubic approximation.

(a) The required matrix and vectors are:

Design Matrix: X = \left( {\begin{aligned}{{x_1}}&{x_1^2}&{x_1^3}\\ \vdots & \vdots & \vdots \\{{x_n}}&{x_n^2}&{x_n^3}\end{aligned}} \right)

Parameter vector: \beta = \left( {\begin{aligned}{{\beta _1}}\\{{\beta _2}}\\{{\beta _3}}\end{aligned}} \right)

(b) The least-squares equation is $${\bf{y}} = 0.5132x + 0.3348{x^2} + 0.001016{x^3}$$.

Graph:

See the step by step solution

## The General Linear Model

The equation of the general linear model is defined as:

$${\bf{y}} = X\beta + \in$$

Here, {\bf{y}} = \left( {\begin{aligned}{{y_1}}\\{{y_2}}\\ \vdots \\{{y_n}}\end{aligned}} \right) is an observational vector, X = \left( {\begin{aligned}1&{{x_1}}& \cdots &{x_1^n}\\1&{{x_2}}& \cdots &{x_2^n}\\ \vdots & \vdots & \ddots & \vdots \\1&{{x_n}}& \cdots &{x_n^n}\end{aligned}} \right) is the design matrix, \beta = \left( {\begin{aligned}{{\beta _1}}\\{{\beta _2}}\\ \vdots \\{{\beta _n}}\end{aligned}} \right) is parameter vector, and \in = \left( {\begin{aligned}{{ \in _1}}\\{{ \in _2}}\\ \vdots \\{{ \in _n}}\end{aligned}} \right) is a residual vector.

## Find design matrix, observation vector, parameter vector for the given equation

(a)

The given equation is $${\bf{y}} = {\beta _1}x + {\beta _2}{x^2} + {\beta _3}{x^3}$$ , and the given data sets are $$\left( {{x_1},{y_1}} \right), \ldots ,\left( {{x_n},{y_n}} \right)$$.

Write the Design matrix, observational vector, and the parameter vector for the given equation and data set by using the information given in step 1.

Design matrix:

X = \left( {\begin{aligned}{{x_1}}&{x_1^2}&{x_1^3}\\ \vdots & \vdots & \vdots \\{{x_n}}&{x_n^2}&{x_n^3}\end{aligned}} \right)

Observational vector:

{\bf{y}} = \left( {\begin{aligned}{{y_1}}\\ \vdots \\{{y_n}}\end{aligned}} \right)

And the parameter vector for the given equation is,

\beta = \left( {\begin{aligned}{{\beta _1}}\\{{\beta _2}}\\{{\beta _3}}\end{aligned}} \right)

## Find design matrix, observation vector for the given data set

(b)

The given data points are: $$\left( {4,1.58} \right),\left( {6,2.08} \right),\left( {8,2.5} \right),\left( {10,2.8} \right),\left( {12,3.1} \right),\left( {14,3.4} \right),\left( {16,3.8} \right)$$ and $$\left( {18,4.32} \right)$$.

Find $$X$$, $$\beta$$ and $${\bf{y}}$$ for the given data set by using the models in step 2.

\begin{aligned}X = \left( {\begin{aligned}4&{{4^2}}&{{4^3}}\\6&{{6^2}}&{{6^3}}\\8&{{8^2}}&{{8^3}}\\{10}&{{{10}^2}}&{{{10}^3}}\\{12}&{{{12}^2}}&{{{12}^3}}\\{14}&{{{14}^2}}&{{{14}^3}}\\{16}&{{{16}^2}}&{{{16}^3}}\\{18}&{{{18}^2}}&{{{18}^3}}\end{aligned}} \right)\\ = \left( {\begin{aligned}4&{16}&{64}\\6&{36}&{216}\\8&{64}&{512}\\{10}&{100}&{1000}\\{12}&{144}&{1728}\\{14}&{196}&{2744}\\{16}&{256}&{4096}\\{18}&{324}&{5832}\end{aligned}} \right)\end{aligned}

{\bf{y}} = \left( {\begin{aligned}{1.58}\\{2.08}\\{2.5}\\{2.8}\\{3.1}\\{3.4}\\{3.8}\\{4.32}\end{aligned}} \right)

## The normal equation

The normal equation is defined as:

$${X^T}X\beta = {X^T}{\bf{y}}$$

## Find the least-squares curve

The general least-squares equation is given by $${\bf{y}} = {\beta _1}x + {\beta _2}{x^2} + {\beta _3}{x^3}$$, and to find the associated least-squares curve, the values of $${\beta _1},{\beta _2}$$ are required, so find the values of $${\beta _1},{\beta _2},{\beta _3}$$ by using normal equation.

By using the obtained information from step 2, the normal equation will be,

$$\beta = {\left( {{X^T}X} \right)^{ - 1}}{X^T}{\bf{y}}$$

That implies;

\left( {\begin{aligned}{{\beta _1}}\\{{\beta _2}}\\{{\beta _3}}\end{aligned}} \right) = {\left( {{{\left( {\begin{aligned}4&{16}&{64}\\6&{36}&{216}\\8&{64}&{512}\\{10}&{100}&{1000}\\{12}&{144}&{1728}\\{14}&{196}&{2744}\\{16}&{256}&{4096}\\{18}&{324}&{5832}\end{aligned}} \right)}^T}\left( {\begin{aligned}4&{16}&{64}\\6&{36}&{216}\\8&{64}&{512}\\{10}&{100}&{1000}\\{12}&{144}&{1728}\\{14}&{196}&{2744}\\{16}&{256}&{4096}\\{18}&{324}&{5832}\end{aligned}} \right)} \right)^{ - 1}}{\left( {\begin{aligned}4&{16}&{64}\\6&{36}&{216}\\8&{64}&{512}\\{10}&{100}&{1000}\\{12}&{144}&{1728}\\{14}&{196}&{2744}\\{16}&{256}&{4096}\\{18}&{324}&{5832}\end{aligned}} \right)^T}\left( {\begin{aligned}{1.58}\\{2.08}\\{2.5}\\{2.8}\\{3.1}\\{3.4}\\{3.8}\\{4.32}\end{aligned}} \right)

Use the following steps to find the associated values for the obtained data in MATLAB.

1. Enter the data \left( {\begin{aligned}{{\beta _1}}\\{{\beta _2}}\\{{\beta _3}}\end{aligned}} \right) = {\left( {{{\left( {\begin{aligned}4&{16}&{64}\\6&{36}&{216}\\8&{64}&{512}\\{10}&{100}&{1000}\\{12}&{144}&{1728}\\{14}&{196}&{2744}\\{16}&{256}&{4096}\\{18}&{324}&{5832}\end{aligned}} \right)}^T}\left( {\begin{aligned}4&{16}&{64}\\6&{36}&{216}\\8&{64}&{512}\\{10}&{100}&{1000}\\{12}&{144}&{1728}\\{14}&{196}&{2744}\\{16}&{256}&{4096}\\{18}&{324}&{5832}\end{aligned}} \right)} \right)^{ - 1}}{\left( {\begin{aligned}4&{16}&{64}\\6&{36}&{216}\\8&{64}&{512}\\{10}&{100}&{1000}\\{12}&{144}&{1728}\\{14}&{196}&{2744}\\{16}&{256}&{4096}\\{18}&{324}&{5832}\end{aligned}} \right)^T}\left( {\begin{aligned}{1.58}\\{2.08}\\{2.5}\\{2.8}\\{3.1}\\{3.4}\\{3.8}\\{4.32}\end{aligned}} \right)in the tab in the form of {\left( {{{\left( {\begin{aligned}4&{16}&{64}\\6&{36}&{216}\\8&{64}&{512}\\{10}&{100}&{1000}\\{12}&{144}&{1728}\\{14}&{196}&{2744}\\{16}&{256}&{4096}\\{18}&{324}&{5832}\end{aligned}} \right)}^T}\left( {\begin{aligned}4&{16}&{64}\\6&{36}&{216}\\8&{64}&{512}\\{10}&{100}&{1000}\\{12}&{144}&{1728}\\{14}&{196}&{2744}\\{16}&{256}&{4096}\\{18}&{324}&{5832}\end{aligned}} \right)} \right)^{ - 1}}{\left( {\begin{aligned}4&{16}&{64}\\6&{36}&{216}\\8&{64}&{512}\\{10}&{100}&{1000}\\{12}&{144}&{1728}\\{14}&{196}&{2744}\\{16}&{256}&{4096}\\{18}&{324}&{5832}\end{aligned}} \right)^T}\left( {\begin{aligned}{1.58}\\{2.08}\\{2.5}\\{2.8}\\{3.1}\\{3.4}\\{3.8}\\{4.32}\end{aligned}} \right).
2. Use colons after that and press ENTER.

So, the value of \left( {\begin{aligned}{{\beta _1}}\\{{\beta _2}}\\{{\beta _2}}\end{aligned}} \right) is: \left( {\begin{aligned}{0.5132}\\{ - 0.03348}\\{0.001016}\end{aligned}} \right)

Now, substitute the obtained values into $${\bf{y}} = {\beta _1}x + {\beta _2}{x^2} + {\beta _3}{x^3}$$.

$${\bf{y}} = 0.5132x + 0.3348{x^2} + 0.001016{x^3}$$

So, the required equation is $${\bf{y}} = 0.5132x + 0.3348{x^2} + 0.001016{x^3}$$.

## Graph the least-squares curve

The obtained least square curve is $${\bf{y}} = 0.5132x + 0.3348{x^2} + 0.001016{x^3}$$.

The graph of the curve is shown below: