Live data from Hacker News

Functions are vectors

thenumb.at

81–90 of 124 posts

Re: Functions are vectors

#81

I haven't read the article yet, but I've known that functions are (infinite) vectors for some years. However, there's something that has been bothering me: most of my understanding of linear algebra comes from 2D and 3D spaces, and then in different context of machine learning, datasets that have from tens to even millions of dimensions. In the former, geometric context, the connection between the dimensions are clea…

I am not sure I fully understand your question, but I’ll try to answer the question I understood. Very generally, every field of math I know concerns itself with mappings and what they do (e.g. matrixes are mappings, as are metrics and norms). The differences between the different areas of math (oversimplified) is that they concern themselves with different kinds of mappings. The area I specialized in was partial differential equations, here the mappings of interest are solutions to partial differential equations (usually generalized functions). One of the important questions to ask is of these functions are continuous, differentiable, or any other of the many variations. All of these properties are defined over how a function maps an input to an output.

BTW: There’s usually an infinite number of solutions to a differential equation, and IIRC (it’s been a while) those solutions too form a vector space.

Re: Functions are vectors

#82

I’d probably have titled this something including either the term “linear” or “functional analysis”. Because submitted here, we will first interpret “functions” in the context of a function in computer programming, where the statement is more provocative and thus clickbaity. The problem is many real world functions and problems are nonlinear. But they may have linear components. For example, a dog can be recognized b…

Yep, went there to learn how to use vectors to replace methods...

For some reason computer programmers took the mathematical definition of "functions", used it for their things which are emphatically not mathematical functions, and are now complaining that they get confused by people talking about the old math definition.

Re: Functions are vectors

#83

"Given these definitions, we can now prove all necessary vector space axioms." And that is just the first howler. This person never bothered to learn the subject they are expounding on.

The article is by no means perfect, but that "howler" sees completely fine to me. If you want to prove something is a vector space the standard way would be to prove that all the vector space axioms hold for it.

Yes. Prove the axioms hold for a space of functions. Very sloppily written article.

Re: Functions are vectors

#84

Earlier quoted context omitted.

The article is by no means perfect, but that "howler" sees completely fine to me. If you want to prove something is a vector space the standard way would be to prove that all the vector space axioms hold for it.

Yes. Prove the axioms hold for a space of functions. Very sloppily written article.

I wouldn't describe that as sloppy. If it was written in isolation it would be a bit weird but given the context I think its completely fine.

Re: Functions are vectors

#85

Earlier quoted context omitted.

That's not the definition of a function, what you're describing would be called a bijective function. A simple function that is not bijective and maps to two distinct values would be sqrt(x)

That is the definition of a function, but it's purely a formalism. In reality, and in theoretical math, we are frequently interested in functions that generate multiple values, and it's very easy to represent those in terms of the formal definition: 1. When we want to consider both positive and negative square roots, we can just say that instead of the function sqrt(x): ℝ ⟶ ℝ which always gives a nonnegative real num…

Hi thaumasiotes, Mathematician here, and somewhow interested in this discussion. I am curious of your definition of full_sqrt, what would be the value of full_sqrt(-3) ?

Re: Functions are vectors

#86

> Now, a vector really is just an arbitrary function Not really grokking this. Seems to come out of nowhere.

try to look at it as a kind of format were you are storing equations (by the moment)

You process the operations between such equations -sum, inner, outer- by "unpacking" them into Matrix equations format (populating the Matrix with the vector values), doing the operations, and returning back to the vector format.

So in essence you are working with Matrix equations, but with a more compact format as vector.

For being able to work with such equations' compact format, its needed to follow some rules restricted to the purpose, case contrary, as in reality they are vectors per se, the geometries could mix dimensions were the equations' proprieties are different.

Re: Functions are vectors

#87

Earlier quoted context omitted.

> That is the definition of a function, but it's purely a formalism... Isn’t the function definition meant to be interpreted as “maps consistently to exactly one element of the codomain”? So an ordered pair of R^2 is still one element of R^2 It seems the parent has just mixed up the domain and codomain, because under that assumption he would be right about both the definition and bijectivity

I can't tell what you mean by your emphasis on the word "consistently". Functions are not stochastic; f(y) is f(y) regardless of how many times you ask what f(y) is. The formal definition guarantees that whenever a = b, f(a) = f(b). You use it when you need that guarantee. An ordered pair drawn from ℝ² is in some sense a single value. In another sense, it is two values. Which way you want to think about it depends on…

