Showing posts with label sanity check. Show all posts
Showing posts with label sanity check. Show all posts

Saturday, May 8, 2021

Dot Product Matrix Transpose Browlf

So it's Saturday night and I'm watching Brad Osgood's lectures on Fourier analysis when he writes something on the blackboard that should be familiar:

  <Ax,y> = <x,ATy>

(the angle brackets indicate dot product). The point being, the matrix picks up a transpose when shifted to the other vector.

By "should be familiar," I mean should be familiar to me (maybe to you too, but I'm not judging). However, it wasn't. This ostensibly basic fact of linear algebra had suddenly arrived in my life without warning, like a stray kitten or a subpoena.

I prolly would have felt bad were it not for a gutfull of cheap vodka (what part of "Saturday night" did you not understand?). Because this looks like the kind of identity that should have been tattooed on my psyche somewhere in my undergraduate travels. Circle Pines U being what it is, I assumed here was simply yet another basic mathegonical factoid that had eluded me (or I it).

But, alas, for once my shortcomings could not be blamed on a $7/credit hour education.

Come morning, once the black mist had lifted and the voices stopped calling, I scoured my favorite resources for an explanation of the identity only to discover that, too, wasn't there. Greenberg. Mangel. Caswell. Rencher. CRC. My Schaum's library. All failed me. This apparently simple trick of the linear algebra light appeared in none.

It would seem I had to figure it out myself.

That's just rude.

Thursday, August 29, 2019

Averaging Correlation Coefficients

LabKitty sanity check logo
Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

When I was back there in seminary school, there was a person there who put forth the proposition that you can petition the Lord with prayer.

Petition the Lord with prayer.

Petition the Lord with prayer.

YOU CANNOT PETITION THE LORD WITH PRAYER!!11!

Also, you cannot average correlation coefficients.

Friday, March 15, 2019

How does filtering change the degrees of freedom in time series data?

LabKitty sanity check logo
Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

Today's Sanity Check is brought to you by Google. Or not brought to you by Google as it were.

What it didn't bring was the gorram required information. To me. When I typed the post title as a search phrase.

I was attempting to suss how the degrees of freedom should be adjusted when testing the correlation of two time series signals if the data are filtered. That ain't exactly rocket science -- as we shall see, the answer is rather intuitive -- but it is some kind of science, and in science it's simply not cricket to guess. So Google I did.

Yikes.

Here is a question that has truly fallen through the cracks of the internet. I wasn't expecting a Spanish Inquisition, which was fortunate because what I got was no inquisition at all. There was exactly one hit I would call relevant in the pile of Google offal I obtained. But, alas, my attempts to decrypt the author's fingerbarfings led nowhere, perhaps because I lacked the requisite decoder ring but more because the explanatory figure she proffered was less an explanatory figure and more a collection of lines with some text underneath. And so here we are.

Drink more Ovaltine, indeed.

Note to the impatient: You can skip to the end for a summary, but in so doing you will miss out on much explanatory background and charming (or not) wiseassery.

Monday, June 4, 2018

Sanity Check: Wherefore Art Thou Similarity Transformation?

Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

Remember matrix-vector multiplication? We multiply a vector (call it x) by a matrix (call it A) and obtain a new vector: y = Ax. Somewhere in your travels you were told to stop thinking of this as matrix algebra and start thinking of it as a mapping. A is a matrix, yes, but it represents a linear mapping that operates on x and sends it somewhere, and we call the new thingy y.

Perhaps here you say da doi, of course a matrix vector product is a linear transformation and a linear transformation is a matrix vector product. But it's a bona fide theorem. Poke around a linear algebra textbook and you'll find something like: A transformation F: Rn → Rm is linear if and only if it is a matrix transformation. Can you prove it? I can't, but somebody can.

Today, however, we are interested in coordinate transformations. Suppose we have a mapping of the vector x into y represented by the matrix A. That is, y = Ax. Now, suppose we change the basis. In the new basis, x → x' and y → y'. Is it still true that y' = Ax'?

No, it is not.

Monday, March 26, 2018

Sanity Check: Stop Right There, Derivative Scum

Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

The conversion of a higher order differential equation into a system of first order equations is a mainstay of ODE-fu. To give a simple illustration, assume x is a function of t and we are asked to solve:

    x'' + x = 0

In the usual parlance, we define an auxiliary variable y = x'. We then recast our single second-order equation as two first order equations:

    y = x'
    y' + x = 0

Rearrange:

    x' = y
    y' = -x

Switching to vector notation by defining x = [ x y ]T and A = [ 0 1 ; -1 0 ] gives us a tidy result:

    x' = Ax

As Robocop would say: Stop right there, criminal scum.

Wednesday, May 31, 2017

Sanity Check: Equivalence of the t-test and F-test in linear regression, and how you get one from the other

Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

Here is what I would like.

I would like to type "equivalence of the t-test and F-test in linear regression, and how you get one from the other" into Google and arrive at a website page that explains the equivalence of t-test and F-test in linear regression in a comprehensible fashion. Bonus points for explaining how you get one from the other.

One ought not think this is an impossible order, current Google results speaking to the contrary.

Cursing darkness, lighting candle, etc.

Read on.

Thursday, April 28, 2016

Sanity Check: Abusing Constants of Integration

Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

Q: What's the difference between a constant of integration and a dog?

A: A constant of integration smells better.

Ha! I kid! There's no difference between a constant of integration and a dog. Loyal, trustworthy, friend of mankind. Also, a long history of abuse. Sad but true. And while LabKitty does not encourage anybody to abuse a dog, LabKitty encourages everybody to abuse a constant of integration. It's what they're for. Your calculus teacher didn't dare describe them using quite so colorful a metaphor, lest Sarah McLachlan appear in class with a bad look to her and rope. But LabKitty lies safely entrenched behind the Iron Firewall of labkitty.com, far beyond the clutches of the Grammy-winning chanteuse or, to be honest, reason of any kind. Save your weepy PSAs for someone whose humanity wasn't crushed out of them by graduate school.

As usual, you are probably asking: Kitty, what the heck are you on about?

Monday, March 28, 2016

Sanity Check: Abbott and Costello and Calculus

Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

I was recently flipping through David Griffiths' very nice undergraduate E&M textbook and came across this tidbit in his whirlwind review of calculus:
Question: Suppose we have a function of one variable f(x). What does the derivative, df/dx, do for us? Answer: It tells us how rapidly the function f(x) varies when we change the argument x by a tiny amount dx: df = (df/dx) dx. In words: If we change x by an amount dx, then f changes by an amount df; the derivative is the proportionality factor.
This is a fresh way of thinking about the derivative (a constant of proportionality) which is usually defined as the slope of a tangent line or a rate of change or a limit arglebargle. Yet, the equation Griffiths writes is more often used as the definition of the differential. I remember it appeared in my Calc-I textbook soon after we discussed the derivative, where it seemed to me to create a kind of calculus chicken and egg, a mathematical vaudeville act right out of Abbott and Costello:

  What's a derivative?
  df/dx.
  df/dx is the derivative?
  It's how much the function changes.
  When you change x?
  Yes.
  So df is how much f changes?
  Yes.
  So df = (df/dx) dx.
  Yes.
  The derivative tells you the change?
  Yes.
  But isn't df/dx the ratio of the changes?
  That's what I'm asking you.
  Third base!

Monday, July 20, 2015

Sanity Check: Torturing the Derivative

Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

Suppose we have a function y = y(x) and we're given a description of its first derivative: dy/dx = something. As you probably know, the standard trick for moving forward here is to treat dy/dx as a fraction. You move dx to the RHS and integrate both sides of the resulting expression:

   dy/dx = something
  ⇔ dy = something dx
  ⇔   ∫ dy =  ∫  something dx
  ⇔   y =  ∫  something dx

If you can do the final integral, so much the better.

But here's the thing. This is wrong.

Wednesday, May 6, 2015

Sanity Check: Why Calculus?

the Galatian suicide
Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

I have oft gushed in these pages about the wonderfulness of calculus. Even if you hate the subject, perhaps because you are currently getting smacked around in a calculus course (I know the feeling) you must nonetheless accept a simple truth: Calculus is what separates us from the animals. If there are aliens, and there had better be, the "notable accomplishments" entry on Earthlings in the alien Wikipedia will have but two entries: (1) calculus, and (2) those glass globes you shake and it snows inside.

Still, it is possible to get to the end of a four semester calculus sequence and miss the point. It's like watching Dawn of the Dead and only years later realizing Romero was deconstructing the Freudian model of the subconscious, with zombie id, biker ego, and our scrappy band of heroes the superego. (Not really sure what the helicopter represented. The violence inherit in the system, I think.)

So we ask: Why calculus? Why suffer its outrageous slings and arrows? Wherefore art thou, calculus?

Why? Because Nature is a bitch. Not how you'll hear it explained in polite company, but that does not make it untrue.

Sit, my children. For it is time you learn the way of things.

Wednesday, October 1, 2014

Sanity Check: A Metaphor for Taylor Series Convergence Using Barnyard Animals

Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

Behold. I give you a metaphor for Taylor series approximation.



Either LabKitty has gone mad, or this is a demonstration of profound mathematical insight. Or both. Could be both. That is surely a possibility, as surely as there will be slow motion footage of the bikini barrel race.

Wednesday, May 28, 2014

Sanity Check: How to Invert a Function

Sanity Checks are missives on a specific math point in need of clarification.

Somewhere back in the black mist, you probably learned that the way to get the graph of the inverse of a function is to reflect the graph of the function about the line y = x (you can also invert a function by algebra bargle, but that's not what we're after here).

But there's another way. It's obvious if you've seen it, but like many things the world seems divided into two camps: those who have seen the trick and those who haven't.

Here's the trick. Assume you have a piece of paper upon which is drawn the graph of the function of interest. To see what the graph of the inverse looks like:

    1) Rotate the paper 90 degrees counter-clockwise.
    2) Flip the paper over.
    3) Hold the page up to a light so you can see through it.

Viola! You are now looking at the graph of the inverse of the function.

Want a handy diagram of the process? On a mug? Of course you do.

Friday, April 18, 2014

Sanity Check: A Better Notation for Integration by Parts

Sanity Checks are missives on a specific math point in need of clarification. I try to do so using the fewest words possible. Usually, this is still quite a few words.

Today, just a brief browlf to pass along an alternative notation for integration by parts I recently stumbled across (in Weinstock's book on variational calculus, but no matter). It's not necessarily earth-shaking. But to me, it makes much more sense and is easier to remember than the usual bark bark about u dv's and v du's and writing them in a little rectangle and connecting everything with dotted lines.

As Weinstock puts it, IBP simply lets you swap derivative terms under the integral sign:

integration by parts formula

You may prefer the some-other-way you remember IBP. If so, no worries: I still like you. But after decades of my defective calculus psyche laboring under the dotted line box thing,Weinstock's notation was like a little splash of sunlight breaking through the winter clouds, a promise of girls in convertibles and green things pushing their way through the Circle Pines hardscrabble.