<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Probability distributions and object oriented programming</title>
	<atom:link href="http://www.johndcook.com/blog/2009/01/23/probability-distributions-and-object-oriented-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johndcook.com/blog/2009/01/23/probability-distributions-and-object-oriented-programming/</link>
	<description>The blog of John D. Cook</description>
	<lastBuildDate>Sat, 31 Jul 2010 07:45:27 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: John</title>
		<link>http://www.johndcook.com/blog/2009/01/23/probability-distributions-and-object-oriented-programming/comment-page-1/#comment-13414</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 16 Feb 2009 14:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=1339#comment-13414</guid>
		<description>What do a gamma and a chi squared distribution have in common? They share any behavior common to all continuous distributions, so it would make sense for both classes to derive from a class like &lt;code&gt;ContinuousDistribution&lt;/code&gt;. But is there anything more specific they share? Not much. Both distributions have support on [0, &#8734;), but so does the log-normal distribution, for example. Any behavior related to parameters is going to be a problem, and behavior that doesn&#039;t depend on parameters may also not depend on distribution family at all.

Obviously a &lt;code&gt;ChiSquareDistribution&lt;/code&gt; class has a lot in common &lt;em&gt;internally&lt;/em&gt; with a &lt;code&gt;GammaDistribution&lt;/code&gt; class. The former could be a thin wrapper around an instance of the latter. But in terms of interfaces, the two classes don&#039;t have much in common except what they also share with a lot of other distributions.</description>
		<content:encoded><![CDATA[<p>What do a gamma and a chi squared distribution have in common? They share any behavior common to all continuous distributions, so it would make sense for both classes to derive from a class like <code>ContinuousDistribution</code>. But is there anything more specific they share? Not much. Both distributions have support on [0, &infin;), but so does the log-normal distribution, for example. Any behavior related to parameters is going to be a problem, and behavior that doesn&#8217;t depend on parameters may also not depend on distribution family at all.</p>
<p>Obviously a <code>ChiSquareDistribution</code> class has a lot in common <em>internally</em> with a <code>GammaDistribution</code> class. The former could be a thin wrapper around an instance of the latter. But in terms of interfaces, the two classes don&#8217;t have much in common except what they also share with a lot of other distributions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Friar</title>
		<link>http://www.johndcook.com/blog/2009/01/23/probability-distributions-and-object-oriented-programming/comment-page-1/#comment-13411</link>
		<dc:creator>The Friar</dc:creator>
		<pubDate>Mon, 16 Feb 2009 14:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=1339#comment-13411</guid>
		<description>Is there a reason not to have &lt;em&gt;ChiSquareDistribution&lt;/em&gt; and &lt;em&gt;GammaDistribution&lt;/em&gt; each inherit from some class like &lt;em&gt;BareBonesGammaDistribution&lt;/em&gt;, with the parameter-setting methods written individually into the former pair but with methods for getting values written once for all in the latter?  That is, isn&#039;t it just a matter of needing another level of inheritance hierarchy?</description>
		<content:encoded><![CDATA[<p>Is there a reason not to have <em>ChiSquareDistribution</em> and <em>GammaDistribution</em> each inherit from some class like <em>BareBonesGammaDistribution</em>, with the parameter-setting methods written individually into the former pair but with methods for getting values written once for all in the latter?  That is, isn&#8217;t it just a matter of needing another level of inheritance hierarchy?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.335 seconds -->
