Lines can be used to approximate a wide variety of functions; often a function can be described using many lines.
If a stock price goes from $10 to $12 from January 1st to January 31; from $12 to $9 from February 1st to February 28th; and from $9 to $15 from March 1st to March 31th. Is the price change of the stock $10 to $15 from January 1st to March 31st a straight line?
It is clear that in each of the three time intervals mentioned there was a complex daily variation of prices as in an electrocardiogram. But what would be a simplified solution for a first naive view of the situation? Would a simple function hold up? What is the simplest function to represent this situation? Does your naïve initial and simplified model allow you to predict the behavior of the stock in the next month?
How can I use three “pieces” of lines to describe the price movements from the beginning of January to the end of March? Show the graph for the price movement.
Answers:
The following points we have per month will be as follows:
January (1,10) and (31,12); February (1,12) and (28,9); March
(1,9) and (31,15)
To get the slope we use the formula: M = (y2-y1)/(x2-x1)
Therefore:
slope for January: M = (12-10)/(31-1)
M =
2/30
M = 1/15
slope for February: M = (9-12)/(28-1)
M = -3/27
M = -1/9
slope for March:
M = (15-9)/(31-1)
M = 6/30
M = 1/5
The equation we use to get the line for each month will be: y=(m)+b where y represents
the first point of the month, m represents the slope.
For the month of January, we calculate the line as below:
First, get the value of (b)
y = (m)+b – where y is the first point of the
month (1,10)
10 = (1/15) + b
b = 9.93 – after we get the value of b, we the
formula line will now be: y = (x/15) + 9.93
For the month of February, we calculate the line as below:
First, get the value of (b)
y = (m)+b – where y is the first point of the
month (1,12)
12 = (-1/9) + b
b = 12.11 – after we get the value of b, we the
formula line will now be: y = (-x/9) + 12.11
For the month of February, we calculate the line as below:
First, get the value of (b)
y = (m)+b – where y is the first point of the
month (1,9)
9 = (1/5) + b
b= 8.8 – after we get the value of b, we the
formula line will now be: y = (x/5) + 8.8
To graph these lines, please see below.
Legends:
red line represents January; blue line represents February; green
line represents March
No comments:
Post a Comment