<p>This is treated extensively in the statistics literature, under the topic of regression.  Two standard references here are Wasserman's book "all of nonparametric statistics" and Tsybakov's "introduction to nonparametric estimation".  I'll talk briefly about some of the standard stuff, and try to give pointers outside of statistics (this is a common topic and different fields have different cultures: prove different kinds of theorems, make different assumptions).</p>

<ol>
<li><p>(Kernel regressors, sometimes called the Nadaraya-Watson Estimator.)  Here you write the function at any point as a weighted combination of nearby values. More concretely, 
since this is in the statistics literature, you typically suppose you have some examples $((x_i,f(x_i)))_{i=1}^n$ drawn from some distribution,
and fix some kernel $K$ (can think of this as a gaussian, but zero mean is what matters most), and write
$$
\hat f(x) := \sum_i f(x_i) \left(\frac{ K(c_n(x-x_i)) }{ \sum_j K(c_n(x-x_j))}\right),
$$
where $c_n\to\infty$ (you are more sensitive to small distances as $n$ increases).
The guarantee is that, as $n\to\infty$, a probilistic criterion of distortion
(expectation of sup-norm, high probability, whatever) goes to zero.
(It hardly matters what $K$ looks like---it matters more how you choose $c_n$.)</p></li>
<li><p>(Basis methods.)  A similar thing is to choose some family of "basis functions", things like Wavelets or piecewise linear functions, but really anything that forms a (possibly overcomplete) basis for the vector space $L^2$, and determine a weighted linear combination of scaled and translated elements. 
The techniques here differ drastically from (1.); rather than plopping down basis functions centered at data points, you carefully compute the weight and location of each in order to minimize some distortion criterion.  (Typically, their quantity is fixed a priori.) One approach is "basis pursuit", where you greedily add in new functions while trying to minimize some approximation error between $\hat f$ and $f$.  To get a sense of the diversity of approaches here, a neat paper is Rahimi &amp; Recht's "uniform approximation of functions with random bases".  Perhaps I should say that the grand-daddy of all of these is the Fourier expansion; there's a lot of good material on this in Mallat's book on Wavelets.</p></li>
<li><p>(Tree methods.)  Another way is to look at a function as a tree; at each level, you are working with some partition of the domain, and return, for instance, the average point.  (Each pruning of the tree also gives a partition.)  In the limit, the fineness of this partition will no longer discretize the function, and you have reconstructed it exactly.  How best to choose this partition is a tough problem. (You can google this under "regression tree".)</p></li>
<li><p>(Polynomial methods; see also splines and other interpolating techniques.)  By Taylor's theorem, you know that you can get arbitrarily close to well behaved functions.  This may seem like a very basic approach (i.e., just use the Lagrange interpolating polynomial), but where things get interesting is in deciding <em>which</em> points to interpolate.  This was investigated extensively in the context of numerical integration; you can find some amazing math under the topics of "clenshaw-curtis quadrature" and "gaussian quadrature".  I'm throwing this in here because the types of assumptions and guarantees here are so drastically different than what appears above.  I like this field but these methods suffer really badly from the curse of dimension, at least I think this is why they are less discussed than they used to be (if you do numeric integration with mathematica, I think it does quadrature for univariate domains, but sampling techniques for multivariate domains).</p></li>
</ol>

