Namespace: |
|
Content: |
simple, 6 attributes |
Defined: |
globally in ssj.xsd, see XML source |
Includes: |
definitions of 6 attributes |
Used: |
at 7 locations |
XML Representation Summary | |||||
<... | |||||
distributionClass | = |
xsd:string | |||
estimateParameters | = |
xsd:boolean : "false" | |||
generatorClass | = |
xsd:string | |||
lowerBound | = |
xsd:double | |||
shift | = |
xsd:double | |||
upperBound | = |
xsd:double | |||
> | |||||
|
|||||
</...> |
More specifically, when constructing an object representing a distribution, the application first finds a Java class corresponding to the name given by the distributionClass attribute. The found distribution class is then scanned as follows in order to look for a suitable constructor accepting the data array. If the estimateParameters attribute is false or unset, the application examines the distribution class to find a constructor taking an array of double-precision values, and calls this constructor with the data array. If no such constructor exists, the application looks for a constructor taking the same number of numerical parameters than the length of the data array, and tries to call it. The input double-precision values are converted to the appropriate types for calling the constructor. If a conversion to integer is needed, the decimals in the concerned input value are truncated.
On the other hand, if estimateParameters is set to true, the input array is treated as an array of observations used for parameter estimation. For this, a static method named getInstanceFromMLE is looked for and called in the distribution class. The exact scheme for parameter estimation depends on the distribution class used.
After the distribution is constructed, the application may also create a random variate generator. By default, generators use inversion, but this can be overridden by setting an alternate generator class through the generatorClass attribute. The lowerBound and upperBound attributes may also be use to set truncation parameters while the shift attribute is used to set the shift subtracted to each generated value. Note that one must use inversion for a truncated distribution.
See the documentation of SSJ's umontreal.iro.lecuyer.probdist package for the available distributions, and their parameters. See also umontreal.iro.lecuyer.randvar for the available generators.
An instance of the class derived by JAXB from this complex type can be converted into SSJ objects using methods in the ParamReadHelper class. More specifically, the createBasicDistribution method creates a Distribution object without considering shifting and truncation. The createTruncatedDist method creates the truncated distribution from the basic distribution. The createGenerator method creates random variate generators from parameters, and possibly the distribution object.
For example, let rvg be an element representing a probability distribution. For an exponential distribution with mean 1/10, one uses
<rvg distributionClass="ExponentialDist"> 10</rvg>
When creating the distribution, an application finds the distribution class ExponentialDist in package umontreal.iro.lecuyer.probdist. According to the documentation of SSJ, this class does not provide a constructor taking an array of double-precision values. However, it has a constructor taking one argument corresponding to the inverse of the mean. As a result, the nested text of rvg contains the desired rate, 10, for a mean of 1/10.
For a gamma distribution with shape parameter 20, scale parameter 2, and mean 10, one has to use the GammaDist class instead of ExponentialDist. The documentation of this class indicates that it defines a constructor taking the shape and scale parameters, so the array of data will contain the parameters. This results in the following XML code.
<rvg distributionClass="GammaDist">20 2</rvg>
However, generating gamma variates using inversion is slow. One can alternatively use acceptance-rejection by adding the attribute generatorClass="GammaAcceptanceRejectionGen" to rvg.
Suppose now that we wish to have random variates following a normal distribution truncated to positive numbers. The corresponding rvg looks as follows.
<rvg distributionClass="NormalDist" lowerBound="0">10 5</rvg>
In this example, we select the NormalDist distribution which has a constructor taking the mean and the variance. Using the input array, we then specify a mean of 10, and a variance of 5. Using the lowerBound attribute, we then restrict our normal distribution to positive numbers.
Suppose now that we have 100 observations and we suspect their distribution to be gamma. We can then use the estimateParameters attribute as follows for parameters to be estimated via maximum likelihood.
<rvg distributionClass="GammaDist" generatorClass="GammaAcceptanceRejectionGen" estimateParameters="true"> 13.583 38.350 36.988 174.782 25.055 76.227 65.542 43.937 14.617 140.998 85.697 52.774 39.501 27.493 94.177 234.529 35.521 3.475 339.398 15.490 140.056 20.032 8.392 24.555 113.580 21.363 74.357 23.090 97.026 146.662 219.492 211.232 185.475 129.586 70.093 8.275 4.256 270.992 380.576 65.159 88.477 111.913 0.202 284.074 49.649 80.090 128.229 109.601 14.614 77.179 8.003 156.671 29.713 17.353 62.487 9.279 18.595 111.629 147.295 100.060 55.822 217.506 10.113 315.508 45.521 150.381 140.569 29.204 187.779 121.608 95.364 117.455 255.000 159.561 130.894 100.282 97.153 60.966 72.697 218.799 177.292 70.690 72.737 37.344 106.093 20.325 90.501 117.777 201.008 13.961 14.421 238.566 16.629 27.469 186.505 154.357 281.944 4.212 36.368 142.395</rvg>
These values were obtained by generating 100 i.i.d. exponentials with 100. This corresponds to the gamma distribution with shape parameter 1 and scale parameter 1/100.
Type Derivation Tree xsd:double ![]() ![]() |
Derivation: |
<xsd:complexType name="RandomVariateGenParams"> <xsd:simpleContent> </xsd:attribute> </xsd:attribute> </xsd:attribute> </xsd:attribute> </xsd:attribute> </xsd:attribute> </xsd:extension> </xsd:simpleContent> </xsd:complexType> |
Type: |
xsd:string |
Use: |
optional |
Defined: |
<xsd:attribute name="distributionClass" type="xsd:string"> </xsd:attribute> |
Type: |
xsd:boolean |
Use: |
optional |
Default: |
"false" |
Defined: |
<xsd:attribute default="false" name="estimateParameters" type="xsd:boolean"> </xsd:attribute> |
Type: |
xsd:string |
Use: |
optional |
Defined: |
<xsd:attribute name="generatorClass" type="xsd:string"> </xsd:attribute> |
Type: |
xsd:double |
Use: |
optional |
Defined: |
<xsd:attribute name="lowerBound" type="xsd:double"> </xsd:attribute> |
Type: |
xsd:double |
Use: |
optional |
Defined: |
<xsd:attribute name="shift" type="xsd:double"> </xsd:attribute> |
Type: |
xsd:double |
Use: |
optional |
Defined: |
<xsd:attribute name="upperBound" type="xsd:double"> </xsd:attribute> |
XML Schema documentation generated with DocFlex/XML (Kit) v1.6.8 DocFlex/XML (Kit) is a freeware edition of DocFlex/XML, which is a powerful template-driven documentation and report generator from any data stored in XML files. Based on an innovative technology developed by FILIGRIS WORKS, this new tool offers virtuoso data querying and formatting capabilities not found in anything else! Need to convert your XML data into a clear nice-looking documentation or reports? Web-ready hypertext HTML or printable MS Word / OpenOffice.org friendly RTF? DocFlex/XML may be a cheap, quick and effective solution exactly for this task! Have questions? Not sure how to use it? Just send us e-mail to contact@filigris.com and we are always happy to help you! See also our services at www.filigris.com |