Distance

We define the Euclidean distance between two vectors \(a\) and \(b\) as the norm of their difference: \[\mathbf{dist}(a, b) = ||a - b||\] For one, two, and three dimensions, this distance is exactly the usual distance between points with coordinates \(a\) and \(b\). However, the Euclidean distance is defined for vectors of any dimension. import numpy as np u = np.array([1.8, 2.0, -3.7, 4.7]) v = np.array([0.6, 2.1, 1.9, -1. …

Posted on

Workshops Are A Bad Idea

If you work in an agency, especially one that prided itself on being a “digital agency” back in the early 2000s, you might encounter people who hold workshops as a way of fostering client commitment. The idea is to get all client-side stakeholders in a room and hold exercises and activities to cement mutual understanding about shared goals. However, workshops are a terrible idea from a psychological standpoint. A workshop enables a phenomenon called diffusion of responsibility which, if you ever did group projects in middle school, you should already be aware of. …

Posted on

Norm

The Euclidean norm (or magnitude) of an \(n\)-vector \(x\), denoted by \(||x||\), is the square root of the sum of the squares of its elements, \[||x|| = \sqrt{x_1^2 + x_2^2 + \cdots + x_n^2}\] or the inner product of the vector with itself, \(||x|| = \sqrt{x^Tx}\). When \(x\) is a scalar the norm is the same as the absolute value of \(x\). import numpy as np x = np.array([2, -1, 2]) np. …

Posted on

Regression Model

The regression model is a very commonly used affine function, especially when the \(n\)-vector \(x\) represents a feature vector. The model is \[\hat{y} = x^T \beta + v\] where \(\beta\) is an \(n\)-vector (of features, i.e., variables) and \(v\) is scalar. In this case, the entries of \(x\) are called the regressors, and \(\hat{y}\) is called the prediction, since the regression model is typically an approximation or prediction of some true value of \(y\), which is called the dependent variable. …

Posted on

Taylor Approximation

In many cases, you can approximate the relation between functions of \(n\) variables with linear or affine functions. In these applications we refer to the linear or affine function relating the variables and the scalar variable as a model. Suppose that \(f : \mathbf{R}^n \to \mathbf{R}\) is differentiable (meaning it has derivatives and partial derivatives). Let \(z\) be an \(n\)-vector. The (first-order) Taylor approximation of \(f\) near (or at) the point \(z\) is the function \(\hat{f}(x)\) defined as …

Posted on