How do we estimate production functions? In a standard economics education we learn about production functions, indicating an output as a function of a given input of capital and labour.

An average model looks like this:

(1)    $F(L,K)=L^{a}K^b$

When dealing with real data however, we are first exposed to regression models which are additive in nature which look like this:

(2)      $y_i={\beta}_0+{\beta}_1x_1+{\beta}_2x_2+...+{\beta}_nx_n$

How do we get a production function that looks like (1) when dealing with real data?
The following is the basic idea if we are to estimate the parameters by linear regression.


Take the natural log of the production function $F(L,K)=L^aK^b$, you will then get $$\ln(F)=a\ln(L)+b\ln(K).$$
For each entity (e.g., firm) $i$, collect data on the production level $F_i$, the amount of labour $L_i$, and the amount of capital $K_i$. Note that measurement issues may arise and that it is important to be explicit about how one is to interpret 'production', 'labour' and 'capital', and how to measure them.
Apply the transformation $X_i\mapsto \ln(X_i)$ for each variable $X_i$ for each entity $i$ in your dataset. (If there is any $X_i$ such that $X_i\leq 0$ then this will not work. You may delete those observations $X_i$ for which $X_i\leq 0$. If it is real data, think about the following question. "Why is $X_i\leq 0$? Has the dataset been wrongly registered?") Economists also apply the transformation $X_i\mapsto\ln(X_i+\epsilon)$ as an approximation when $X_i\geq0$ and $X_i=0$ for some $i$, where $\epsilon&gt;0$ is some small number.
Now, regress $\ln(F)$ on $\ln(L)$ and $\ln(K)$ using your converted dataset (cf. 3) under the assumption that the intercept term is equal to $0$. This gives you estimated values $\hat{a}$ and $\hat{b}$ of $a$ and $b$. Hence, your estimated production function, which is supposed to capture some general tendency regarding production, is $$\hat{F}(L,K)=L^\hat{a}K^\hat{b}.$$
(If the production function is written as $F(K,L)=AL^aK^b$, where $A$ captures technology for example, you will get an intercept term $\ln(A)$.)


If we are using nonlinear regression, then we take the nonlinear least squares (NLLS) estimate of $a$ and $b$ by solving $$\min_{a,\, b}\sum_i\big(F_i-L_i^aK_i^b)^2.$$ Numerical computing softwares (which uses algorithms such as the Gauss-Newton algorithm) may assist you when finding the NLLS estimate.