# Question e8dd9

Dec 8, 2016

See below.

#### Explanation:

Given a model

$y \left(a , t\right) = {a}_{1} t + {a}_{2} + {a}_{3} \sin \left({\omega}_{0} t\right)$

and a set of points

$P = \left(\left({t}_{1} , {y}_{1}\right) , \left({t}_{2} , {y}_{2}\right) , \cdots , \left({t}_{n} , {y}_{n}\right)\right)$

We will try to adjust the model to the $P$ table, by choosing ${a}_{i}$ such that is minimum the error defined as

$E \left(a\right) = {\sum}_{i = 1}^{n} {\left(y \left(a , {t}_{k}\right) - {y}_{k}\right)}^{2}$

The determination of $a = \left({a}_{1} , {a}_{2} , {a}_{3}\right)$ is done by solving the linear system obtained through the stationary conditions

$\frac{\partial E \left(a\right)}{\partial {a}_{i}} = 0$ for $i = 1 , 2 , 3$

so we have to solve the linear system

$M a = b$

where

M = ( (sum t_k^2, sum t_k,sum sin(omega_0t_k)t_k), ( sum t_k,n,sum sin(omega_0t_k)), (sum sin(omega_0t_k)t_k,sum sin(omega_0t_k),sum sin(omega_0t_k)^2))

and

$b = \left(\begin{matrix}\sum {t}_{k} {y}_{k} \\ \sum {y}_{k} \\ \sum \sin \left({\omega}_{0} {t}_{k}\right) {y}_{k}\end{matrix}\right)$

Putting numeric values into the formulas we get

$M = \left(\begin{matrix}540 & 60 & - 12 \\ 60 & 10 & 0 \\ - 12 & 0 & 4\end{matrix}\right)$
$b = \left(\begin{matrix}2430. \\ 350. \\ 10.\end{matrix}\right)$

obtaining {a_1 = 2.5, a_2 = 20, a_3 = 10

Attached a plot showing the results.

Answering the requested items:

a) Using an square minimum error criteria, the parameters are:

$m = {a}_{1} = 2.5$
$b = {a}_{2} = 20$
$A = {a}_{3} = 10$

b) The stock appreciation is linked to a positive rate so

$\frac{\mathrm{df}}{\mathrm{dt}} = m + A {\omega}_{0} \cos \left({\omega}_{0} t\right) > 0$

This is attained for

$0 \le t \le 3.95$ and $8.049 \le t \le 12$

c) The stock loses value for $3.95 \le t \le 8.049$

Dec 9, 2016

Given that $f \left(t\right)$ the value of a stock is modeled as

$f \left(t\right) = m t + b + A \sin \left(\frac{\pi t}{6}\right)$ where t is in months since Jan1

Let us consider

"At Jan1 "t= 0 and f(0)=$20.00 "At Apr1 "t= 3and f(3)=$37.50

"At Jul1 "t= 6 and f(6)=$32.50 "At Oct1 "t= 9 and f(6)=$35.00

"At Jan1 "t= 12 and f(6)=$50.00 so "At Jan1 "t= 0 and f(0)=$20.00

$\implies m \times 0 + b + A \sin \left(0\right) = 20 \implies b = 20. \ldots \ldots \left(1\right)$

"At Apr1 "t= 3and f(3)=$37.50 $\implies m \times 3 + 20 + A \sin \left(\frac{\pi \cdot 3}{6}\right) = 37.50$$\implies 3 m + 20 + A = 37.50$$\implies 3 m + A = 37.50 - 20.00$$\implies 3 m + A = 17.50 \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots . \left(2\right)$"At Jul1 "t= 6 and f(6)=$32.50#

$\implies 6 \times m + 20 + A \sin \left(\frac{\pi \cdot 6}{6}\right) = 35.00$

$\implies 6 \times m + 20 + 0 = 35$

$\implies m = \frac{15}{6} = 2.5 \ldots \ldots \ldots \ldots \ldots \ldots \ldots \ldots . . \left(3\right)$

From (2) and (3) we get

$\implies 3 \times 2.5 + A = 17.50$

$\implies A = 10.00$

Hence
(a)
$\textcolor{red}{m = 2.50 \text{ } b = 20 \mathmr{and} A = 10}$
(b)

Now the given equation becomes

$f \left(t\right) = 2.5 t + 20 + 10 \sin \left(\frac{\pi t}{6}\right)$

Differentiating this equation w,r to t we get the rate of change of the price of stock as

$f ' \left(t\right) = \frac{d}{\mathrm{dt}} \left(2.5 t\right) + \frac{d}{\mathrm{dt}} \left(20\right) + \frac{d}{\mathrm{dt}} \left(10 \sin \left(\frac{\pi t}{6}\right)\right)$

$\implies f ' \left(t\right) = 2.5 + \frac{10 \pi}{6} \cos \left(\frac{\pi t}{6}\right)$
In this equation the value of $\cos \left(\frac{\pi t}{6}\right)$ varies with time.
$\cos \left(\frac{\pi t}{6}\right)$ has got maximum positive value at t=0 and t =12 as $\cos 0 \mathmr{and} \cos \left(2 \pi\right) = 1$
So rate of positive change of price of stock will occur in this period i.e. Jan every year this means the stock appreciate s most in this period.

(c)

Taking $f ' \left(t\right) = 0$ we have

$2.5 + \frac{10 \pi}{6} \cos \left(\frac{\pi t}{6}\right) = 0$

$\implies \cos \left(\frac{\pi t}{6}\right) = - \frac{1.5}{\pi}$

$\implies t = \frac{6}{\pi} {\cos}^{-} 1 \left(- \frac{1.5}{\pi}\right) \approx 3.95 \approx 4 \to \textcolor{red}{\text{month of May}}$

when t =4

$f ' ' \left(4\right) = - \frac{10 {\pi}^{2}}{36} \sin \left(\frac{\pi \cdot 4}{6}\right) < 0 \to \text{indicates maximum}$

Again $t = \frac{6}{\pi} \left(2 \pi - {\cos}^{-} 1 \left(- \frac{1.5}{\pi}\right)\right) = 12 - \frac{6}{\pi} {\cos}^{-} 1 \left(- \frac{1.5}{\pi}\right)$

$= 12 - 3.95 = 8.05 \to \text{ indicates month of September}$

when t =8

$f ' ' \left(8\right) = - \frac{10 {\pi}^{2}}{36} \sin \left(\frac{\pi \cdot 8}{6}\right) > 0 \to \textcolor{red}{\text{indicates Minimum}}$

So during the period May -September growth of price gets diminished i.e the price of the stock is actually losing in this period.

Dec 17, 2016

Alternate solution for part (c)

#### Explanation:

For Solution posted by @dk_ch
The modelling equation becomes

$f \left(t\right) = 2.5 t + 20 + 10 \sin \left(\frac{\pi t}{6}\right)$

Using inbuilt graphics tool the plotted equation looks like

The maximum and minimum of the curve are located for $t = 3.951$ and $8.049$ respectively. These values correspond to months of May and September.
As such the stock actually lost value from May to August.

--.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-..-

For Solution posted by @Cesareo R

$f \left(t\right) = 2.25 t + 18.49 + 7.29 \sin \left(\frac{\pi t}{6}\right)$, values rounded to two decimal places

$m = {a}_{1} = 2.25439$, $b = {a}_{2} = 18.49$, $A = {a}_{3} = 7.29285$

Using inbuilt graphics tool the plotted equation looks like

The maximum and minimum of the curve are located for $t = 4.204$ and $7.796$ respectively. These values correspond to months of May and September.
As such the stock actually lost value from May to August.