>is in some sense a single value. In another sense, it is two values.

What I tryed to say is that the sense in which “exactly one element” is used in the definition of function is inclusive of codomain being R^n, so it confused me why you would provide a function that has a codomain of R^2 as something that suggests deviation from the formalism. It just seemed misleading to phrase it that way

I thought consistently would convey the idea I had, nevermind if it doesn’t

My bad about bijectivity, I see it now, you’re right

Re: Functions are vectors

#88
post #30

I have never seen these index functions used as a transfinite basis for a vector space. And it seems like the function is not a limit point of finite sequences of basis functions, but some weird transfinite sum with mostly zero entries? Clearly there is no Fourier transformation possible on all functions? I think diagonalization methods would be easy to disprove any useful result. Even Hilbert spaces are usually just…

For something to be a basis each element needs to be the finite linear combination. Of course there are notions for different kinds of choices of basis, where you have countable linear combinations.

The article (maybe for good reason) completely ignores the (usually quite hard) choice in functional analysis which vectorspace to use.

And the one outlined here, where functions are defined pointwise, is amost always the most useless one to consider. Although I get that it was done to teach the general outline of the subject, which is quite valuable on its own.

>Clearly there is no Fourier transformation possible on all functions?

You don't even get a useful metric for such a space.

Re: Functions are vectors

#89
I think the article has it backwards and provides bad intuition. It is not input that makes functions form a vector space, it is the output. Functions from any set X to a field F can form a vector space, even if X is unordered.

Re: Functions are vectors

#90

I haven't read the article yet, but I've known that functions are (infinite) vectors for some years. However, there's something that has been bothering me: most of my understanding of linear algebra comes from 2D and 3D spaces, and then in different context of machine learning, datasets that have from tens to even millions of dimensions. In the former, geometric context, the connection between the dimensions are clea…

I think what you're getting at is two things. You have a dataset. This consists of some set of observations, each of which contains features that have been observed. These may be things like education level, age, income, favorite color, gender, and height. Three of these variables are continuous. One is ordinal. One is nominal. One is binary. Can you do any kind of meaningful matrix operations with this data?

Traditionally, in regression analysis, you'd use dummy variables for the nominal/binary data, turning all of them into binary {0, 1}. This is GF(2), a bonified vector space. Education level you've got some choices. You can also encode these as binary, potentially losing some information given they're ordered. But if you choose to map them to integers or real numbers, what is the justification for the distance function you're defining? Is MD > PhD? How much greater is PhD than BA than high school diploma?

If you stick to one-hot encoding, there's justification in performing regression analysis still, because you end up in a case where most of the values are 0 and drop out and you get multiple models, one for each case, so the matrix operations being performed to generate the model only operate on the remaining real-valued vectors, and the one case that is 1 becomes the constant term. This is just basic ANCOVA.

You have another issue, though, right? Are "height" and "income" and "age" really from the same vector space? Obviously not. Some modelers choose to ignore this. Some will assume they're all normally distributed and tranform the individual values to a Z-score or something and then they're all from the same vector space. But this still may be dubious. For one thing, they're not actually normally distributed. Height and age have a strictly zero lower-bound. They have some upper-bound, whatever it may be. Income is severely right-skewed. But they're probably all at least approximately normal over some restricted range of the most common values.

We're starting to see the issue. Modeling in this way might work reasonably well within some restricted range of common values, but extreme cases are left out. We need some other techniques that don't rely on matrix math, because once we have to admit all of our elements from not from the same field, we admit we don't really have a matrix, even if a computer will gladly let us pretend anything we can encode as a number is actually a number.

I think your question is how can we encode data such that it all ends up in the same vector space? It's easy if your data is imagery. Color channel intensity of each pixel is all real-valued, possibly within different ranges, but easily normed. If all you have is text, representing the corpus by an incidence matrix puts all of your elements in GF(2). Plenty of other word embeddings are well-justified. But when you start looking at longitudinal data from epidemology, the shit they do in econometrics, it starts to get less math and more black magic. By the time you're a data scientist at Netflix, I'm sure they have reason to believe whatever they're doing works, but it may be hard to reason about why it works.

I don't really know if there any field of mathematics studying ways of encoding data such that doing things like adding and multipying height by favorite color actually means anything, but it's an interesting question.

Post reply on HN