Thursday, October 27, 2011

Correlated regressors

In ordinary least-squares linear regression, correlated regressors lead to unstable model parameter estimates.  The intuition is that given two correlated regressors, it is difficult to determine how much of the data is due to one regressor and how much is due to the other.  Let's look at this geometrically.

CODE

% Generate two regressors (in the columns of the matrix).
% These two regressors are relatively uncorrelated (nearly orthogonal).
X = [10 1;
       1 10];

% Generate some data (no noise has been added yet).
data = [24 25]';

% Simulate 100 measurements of the data (with noise added).
% For each measurement, estimate the weights on the regressors.
y = zeros(2,100);
h = zeros(2,100);
for rep=1:100
  y(:,rep) = data + 2*randn(2,1);
  h(:,rep) = inv(X'*X)*X'*y(:,rep);
end

% Estimate weights on the regressors for the case of no noise.
htrue = inv(X'*X)*X'*data;

% Now visualize the results
figure(999); clf; hold on;
h1 = scatter(y(1,:),y(2,:),'g.');
h2 = scatter(data(1),data(2),'k.');
axis square; axis([0 50 0 50]);
h3 = drawarrow(repmat([0 0],[2 1]),X','r-',[],10);
for p=1:size(X,2)
  h4 = scatter(X(1,p)*h(p,:),X(2,p)*h(p,:),25,'gx');
  h5 = scatter(X(1,p)*htrue(p),X(2,p)*htrue(p),'k.');
end
uistack(h3,'top');
h6 = drawarrow(X(:,1)',X(:,2)','b-',[],0);
xlabel('dimension 1');
ylabel('dimension 2');
legend([h1 h2 h3(1) h4 h5 h6], ...
       {'measured data' 'noiseless data' 'regressors' ...
        'estimated weights' 'true weights' 'difference between regressors'});


The green X's represent each regressor scaled by the weight estimated for that regressor in each of the 100 simulations.  The X's are indicative of how reliably we can estimate the weights.  In this example, the weights are estimated quite reliably (the spread of the X's is relatively small).

% Let's repeat the simulation but now with
% two regressors that are highly correlated.
X = [6 5;
       5 6];


In this example, the two regressors are highly correlated and weight estimation is unreliable.  To understand why this happens, examine the difference between the regressors.  Notice that the difference between the regressors is quite small.  Noise in the data shifts the data along this difference, giving rise to substantially different parameter estimates. For example, if the measured data shifts towards the upper-left, then this tends to produce high weights for the upper-left regressor (and low weights for the bottom-right regressor); if the measured data shifts towards the bottom-right, then this tends to produce high weights for the bottom-right regressor (and low weights for the upper-left regressor).

OBSERVATIONS

The stability of model parameter estimates is determined (in part) by the amount of noise in the direction of the regressor difference.  If the projection of the noise onto the regressor difference has small variance (as in the first example), then parameter estimates will tend to be stable; if the projection has large variance (as in the second example), then parameter estimates will tend to be unstable.

So how can we obtain better parameter estimates in the case of correlated regressors? One solution is to use regularization strategies (which will be described in a later post).

4 comments:

  1. The actual balance associated with this site design parameter estimations is decided through the quantity of sound toward the actual regressor distinction.

    ReplyDelete
  2. Microsoft Office is the basic medium to manage the data with a respectable way. I am up 'til now using Microsoft Office variation seven anyway the latest type of the working environment is snappy and they http://www.professionaltypist.net/a-brief-informal-typewriter-history/ incorporate some interesting features.

    ReplyDelete
  3. We are way up 'til currently employing 'micro-soft' Place of work alternative eight at any rate the most up-to-date sort of your doing work natural environment can be snappy and they also http://www.retype.biz/professional-typing-services/ combine a number of exciting capabilities.

    ReplyDelete
  4. Партнерские программы - прибыльный разновидность дохода. Это новейший вид сотрудничества рекламодателя и анонсирующих площадок. Ранее система партнерства представляла собой размещение какой-то материалов на фиксированное время, либо же, придется было набрать установленное количество просмотров, кликов. Однако оффер работает абсолютно иначе: здесь платеж проводится за определенное действие. Каталог офферов может содержать предложения разных тематик: - Онлайн игры; - Смарт приложения; - Туризм; - Товары; - Банковские операции. С нами работа за компьютером станет легче. Idealfit - капли для худеющих партнерская программа Сайт для партнерских сетей - просто способ расширения видимости ссылок с партнерок. С зодиакальным содействии можно значительно улучшить собственный выигрыш, однако все это не одно доступное решение. Многие cost per action не требуют от вас персонального портала. Ей не имеет значения, в какой точке и если вы разместите свою рекламную кампанию, адреса, и т.Д. Можно помещать данные в любых местах большого скопления пользователей. Прежде всего - форумы, сообщества в социальных сетях. Потребуется немного потрудиться, но отдача случается внушительной Важно подобрать ресурс для проведения переадресаций на продукт либо услуг оффера. Чтобы не расходовать время неэффективно, поразмыслите и помониторьте места, более низкие для такой работы. Используют различные нужные платформы, публиковать отзывы под интересными видеороликами и т. П. Ознакомьтесь с нашим списком офферов, дабы ознакомиться с лучшее на сегодняшний день направление. Если в доме имеются идеи, относящиеся к того момента, как и чем использовать fire fit развод (kapelki-firefit.ru) , вы имеете возможность позвонить с нашей компанией здесь на веб-странице.

    ReplyDelete