<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Variance Inflation factors Archives - CenterSpace</title>
	<atom:link href="https://www.centerspace.net/tag/variance-inflation-factors/feed" rel="self" type="application/rss+xml" />
	<link>https://www.centerspace.net/tag/variance-inflation-factors</link>
	<description>.NET numerical class libraries</description>
	<lastBuildDate>Tue, 01 Mar 2016 18:46:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
<site xmlns="com-wordpress:feed-additions:1">104092929</site>	<item>
		<title>Variance inflation factors</title>
		<link>https://www.centerspace.net/variance-inflation-factors</link>
					<comments>https://www.centerspace.net/variance-inflation-factors#respond</comments>
		
		<dc:creator><![CDATA[Trevor Misfeldt]]></dc:creator>
		<pubDate>Wed, 27 May 2009 20:11:56 +0000</pubDate>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Computing variance inflation factors]]></category>
		<category><![CDATA[Variance Inflation factors]]></category>
		<category><![CDATA[vif]]></category>
		<guid isPermaLink="false">http://www.centerspace.net/blog/?p=124</guid>

					<description><![CDATA[<p>A customer contacted us about computing &#8220;variance inflation factors&#8221;. Wikipedia defines this as: In statistics, the variance inflation factor (VIF) is a method of detecting the severity of multicollinearity. More precisely, the VIF is an index which measures how much the variance of a coefficient (square of the standard deviation) is increased because of collinearity. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.centerspace.net/variance-inflation-factors">Variance inflation factors</a> appeared first on <a rel="nofollow" href="https://www.centerspace.net">CenterSpace</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A customer contacted us about computing &#8220;variance inflation factors&#8221;.</p>
<p>Wikipedia defines this as:</p>
<blockquote><p>In statistics, the variance inflation factor (VIF) is a method of detecting the severity of multicollinearity. More precisely, the VIF is an index which measures how much the variance of a coefficient (square of the standard deviation) is increased because of collinearity. [<a href="https://en.wikipedia.org/wiki/Variance_inflation_factor">Ref]</a></p></blockquote>
<p>Here&#8217;s an implementation using CenterSpace&#8217;s NMath and NMath Stats libraries.</p>
<blockquote>
<pre>// Returns all the variance inflation factors
private static DoubleVector Vif( LinearRegression lr )
{
  // iterate through predictors and find variance
  // inflation factor for each
  DoubleVector factors =
    new DoubleVector( lr.NumberOfPredictors );
  for (int i = 0; i &lt; lr.NumberOfPredictors; i++)
  {
  factors[i] = Vif( lr, i );
  }
  return factors;
}

// Returns a single variance inflation factor
private static double Vif( LinearRegression lr, int i )
{
  // remove predictor, change observation
  LinearRegression lr2 = (LinearRegression)lr.Clone();
  lr2.RemovePredictor( i );
  lr2.SetRegressionData( lr2.PredictorMatrix,
    lr.PredictorMatrix.Col( i ), true );

  // calculate variance inflation factor
  LinearRegressionAnova anova =
    new LinearRegressionAnova( lr2 );

  // return factor
  return 1.0 / (1.0 - anova.RSquared);
}</pre>
</blockquote>
<p>And here&#8217;s an example using these functions:</p>
<blockquote>
<pre>DoubleMatrix independent = new DoubleMatrix(
  "30x3[0.270 78 41 0.282 79 56 0.277 81 63 " +
       "0.280 80 68 0.272 76 69 0.262 78 65 " +
       "0.275 82 61 0.267 79 47 0.265 76 32 " +
       "0.277 79 24 0.282 82 28 0.270 85 26 " +
       "0.272 86 32 0.287 83 40 0.277 84 55 " +
       "0.287 82 63 0.280 80 72 0.277 78 72 " +
       "0.277 84 67 0.277 86 60 0.292 85 44 " +
       "0.287 87 40 0.277 94 32 0.285 92 27 " +
       "0.282 95 28 0.265 96 33 0.265 94 41 " +
       "0.265 96 52 0.268 91 64 0.260 90 71]" );

DoubleVector dependent =
  new DoubleVector( "0.386 0.374 0.393 0.425 " +
  "0.406 0.344 0.327 0.288 0.269 0.256 0.286 " +
  "0.298 0.329 0.318 0.381 0.381 0.470 0.443 " +
  "0.386 0.342 0.319 0.307 0.284 0.326 0.309 " +
  "0.359 0.376 0.416 0.437 0.548" );

LinearRegression regression =
  new LinearRegression( independent, dependent, true );
Console.WriteLine( "Is good? " + regression.IsGood );
LinearRegressionAnova anova =
  new LinearRegressionAnova( regression );
Console.WriteLine( "variance: " + regression.Variance );
Console.WriteLine( "r-squared: " + anova.RSquared );
DoubleVector vif = Vif( regression );
Console.WriteLine( "variance inflation factors: " + vif );</pre>
</blockquote>
<p>-Trevor</p>
<p><strong>Note: </strong>This functionality is now in NMath Stats.</p>
<p>The post <a rel="nofollow" href="https://www.centerspace.net/variance-inflation-factors">Variance inflation factors</a> appeared first on <a rel="nofollow" href="https://www.centerspace.net">CenterSpace</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.centerspace.net/variance-inflation-factors/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">124</post-id>	</item>
	</channel>
</rss>