<p>Considering various restrictions to your function class, you can instantiate the above to get all sorts of other widely-used scenarios.  For instance, with boolean valued functions, thresholding (1.) will look a lot like a nearest-neighbor estimator, or an SVM with some local kernel (gaussian).  A lot of the above stuff suffers from curse of dimension (bounds exhibit exponential dependence on the dimension).  In machine learning you get around this either by explicitly constraining your class to some family (i.e., "parametric methods), or by an implicit constraint, usually something relating the quality of the approximants to the target function complexity (i.e., an analog of the weak learning assumption in boosting).</p>

<p>By the way, my favorite theorem related to neural net approximation  is Kolmogorov's superposition theorem (from 1957!).  It says that any multivariate continuous function $f:\mathbb{R}^d \to \mathbb{R}$ has the form
$$
f(x) = \sum_{j=0}^{2d}h_j\left(\sum_{i=1}^d g_{j,i}(x_i)\right),
$$
where each $g_{j,i} : \mathbb{R}\to\mathbb{R}$ and $h_j:\mathbb{R}\to\mathbb{R}$ is (univariate) continuous.  Note that unlike neural nets, the $g$'s and $h$'s may all differ.  But even so, given that there are only $\Theta(d^2)$ functions floating around, I find this totally amazing.</p>

<p>(You only asked about function classes, but I figured you'd be interested in methods as well.. if not.. oops)</p>

CC BY-SA 4.0
2022-01-16T01:17:52.933Z
@user34637 Presumably your joke would have made more sense if you had said "factorial" rather than "exponential". The number 1967! is a natural number with 5594 digits, making it greater than the date of your comment (which has only 4 digits) by a large margin.
Galen
CC BY-SA 3.0
2011-08-21T13:07:15.793Z
2011-08-21T13:13:54.960Z
2011-08-21T13:13:54.960Z
matus
<p>It is known via the universal approximation theorem that a neural network with even a single hidden layer and an arbitrary activation function can approximate any continuous function.</p>

<p>What other models are there that are also universal function approximators</p>

CC BY-SA 4.0
2019-10-02T16:12:17.083Z
I joined this site to upvote this question and some of the answers.
Prasad Raghavendra
<machine-learning><function><approximation>
Universal Function approximation
Opt
# Universal Function approximation

(Asked by: username_0 on 2011-08-21)

It is known via the universal approximation theorem that a neural network with even a single hidden layer and an arbitrary activation function can approximate any continuous function.

What other models are there that are also universal function approximators

**Tags:** machine-learning, function, approximation

> **Comments:**
> **username_1**: I joined this site to upvote this question and some of the answers.  

---

## 1 answers

### Answer by username_2 on 2011-08-21. Score: 27 | Accepted answer

This is treated extensively in the statistics literature, under the topic of regression. Two standard references here are Wasserman's book "all of nonparametric statistics" and Tsybakov's "introduction to nonparametric estimation". I'll talk briefly about some of the standard stuff, and try to give pointers outside of statistics (this is a common topic and different fields have different cultures: prove different kinds of theorems, make different assumptions).

1. (Kernel regressors, sometimes called the Nadaraya-Watson Estimator.) Here you write the function at any point as a weighted combination of nearby values. More concretely,
   since this is in the statistics literature, you typically suppose you have some examples $((x\_i,f(x\_i)))\_{i=1}^n$ drawn from some distribution,
   and fix some kernel $K$ (can think of this as a gaussian, but zero mean is what matters most), and write
   $$
   \hat f(x) := \sum\_i f(x\_i) \left(\frac{ K(c\_n(x-x\_i)) }{ \sum\_j K(c\_n(x-x\_j))}\right),
   $$
   where $c\_n\to\infty$ (you are more sensitive to small distances as $n$ increases).
   The guarantee is that, as $n\to\infty$, a probilistic criterion of distortion
   (expectation of sup-norm, high probability, whatever) goes to zero.
   (It hardly matters what $K$ looks like---it matters more how you choose $c\_n$.)
2. (Basis methods.) A similar thing is to choose some family of "basis functions", things like Wavelets or piecewise linear functions, but really anything that forms a (possibly overcomplete) basis for the vector space $L^2$, and determine a weighted linear combination of scaled and translated elements.
   The techniques here differ drastically from (1.); rather than plopping down basis functions centered at data points, you carefully compute the weight and location of each in order to minimize some distortion criterion. (Typically, their quantity is fixed a priori.) One approach is "basis pursuit", where you greedily add in new functions while trying to minimize some approximation error between $\hat f$ and $f$. To get a sense of the diversity of approaches here, a neat paper is Rahimi & Recht's "uniform approximation of functions with random bases". Perhaps I should say that the grand-daddy of all of these is the Fourier expansion; there's a lot of good material on this in Mallat's book on Wavelets.
3. (Tree methods.) Another way is to look at a function as a tree; at each level, you are working with some partition of the domain, and return, for instance, the average point. (Each pruning of the tree also gives a partition.) In the limit, the fineness of this partition will no longer discretize the function, and you have reconstructed it exactly. How best to choose this partition is a tough problem. (You can google this under "regression tree".)
4. (Polynomial methods; see also splines and other interpolating techniques.) By Taylor's theorem, you know that you can get arbitrarily close to well behaved functions. This may seem like a very basic approach (i.e., just use the Lagrange interpolating polynomial), but where things get interesting is in deciding *which* points to interpolate. This was investigated extensively in the context of numerical integration; you can find some amazing math under the topics of "clenshaw-curtis quadrature" and "gaussian quadrature". I'm throwing this in here because the types of assumptions and guarantees here are so drastically different than what appears above. I like this field but these methods suffer really badly from the curse of dimension, at least I think this is why they are less discussed than they used to be (if you do numeric integration with mathematica, I think it does quadrature for univariate domains, but sampling techniques for multivariate domains).

Considering various restrictions to your function class, you can instantiate the above to get all sorts of other widely-used scenarios. For instance, with boolean valued functions, thresholding (1.) will look a lot like a nearest-neighbor estimator, or an SVM with some local kernel (gaussian). A lot of the above stuff suffers from curse of dimension (bounds exhibit exponential dependence on the dimension). In machine learning you get around this either by explicitly constraining your class to some family (i.e., "parametric methods), or by an implicit constraint, usually something relating the quality of the approximants to the target function complexity (i.e., an analog of the weak learning assumption in boosting).

By the way, my favorite theorem related to neural net approximation is Kolmogorov's superposition theorem (from 1957!). It says that any multivariate continuous function $f:\mathbb{R}^d \to \mathbb{R}$ has the form
$$
f(x) = \sum\_{j=0}^{2d}h\_j\left(\sum\_{i=1}^d g\_{j,i}(x\_i)\right),
$$
where each $g\_{j,i} : \mathbb{R}\to\mathbb{R}$ and $h\_j:\mathbb{R}\to\mathbb{R}$ is (univariate) continuous. Note that unlike neural nets, the $g$'s and $h$'s may all differ. But even so, given that there are only $\Theta(d^2)$ functions floating around, I find this totally amazing.

(You only asked about function classes, but I figured you'd be interested in methods as well.. if not.. oops)

> **Comments:**
> **username_3**: @user34637 Presumably your joke would have made more sense if you had said "factorial" rather than "exponential". The number 1967! is a natural number with 5594 digits, making it greater than the date of your comment (which has only 4 digits) by a large margin.  

---

