# 13 – M4 L2A 24 Categorical Variable Estimation V4

Let’s focus on just one country variable, such as the USA country variable and see how we can estimate the values that will plug into the risk model. For the factor exposure matrix and its transpose, we want each stock’s factor exposure to the USA country factor. This can be set to one, if the company is based in the USA and zero if it’s based in another country. You could also imagine choosing decimal values between zero and one based on how much of the company’s revenue is generated in the USA. In any case, the point is that we can estimate the values for the factor exposures. Next, we want to fill in the co-variance matrix of factor returns. So, we want to obtain a time series of factor returns. To make it easier to follow, I’m going to simplify our model so that it contains only one factor. So, the factor co-variance matrix contains just a single variants for the factor return of country USA. Also, the matrix of factor exposures has just one column for the single factor. The number of rows equals the number of stocks. We want to get the factor return, time series of the country USA, so that we can calculate a variance from it. The journey to estimating a time series starts with a single step. So, lets first estimate the factor return for a single time period. Once we estimate the factor return for one time period, we can repeat the process to estimate factor returns for more time periods. Okay. We’re going to estimate the factor return for a single day. So, we take a cross section by collecting data points for a single day but across multiple stocks. Each stock has a factor exposure associated with it. The factor exposure is one, if the company is 100 percent exposed to country USA. The factor exposure is zero, if the stock is completely not exposed to the country USA. It’s somewhere in between, if the stock is partly exposed to USA, but also to other countries. We’ll also have the return for each stock on that time period. So, given the stock return and factor exposure, we want to estimate the factor return. We have several data points, one for each stock in the stock universe. So, we can use a regression model to fit a line through the plot of stock return versus factor exposure betas. The slope of that line is the estimate for the factor return for that one time period. We can interpret this estimate of factor return as the amount of return that can be attributed to being exposed to the risk factor of country USA. So, that was one factor return for a single time period using a single cross-section of data. Yeah. We’ve now estimated one point. Remember that we want to find factor returns over time. If we repeat this cross-sectional regression for multiple time periods, we’d get a time series for the factor return. That’s great. If we calculate the variance of the factor return time series, we can plug it into the co-variance matrix of factor returns.