Created
October 28, 2016 09:32
-
-
Save richarddmorey/b884788c971f88948452ffc14ed8071d to your computer and use it in GitHub Desktop.
example XML for distribution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<distribution> | |
<names> | |
<shortname>Normal</shortname> | |
<longname>Normal</longname> | |
<alternate>Gaussian</alternate> | |
<id>normal</id> | |
</names> | |
<type>continuous</type> | |
<support> | |
<lower>-Inf</lower> | |
<inner>reals</inner> | |
<upper>Inf</upper> | |
</support> | |
<parametrization> | |
<names> | |
<shortname>variance</shortname> | |
<longname>Mean/variance</longname> | |
<id>var</id> | |
</names> | |
<parameter> | |
<id>mu</id> | |
<support> | |
<lower>-Inf</lower> | |
<inner>reals</inner> | |
<upper>Inf</upper> | |
</support> | |
<symbols> | |
<html><![CDATA[μ]]></html> | |
<latex>\mu</latex> | |
<text>mu</text> | |
</symbols> | |
<role>location</role> | |
<note/> | |
</parameter> | |
<parameter> | |
<id>sigma-squared</id> | |
<support> | |
<lower>0</lower> | |
<inner>reals</inner> | |
<upper>Inf</upper> | |
</support> | |
<symbols> | |
<html><![CDATA[σ<sup>2</sup>]]></html> | |
<latex>\sigma^2</latex> | |
<text>sigma^2</text> | |
</symbols> | |
<role>variance</role> | |
<note/> | |
</parameter> | |
<functions> | |
<pdf> | |
<latex> | |
(2\pi\sigma^2)^{-\frac{1}{2}}\exp\left\{-\frac{1}{2}\left(\frac{x - mu}{\sigma}\right)^2\right\} | |
</latex> | |
<code type="R"> | |
function( x, mu, sigma-squared ){ | |
dnorm( x, mu, sqrt( sigma-squared ) ) | |
} | |
</code> | |
<code type="javascript"> | |
function( x, mu, sigma-squared ){ | |
Math.sqrt( 2 * Math.PI * sigma-squared ) * Math.exp( .5 * ( x - mu )*( x - mu )/sigma-squared ) | |
} | |
</code> | |
</pdf> | |
</functions> | |
</parametrization> | |
<references> | |
<wikipedia>https://en.wikipedia.org/wiki/Normal_distribution</wikipedia> | |
</references> | |
</distribution> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment