# Linear Transform Possible?

**URL:** <https://boards.straightdope.com/t/linear-transform-possible/752146>\
**Category:** Factual Questions\
**Created:** [April 14, 2016, 1:02am UTC](https://boards.straightdope.com/t/linear-transform-possible/752146 "2016-04-14T01:02:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sage\_Rat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sage_rat/32/399_2.png) [@Sage\_Rat](https://boards.straightdope.com/u/Sage_Rat)\
**Post date:** [April 14, 2016, 1:02am UTC](https://boards.straightdope.com/t/linear-transform-possible/752146/1 "2016-04-14T01:02:34Z")

</div>

I have a set of numbers (A) that can be graphed out as a chart. This chart is strongly related to another set (B) and I want to use it to predict B. So, for example, I know sales history for wombats and I know that for every wombat I sell, I sell a certain related number of fish sticks four weeks from now. With the last 4 weeks of data wombat data, I can predict the next 4 weeks of fish sticks data. The relationship between these is static, week to week, though the actual sales numbers change.

Say that I have calculated that the average height of the two graphs is (for example) 4 and 1 relatively, and the standard deviation 0.6 and 0.2 respectively for all examples. I can translate A into an approximation of B through the following transform:

heightFactor = 1 / 4  
deviationFactor = 0.2 / 0.6

(A - avg(A)) \* deviationFactor + avg(A) \* heightFactor = B

I’d like to be able to generate a linear transformation (V) such that I can multiply it by this week’s A to predict next week’s B, using the constant, known heightFactor and deviationFactor.

Obviously, I could just run the formula above against it, but having a single linear transformation is more useful. The number of elements (n) in A and B is constant and known (e.g., 4 in the wombat/fish sticks example).

Is it possible to calculate a constant, predetermined V such that:

A \* V = B

?

---

<div class="post-metadata">

**Author:** ![OldGuy](https://avatars.discourse-cdn.com/v4/letter/o/3bc359/32.png) [@OldGuy](https://boards.straightdope.com/u/OldGuy)\
**Post date:** [April 14, 2016, 1:16am UTC](https://boards.straightdope.com/t/linear-transform-possible/752146/2 "2016-04-14T01:16:21Z")

</div>

It’s really not clear what you want, but A_V = B is a special case of a linear relation. It is a proportional relation. A linear relation would be A_V + U = B.

If you truly believe that B is proportional to A, then you can compute V by running a regression of B on A and suppressing the intercept.

You can do this in Excel using Linest

LINEST({your B’s}, {your A’s}, FALSE, TRUE or FALSE)

The 1st “False” tells it to suppress the intercept. The final true or false tells Excel whether or not you want additional statistics like the R-squared.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [April 14, 2016, 4:51am UTC](https://boards.straightdope.com/t/linear-transform-possible/752146/3 "2016-04-14T04:51:38Z")

</div>

If the sale of wombats is zero for some week, is the corresponding sale of fish-sticks going to be zero also (for the corresponding time-period, which I gather would be 4 weeks later)?

(Are the fish-sticks for the wombats to eat?)

If 0 wombat sales leads to 0 fish-stick sales, then your graph includes the origin (0, 0) and the linear transformation is A \* V = B, with no U term. This is also called a “homogeneous” relation.

---

<div class="post-metadata">

**Author:** ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)\
**Post date:** [April 14, 2016, 5:03am UTC](https://boards.straightdope.com/t/linear-transform-possible/752146/4 "2016-04-14T05:03:28Z")

</div>

In your formulation,

(A - avg(A)) \* deviationFactor + avg(A) \* heightFactor = B

are avg(A), deviationFactor, and heightFactor fairly stable constants over the long run?

If so, then your formula can be reduced with some trivial algebra to the form

A \* V + U = B

where the U term is present and non-zero. In other words, NOT the homogeneous (proportional) case mentioned in the two posts above.

The trivial algebra rearranges your formulation

(A - avg(A)) \* deviationFactor + avg(A) \* heightFactor = B

into:

(A \* deviationFactor) + [(-avg(A) \* deviationFactor) + (avg(A) \* heightFactor)] = B

where (A \* deviationFactor) is your A\*V part,

and [(-avg(A) \* deviationFactor) + (avg(A) \* heightFactor)] is your constant term U part.
