Source Code Cross Referenced for DistributionFactory.java in  » Science » Apache-commons-math-1.1 » org » apache » commons » math » distribution » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » Apache commons math 1.1 » org.apache.commons.math.distribution 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2003-2005 The Apache Software Foundation.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.apache.commons.math.distribution;
018:
019:        import org.apache.commons.discovery.tools.DiscoverClass;
020:
021:        /**
022:         * This factory provids the means to create common statistical distributions.
023:         * The following distributions are supported:
024:         * <ul>
025:         * <li>Binomial</li>
026:         * <li>Cauchy</li>
027:         * <li>Chi-Squared</li>
028:         * <li>Exponential</li>
029:         * <li>F</li>
030:         * <li>Gamma</li>
031:         * <li>HyperGeometric</li>
032:         * <li>Poisson</li>
033:         * <li>Normal</li>
034:         * <li>Student's t</li>
035:         * <li>Weibull</li>
036:         * </ul>
037:         *
038:         * Common usage:<pre>
039:         * DistributionFactory factory = DistributionFactory.newInstance();
040:         *
041:         * // create a Chi-Square distribution with 5 degrees of freedom.
042:         * ChiSquaredDistribution chi = factory.createChiSquareDistribution(5.0);
043:         * </pre>
044:         *
045:         * @version $Revision: 201915 $ $Date: 2005-06-26 15:20:57 -0700 (Sun, 26 Jun 2005) $
046:         */
047:        public abstract class DistributionFactory {
048:            /**
049:             * Default constructor.
050:             */
051:            protected DistributionFactory() {
052:                super ();
053:            }
054:
055:            /**
056:             * Create an instance of a <code>DistributionFactory</code>
057:             * @return a new factory. 
058:             */
059:            public static DistributionFactory newInstance() {
060:                DistributionFactory factory = null;
061:                try {
062:                    DiscoverClass dc = new DiscoverClass();
063:                    factory = (DistributionFactory) dc
064:                            .newInstance(DistributionFactory.class,
065:                                    "org.apache.commons.math.distribution.DistributionFactoryImpl");
066:                } catch (Throwable t) {
067:                    return new DistributionFactoryImpl();
068:                }
069:                return factory;
070:            }
071:
072:            /**
073:             * Create a binomial distribution with the given number of trials and
074:             * probability of success.
075:             * 
076:             * @param numberOfTrials the number of trials.
077:             * @param probabilityOfSuccess the probability of success
078:             * @return a new binomial distribution
079:             */
080:            public abstract BinomialDistribution createBinomialDistribution(
081:                    int numberOfTrials, double probabilityOfSuccess);
082:
083:            /**
084:             * Create a new cauchy distribution with the given median and scale.
085:             * @param median the median of the distribution
086:             * @param scale the scale
087:             * @return a new cauchy distribution  
088:             * @since 1.1
089:             */
090:            public CauchyDistribution createCauchyDistribution(double median,
091:                    double scale) {
092:                return new CauchyDistributionImpl(median, scale);
093:            }
094:
095:            /**
096:             * Create a new chi-square distribution with the given degrees of freedom.
097:             * 
098:             * @param degreesOfFreedom degrees of freedom
099:             * @return a new chi-square distribution  
100:             */
101:            public abstract ChiSquaredDistribution createChiSquareDistribution(
102:                    double degreesOfFreedom);
103:
104:            /**
105:             * Create a new exponential distribution with the given degrees of freedom.
106:             * 
107:             * @param mean mean
108:             * @return a new exponential distribution  
109:             */
110:            public abstract ExponentialDistribution createExponentialDistribution(
111:                    double mean);
112:
113:            /**
114:             * Create a new F-distribution with the given degrees of freedom.
115:             * 
116:             * @param numeratorDegreesOfFreedom numerator degrees of freedom
117:             * @param denominatorDegreesOfFreedom denominator degrees of freedom
118:             * @return a new F-distribution 
119:             */
120:            public abstract FDistribution createFDistribution(
121:                    double numeratorDegreesOfFreedom,
122:                    double denominatorDegreesOfFreedom);
123:
124:            /**
125:             * Create a new gamma distribution with the given shape and scale
126:             * parameters.
127:             * 
128:             * @param alpha the shape parameter
129:             * @param beta the scale parameter
130:             * 
131:             * @return a new gamma distribution  
132:             */
133:            public abstract GammaDistribution createGammaDistribution(
134:                    double alpha, double beta);
135:
136:            /**
137:             * Create a new t distribution with the given degrees of freedom.
138:             * 
139:             * @param degreesOfFreedom degrees of freedom
140:             * @return a new t distribution  
141:             */
142:            public abstract TDistribution createTDistribution(
143:                    double degreesOfFreedom);
144:
145:            /**
146:             * Create a new hypergeometric distribution with the given the population
147:             * size, the number of successes in the population, and the sample size.
148:             * 
149:             * @param populationSize the population size
150:             * @param numberOfSuccesses number of successes in the population
151:             * @param sampleSize the sample size
152:             * @return a new hypergeometric desitribution
153:             */
154:            public abstract HypergeometricDistribution createHypergeometricDistribution(
155:                    int populationSize, int numberOfSuccesses, int sampleSize);
156:
157:            /**
158:             * Create a new normal distribution with the given mean and standard
159:             * deviation.
160:             * 
161:             * @param mean the mean of the distribution
162:             * @param sd standard deviation
163:             * @return a new normal distribution  
164:             */
165:            public abstract NormalDistribution createNormalDistribution(
166:                    double mean, double sd);
167:
168:            /**
169:             * Create a new normal distribution with mean zero and standard
170:             * deviation one.
171:             * 
172:             * @return a new normal distribution.  
173:             */
174:            public abstract NormalDistribution createNormalDistribution();
175:
176:            /**
177:             * Create a new Poisson distribution with poisson parameter lambda.
178:             * 
179:             * @param lambda poisson parameter
180:             * @return a new poisson distribution.  
181:             */
182:            public abstract PoissonDistribution createPoissonDistribution(
183:                    double lambda);
184:
185:            /**
186:             * Create a new Weibull distribution with the given shape and scale
187:             * parameters.
188:             * 
189:             * @param alpha the shape parameter.
190:             * @param beta the scale parameter.
191:             * @return a new Weibull distribution.  
192:             * @since 1.1
193:             */
194:            public WeibullDistribution createWeibullDistribution(double alpha,
195:                    double beta) {
196:                return new WeibullDistributionImpl(alpha, beta);
197:            }
198:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.