## 2 Methodology and Data
### Logistic Regression  
Logistic regression is a statistical technique used to model the relationship between a binary or multinomial target variable and predictor variables. The target variable is modelled as a function of predictor variables using the logistic function, which transforms the linear predictor into a probability between 0 and 1 [56]. For the case of a binary target variable, the principle of logistic regression is the following: let \(Y\) be a binary response variable that takes on the values of 1 with probability \(p\) and 0 with probability \(1-p\). Let \(X_{1},\ X_{2},\ \ldots,\ X_{m}\) be \(m\) predictor variables. The logistic regression model expresses the log odds of the target variable \(Y\) being equal to 1 as a linear function of the predictor variables:  
\[log\frac{p}{1-p}=\beta_{0}+\beta_{1}X_{1}+\beta_{2}X_{2}+\cdots+\beta_{m}X_{m}\]  
where \(\beta_{0},\ \beta_{1},\ \beta_{2},\ \ldots,\ \beta_{m}\) are the parameters to be estimated, and their estimations will be \(b_{0},\ b_{1},\ b_{2},\ \ldots,\ b_{m}\). Then, to transform the linear predictor into a probability between 0 and 1, the logistic function is used:  
\[p=1/(1+exp(-\beta_{0}-\beta_{1}X_{1}-\beta_{2}X_{2}-\cdots-\beta_{m}X_{m}))\]  
To estimate the parameters \(\beta_{0},\ \beta_{1},\ \beta_{2},\ \ldots,\ \beta_{m}\), the maximum likelihood method is used. The likelihood function is given using  
\[L(\beta_{0},\ \beta_{1},\ \beta_{2},\ldots,\ \beta_{m})=\prod p_{i}y_{i}{}^{y_{i }}(1-p_{i})^{1-y_{i}}\]  
where the product is taken over all \(i\) observations, \(y_{i}\) is the observed value of the outcome variable (0 or 1) for the \(i\)-th observation, and \(p_{i}\) is the predicted probability of the outcome variable being equal to 1 for the \(i\)-th observation. The maximum likelihood estimates of the parameters can be found using iterative methods such as the Newton-Raphson method or the Fisher scoring algorithm. The parameter estimates are obtained by maximising the log-likelihood function [57; 58]:  
\[\ln L(\beta_{0},\ \beta_{1},\ \beta_{2},\ \ldots,\ \beta_{m})=\sum(y_{i}\ln p_{i }+(1-y_{i})\ln(1-p_{i}))\]  
The methodology could be extended intuitively for the multinomial target variable, as is the categorised duration of unemployment in this study. The multinomial logistic regression model assumes that the log odds of the outcome variable \(Y\) taking on category \(k\) is a linear function of the predictor variables:  
\[\log\frac{p(Y=k)}{p(Y=K)}=\beta_{0k}+\beta_{1k}X_{1}+\beta_{2k}X_{2}+\cdots+ \beta_{mk}X_{m}\]  
where \(p(Y=k)\) is the probability that the outcome variable \(Y\) will have the value \(k\); \(\beta_{0k},\ \beta_{1k},\ \beta_{2k},\ \ldots,\ \beta_{mk}\) are the parameters to be estimated for category \(k\), their estimations will be \(b_{0k},\ b_{1k},\ b_{2k},\ \ldots,\ b_{mk}\), and \(K\) is the total number of categories. The multinomial logistic function is then used to transform the linear predictor into a probability distribution across the categories:  
\[p(Y=k)=\exp(\beta_{0k}+\beta_{1k}X_{1}+\beta_{2k}X_{2}+\cdots+\beta_{mk}X_{m})\]  
where the sum is taken over all possible categories of the target variable. The maximum likelihood method estimates the parameters that maximise the likelihood of observing the data given in the model. The likelihood function is given using  
\[L\big{(}\beta_{0},\ \beta_{1},\ \beta_{2},\ldots,\ \beta_{p}\big{)}=\prod(p(Y_{i }=k))^{y_{i}}\]where the product is taken over all \(i\) observations, \(y_{i}\) is the observed value of the outcome variable for the \(i\)-th observation, and \(p(Y_{i}=k)\) is the predicted probability of the outcome variable taking on category \(k\) for the \(i\)-th observation. The parameter estimates are obtained by maximising the log-likelihood function:  
\[ln\big{(}L\big{(}\beta_{0},\ \beta_{1},\ \beta_{2},\ \ldots,\ \beta_{p}\big{)} \big{)}=\ \sum(y_{i}\text{ln}\,p(Y_{i}=k))\]  
In this manner, we obtain the estimated probability for each case in the data to belong to the \(k\)-th value of the outcome variable.