Basis Function#
Overview#
A basis function is a collection of simple building blocks—functions that, when combined (weighted and summed together), can represent more complex, non-linear relationships. Think of them as tools for constructing predictors in GLMs, helping to model:
Non-linear mappings between task variables (like velocity or position) and firing rates.
Linear temporal effects, such as spike history, neuron-to-neuron couplings, or how stimuli are integrated over time.
In a GLM, we assume a non-linear mapping exists between task variables and neuronal firing rates. This mapping isn’t something we can directly observe—what we do see are the inputs (task covariates) and the resulting neural activity. The challenge is to infer a “good” approximation of this hidden relationship.
Basis functions help simplify this process by representing the non-linearity as a weighted sum of fixed functions, \(\psi_1(x), \dots, \psi_n(x)\), with weights \(\alpha_1, \dots, \alpha_n\). Mathematically:
Here, \(\approx\) means “approximately equal”.
Instead of tackling the hard problem of learning an unknown function \(f(x)\) directly, we reduce it to the simpler task of learning the weights \(\{\alpha_i\}\). This preserves convexity, resulting in a much simpler optimization problem.
Basis in NeMoS#
NeMoS provides a variety of basis functions (see the table above). For each basis type, there are two dedicated classes of objects, corresponding to the two uses described above:
Eval basis objects: For representing non-linear mappings between task variables and outputs. These objects all have names ending with
Eval
.Conv basis objects: For linear temporal effects. These objects all have names ending with
Conv
.
Eval
and Conv
objects can be combined to construct multi-dimensional basis functions, enabling complex feature construction.