next up previous index
Next: EstimationProcedure Class Up: Model Components Previous: upc_sequence Class   Index


Regression Class

The Regression class is an abstract class for user defined classes that can be used in the regression model. The class linear_regression implemented in opus_core computes outcome $ Y$ as a linear combination of given data $ X$ and coefficients $ \beta$ : $ y_n = \sum_{j=1}^J
\beta_j x_{nj}$ . Here, $ J$ denotes the number of variables entering the regression and $ n$ is an index for observations. The run() method takes a 2-d array of data (of size number of observations $ \times$ number of variables) and a 1-d array of coefficients as arguments and returns a 1-d array of outcome.

A child class of linear_regression, called linear_regression_with_normal_error, adds normaly distributed random errors to the outcome: $ y_n = \sum_{j=1}^J \beta_j x_{nj} + \delta_n$ where $ \delta_n \sim N(\mu_n, \sigma_n^2)$ . $ \mu_n$ and $ \sigma_n^2$ , respectively, can be passed to the run() method in its argument resources (dictionary) as entries 'linear_regression_error_mean' and 'linear_regression_error_variance', respectively. Both can be specified either as a single value or as an array of size number of observations. By default, $ \delta_n \sim N(0, 1)$ for all $ n$ .


next up previous index
Next: EstimationProcedure Class Up: Model Components Previous: upc_sequence Class   Index
info (at) urbansim.org