commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r926176 [8/31] - in /websites/production/commons/content/proper/commons-math: apidocs/org/apache/commons/math3/analysis/interpolation/ apidocs/org/apache/commons/math3/analysis/interpolation/class-use/ apidocs/org/apache/commons/math3/distr...
Date Sat, 18 Oct 2014 20:10:40 GMT
Added: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/analysis/interpolation/AkimaSplineInterpolator.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/analysis/interpolation/AkimaSplineInterpolator.html (added)
+++ websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/analysis/interpolation/AkimaSplineInterpolator.html Sat Oct 18 20:10:38 2014
@@ -0,0 +1,297 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="fr">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one or more<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * contributor license agreements.  See the NOTICE file distributed with<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * this work for additional information regarding copyright ownership.<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *      http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * See the License for the specific language governing permissions and<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * limitations under the License.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> */<a name="line.16"></a>
+<span class="sourceLineNo">017</span>package org.apache.commons.math3.analysis.interpolation;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import org.apache.commons.math3.analysis.polynomials.PolynomialFunction;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import org.apache.commons.math3.analysis.polynomials.PolynomialSplineFunction;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import org.apache.commons.math3.exception.DimensionMismatchException;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.commons.math3.exception.NonMonotonicSequenceException;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.commons.math3.exception.NullArgumentException;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.commons.math3.exception.NumberIsTooSmallException;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.commons.math3.exception.util.LocalizedFormats;<a name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.commons.math3.util.FastMath;<a name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.commons.math3.util.MathArrays;<a name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.commons.math3.util.Precision;<a name="line.28"></a>
+<span class="sourceLineNo">029</span><a name="line.29"></a>
+<span class="sourceLineNo">030</span>/**<a name="line.30"></a>
+<span class="sourceLineNo">031</span> * Computes a cubic spline interpolation for the data set using the Akima<a name="line.31"></a>
+<span class="sourceLineNo">032</span> * algorithm, as originally formulated by Hiroshi Akima in his 1970 paper<a name="line.32"></a>
+<span class="sourceLineNo">033</span> * "A New Method of Interpolation and Smooth Curve Fitting Based on Local Procedures."<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * J. ACM 17, 4 (October 1970), 589-602. DOI=10.1145/321607.321609<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * http://doi.acm.org/10.1145/321607.321609<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * &lt;p&gt;<a name="line.36"></a>
+<span class="sourceLineNo">037</span> * This implementation is based on the Akima implementation in the CubicSpline<a name="line.37"></a>
+<span class="sourceLineNo">038</span> * class in the Math.NET Numerics library. The method referenced is<a name="line.38"></a>
+<span class="sourceLineNo">039</span> * CubicSpline.InterpolateAkimaSorted<a name="line.39"></a>
+<span class="sourceLineNo">040</span> * &lt;p&gt;<a name="line.40"></a>
+<span class="sourceLineNo">041</span> * The {@link #interpolate(double[], double[])} method returns a<a name="line.41"></a>
+<span class="sourceLineNo">042</span> * {@link PolynomialSplineFunction} consisting of n cubic polynomials, defined<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * over the subintervals determined by the x values, x[0] &lt; x[i] ... &lt; x[n]. The<a name="line.43"></a>
+<span class="sourceLineNo">044</span> * Akima algorithm requires that n &gt;= 5.<a name="line.44"></a>
+<span class="sourceLineNo">045</span> * &lt;/p&gt;<a name="line.45"></a>
+<span class="sourceLineNo">046</span> * &lt;p&gt;<a name="line.46"></a>
+<span class="sourceLineNo">047</span> */<a name="line.47"></a>
+<span class="sourceLineNo">048</span><a name="line.48"></a>
+<span class="sourceLineNo">049</span>public class AkimaSplineInterpolator<a name="line.49"></a>
+<span class="sourceLineNo">050</span>    implements UnivariateInterpolator {<a name="line.50"></a>
+<span class="sourceLineNo">051</span><a name="line.51"></a>
+<span class="sourceLineNo">052</span><a name="line.52"></a>
+<span class="sourceLineNo">053</span>    /**<a name="line.53"></a>
+<span class="sourceLineNo">054</span>     * The minimum number of points that are needed to compute the function<a name="line.54"></a>
+<span class="sourceLineNo">055</span>     */<a name="line.55"></a>
+<span class="sourceLineNo">056</span>    public static final int MINIMUM_NUMBER_POINTS = 5;<a name="line.56"></a>
+<span class="sourceLineNo">057</span><a name="line.57"></a>
+<span class="sourceLineNo">058</span>    /**<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     * Default constructor. Builds an AkimaSplineInterpolator object<a name="line.59"></a>
+<span class="sourceLineNo">060</span>     */<a name="line.60"></a>
+<span class="sourceLineNo">061</span>    public AkimaSplineInterpolator() {<a name="line.61"></a>
+<span class="sourceLineNo">062</span><a name="line.62"></a>
+<span class="sourceLineNo">063</span>    }<a name="line.63"></a>
+<span class="sourceLineNo">064</span><a name="line.64"></a>
+<span class="sourceLineNo">065</span>    /**<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     * Computes an interpolating function for the data set.<a name="line.66"></a>
+<span class="sourceLineNo">067</span>     *<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     * @param xvals the arguments for the interpolation points<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     * @param yvals the values for the interpolation points<a name="line.69"></a>
+<span class="sourceLineNo">070</span>     * @return a function which interpolates the data set<a name="line.70"></a>
+<span class="sourceLineNo">071</span>     * @throws DimensionMismatchException if {@code x} and {@code y} have<a name="line.71"></a>
+<span class="sourceLineNo">072</span>     *         different sizes.<a name="line.72"></a>
+<span class="sourceLineNo">073</span>     * @throws NonMonotonicSequenceException if {@code x} is not sorted in<a name="line.73"></a>
+<span class="sourceLineNo">074</span>     *         strict increasing order.<a name="line.74"></a>
+<span class="sourceLineNo">075</span>     * @throws NumberIsTooSmallException if the size of {@code x} is smaller<a name="line.75"></a>
+<span class="sourceLineNo">076</span>     *         than 5.<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     */<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    public PolynomialSplineFunction interpolate(double[] xvals, double[] yvals)<a name="line.78"></a>
+<span class="sourceLineNo">079</span>        throws DimensionMismatchException, NumberIsTooSmallException,<a name="line.79"></a>
+<span class="sourceLineNo">080</span>        NonMonotonicSequenceException {<a name="line.80"></a>
+<span class="sourceLineNo">081</span>        if (xvals == null || yvals == null) {<a name="line.81"></a>
+<span class="sourceLineNo">082</span>            throw new NullArgumentException();<a name="line.82"></a>
+<span class="sourceLineNo">083</span>        }<a name="line.83"></a>
+<span class="sourceLineNo">084</span><a name="line.84"></a>
+<span class="sourceLineNo">085</span>        if (xvals.length != yvals.length) {<a name="line.85"></a>
+<span class="sourceLineNo">086</span>            throw new DimensionMismatchException(xvals.length, yvals.length);<a name="line.86"></a>
+<span class="sourceLineNo">087</span>        }<a name="line.87"></a>
+<span class="sourceLineNo">088</span><a name="line.88"></a>
+<span class="sourceLineNo">089</span>        if (xvals.length &lt; MINIMUM_NUMBER_POINTS) {<a name="line.89"></a>
+<span class="sourceLineNo">090</span>            throw new NumberIsTooSmallException(<a name="line.90"></a>
+<span class="sourceLineNo">091</span>                                                LocalizedFormats.NUMBER_OF_POINTS,<a name="line.91"></a>
+<span class="sourceLineNo">092</span>                                                xvals.length,<a name="line.92"></a>
+<span class="sourceLineNo">093</span>                                                MINIMUM_NUMBER_POINTS, true);<a name="line.93"></a>
+<span class="sourceLineNo">094</span>        }<a name="line.94"></a>
+<span class="sourceLineNo">095</span><a name="line.95"></a>
+<span class="sourceLineNo">096</span>        MathArrays.checkOrder(xvals);<a name="line.96"></a>
+<span class="sourceLineNo">097</span><a name="line.97"></a>
+<span class="sourceLineNo">098</span>        final int numberOfDiffAndWeightElements = xvals.length - 1;<a name="line.98"></a>
+<span class="sourceLineNo">099</span><a name="line.99"></a>
+<span class="sourceLineNo">100</span>        double differences[] = new double[numberOfDiffAndWeightElements];<a name="line.100"></a>
+<span class="sourceLineNo">101</span>        double weights[] = new double[numberOfDiffAndWeightElements];<a name="line.101"></a>
+<span class="sourceLineNo">102</span><a name="line.102"></a>
+<span class="sourceLineNo">103</span>        for (int i = 0; i &lt; differences.length; i++) {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>            differences[i] = (yvals[i + 1] - yvals[i]) /<a name="line.104"></a>
+<span class="sourceLineNo">105</span>                             (xvals[i + 1] - xvals[i]);<a name="line.105"></a>
+<span class="sourceLineNo">106</span>        }<a name="line.106"></a>
+<span class="sourceLineNo">107</span><a name="line.107"></a>
+<span class="sourceLineNo">108</span>        for (int i = 1; i &lt; weights.length; i++) {<a name="line.108"></a>
+<span class="sourceLineNo">109</span>            weights[i] = FastMath.abs(differences[i] - differences[i - 1]);<a name="line.109"></a>
+<span class="sourceLineNo">110</span>        }<a name="line.110"></a>
+<span class="sourceLineNo">111</span><a name="line.111"></a>
+<span class="sourceLineNo">112</span>        /* Prepare Hermite interpolation scheme */<a name="line.112"></a>
+<span class="sourceLineNo">113</span><a name="line.113"></a>
+<span class="sourceLineNo">114</span>        double firstDerivatives[] = new double[xvals.length];<a name="line.114"></a>
+<span class="sourceLineNo">115</span><a name="line.115"></a>
+<span class="sourceLineNo">116</span>        for (int i = 2; i &lt; firstDerivatives.length - 2; i++) {<a name="line.116"></a>
+<span class="sourceLineNo">117</span>            if (Precision.equals(weights[i - 1], 0.0) &amp;&amp;<a name="line.117"></a>
+<span class="sourceLineNo">118</span>                Precision.equals(weights[i + 1], 0.0)) {<a name="line.118"></a>
+<span class="sourceLineNo">119</span>                firstDerivatives[i] = (((xvals[i + 1] - xvals[i]) * differences[i - 1]) + ((xvals[i] - xvals[i - 1]) * differences[i])) /<a name="line.119"></a>
+<span class="sourceLineNo">120</span>                                      (xvals[i + 1] - xvals[i - 1]);<a name="line.120"></a>
+<span class="sourceLineNo">121</span>            } else {<a name="line.121"></a>
+<span class="sourceLineNo">122</span>                firstDerivatives[i] = ((weights[i + 1] * differences[i - 1]) + (weights[i - 1] * differences[i])) /<a name="line.122"></a>
+<span class="sourceLineNo">123</span>                                      (weights[i + 1] + weights[i - 1]);<a name="line.123"></a>
+<span class="sourceLineNo">124</span>            }<a name="line.124"></a>
+<span class="sourceLineNo">125</span>        }<a name="line.125"></a>
+<span class="sourceLineNo">126</span><a name="line.126"></a>
+<span class="sourceLineNo">127</span>        firstDerivatives[0] = this.differentiateThreePoint(xvals, yvals, 0, 0,<a name="line.127"></a>
+<span class="sourceLineNo">128</span>                                                           1, 2);<a name="line.128"></a>
+<span class="sourceLineNo">129</span>        firstDerivatives[1] = this.differentiateThreePoint(xvals, yvals, 1, 0,<a name="line.129"></a>
+<span class="sourceLineNo">130</span>                                                           1, 2);<a name="line.130"></a>
+<span class="sourceLineNo">131</span>        firstDerivatives[xvals.length - 2] = this<a name="line.131"></a>
+<span class="sourceLineNo">132</span>            .differentiateThreePoint(xvals, yvals, xvals.length - 2,<a name="line.132"></a>
+<span class="sourceLineNo">133</span>                                     xvals.length - 3, xvals.length - 2,<a name="line.133"></a>
+<span class="sourceLineNo">134</span>                                     xvals.length - 1);<a name="line.134"></a>
+<span class="sourceLineNo">135</span>        firstDerivatives[xvals.length - 1] = this<a name="line.135"></a>
+<span class="sourceLineNo">136</span>            .differentiateThreePoint(xvals, yvals, xvals.length - 1,<a name="line.136"></a>
+<span class="sourceLineNo">137</span>                                     xvals.length - 3, xvals.length - 2,<a name="line.137"></a>
+<span class="sourceLineNo">138</span>                                     xvals.length - 1);<a name="line.138"></a>
+<span class="sourceLineNo">139</span><a name="line.139"></a>
+<span class="sourceLineNo">140</span>        return this.interpolateHermiteSorted(xvals, yvals, firstDerivatives);<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    }<a name="line.141"></a>
+<span class="sourceLineNo">142</span><a name="line.142"></a>
+<span class="sourceLineNo">143</span>    /**<a name="line.143"></a>
+<span class="sourceLineNo">144</span>     * Three point differentiation helper, modeled off of the same method in the<a name="line.144"></a>
+<span class="sourceLineNo">145</span>     * Math.NET CubicSpline class. This is used by both the Apache Math and the<a name="line.145"></a>
+<span class="sourceLineNo">146</span>     * Math.NET Akima Cubic Spline algorithms<a name="line.146"></a>
+<span class="sourceLineNo">147</span>     *<a name="line.147"></a>
+<span class="sourceLineNo">148</span>     * @param xvals x values to calculate the numerical derivative with<a name="line.148"></a>
+<span class="sourceLineNo">149</span>     * @param yvals y values to calculate the numerical derivative with<a name="line.149"></a>
+<span class="sourceLineNo">150</span>     * @param indexOfDifferentiation index of the elemnt we are calculating the derivative around<a name="line.150"></a>
+<span class="sourceLineNo">151</span>     * @param indexOfFirstSample index of the first element to sample for the three point method<a name="line.151"></a>
+<span class="sourceLineNo">152</span>     * @param indexOfSecondsample index of the second element to sample for the three point method<a name="line.152"></a>
+<span class="sourceLineNo">153</span>     * @param indexOfThirdSample index of the third element to sample for the three point method<a name="line.153"></a>
+<span class="sourceLineNo">154</span>     * @return the derivative<a name="line.154"></a>
+<span class="sourceLineNo">155</span>     */<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    private double differentiateThreePoint(double[] xvals, double[] yvals,<a name="line.156"></a>
+<span class="sourceLineNo">157</span>                                           int indexOfDifferentiation,<a name="line.157"></a>
+<span class="sourceLineNo">158</span>                                           int indexOfFirstSample,<a name="line.158"></a>
+<span class="sourceLineNo">159</span>                                           int indexOfSecondsample,<a name="line.159"></a>
+<span class="sourceLineNo">160</span>                                           int indexOfThirdSample) {<a name="line.160"></a>
+<span class="sourceLineNo">161</span>        double x0 = yvals[indexOfFirstSample];<a name="line.161"></a>
+<span class="sourceLineNo">162</span>        double x1 = yvals[indexOfSecondsample];<a name="line.162"></a>
+<span class="sourceLineNo">163</span>        double x2 = yvals[indexOfThirdSample];<a name="line.163"></a>
+<span class="sourceLineNo">164</span><a name="line.164"></a>
+<span class="sourceLineNo">165</span>        double t = xvals[indexOfDifferentiation] - xvals[indexOfFirstSample];<a name="line.165"></a>
+<span class="sourceLineNo">166</span>        double t1 = xvals[indexOfSecondsample] - xvals[indexOfFirstSample];<a name="line.166"></a>
+<span class="sourceLineNo">167</span>        double t2 = xvals[indexOfThirdSample] - xvals[indexOfFirstSample];<a name="line.167"></a>
+<span class="sourceLineNo">168</span><a name="line.168"></a>
+<span class="sourceLineNo">169</span>        double a = (x2 - x0 - (t2 / t1 * (x1 - x0))) / (t2 * t2 - t1 * t2);<a name="line.169"></a>
+<span class="sourceLineNo">170</span>        double b = (x1 - x0 - a * t1 * t1) / t1;<a name="line.170"></a>
+<span class="sourceLineNo">171</span>        return (2 * a * t) + b;<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    }<a name="line.172"></a>
+<span class="sourceLineNo">173</span><a name="line.173"></a>
+<span class="sourceLineNo">174</span>    /**<a name="line.174"></a>
+<span class="sourceLineNo">175</span>     * Creates a Hermite cubic spline interpolation from the set of (x,y) value<a name="line.175"></a>
+<span class="sourceLineNo">176</span>     * pairs and their derivatives. This is modeled off of the<a name="line.176"></a>
+<span class="sourceLineNo">177</span>     * InterpolateHermiteSorted method in the Math.NET CubicSpline class.<a name="line.177"></a>
+<span class="sourceLineNo">178</span>     *<a name="line.178"></a>
+<span class="sourceLineNo">179</span>     * @param xvals x values for interpolation<a name="line.179"></a>
+<span class="sourceLineNo">180</span>     * @param yvals y values for interpolation<a name="line.180"></a>
+<span class="sourceLineNo">181</span>     * @param firstDerivatives first derivative values of the function<a name="line.181"></a>
+<span class="sourceLineNo">182</span>     * @return polynomial that fits the function<a name="line.182"></a>
+<span class="sourceLineNo">183</span>     */<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    private PolynomialSplineFunction interpolateHermiteSorted(double[] xvals,<a name="line.184"></a>
+<span class="sourceLineNo">185</span>                                                              double[] yvals,<a name="line.185"></a>
+<span class="sourceLineNo">186</span>                                                              double[] firstDerivatives) {<a name="line.186"></a>
+<span class="sourceLineNo">187</span>        if (xvals.length != yvals.length) {<a name="line.187"></a>
+<span class="sourceLineNo">188</span>            throw new DimensionMismatchException(xvals.length, yvals.length);<a name="line.188"></a>
+<span class="sourceLineNo">189</span>        }<a name="line.189"></a>
+<span class="sourceLineNo">190</span><a name="line.190"></a>
+<span class="sourceLineNo">191</span>        if (xvals.length != firstDerivatives.length) {<a name="line.191"></a>
+<span class="sourceLineNo">192</span>            throw new DimensionMismatchException(xvals.length,<a name="line.192"></a>
+<span class="sourceLineNo">193</span>                                                 firstDerivatives.length);<a name="line.193"></a>
+<span class="sourceLineNo">194</span>        }<a name="line.194"></a>
+<span class="sourceLineNo">195</span><a name="line.195"></a>
+<span class="sourceLineNo">196</span>        final int minimumLength = 2;<a name="line.196"></a>
+<span class="sourceLineNo">197</span>        if (xvals.length &lt; minimumLength) {<a name="line.197"></a>
+<span class="sourceLineNo">198</span>            throw new NumberIsTooSmallException(<a name="line.198"></a>
+<span class="sourceLineNo">199</span>                                                LocalizedFormats.NUMBER_OF_POINTS,<a name="line.199"></a>
+<span class="sourceLineNo">200</span>                                                xvals.length, minimumLength,<a name="line.200"></a>
+<span class="sourceLineNo">201</span>                                                true);<a name="line.201"></a>
+<span class="sourceLineNo">202</span>        }<a name="line.202"></a>
+<span class="sourceLineNo">203</span><a name="line.203"></a>
+<span class="sourceLineNo">204</span>        int size = xvals.length - 1;<a name="line.204"></a>
+<span class="sourceLineNo">205</span>        final PolynomialFunction polynomials[] = new PolynomialFunction[size];<a name="line.205"></a>
+<span class="sourceLineNo">206</span>        final double coefficients[] = new double[4];<a name="line.206"></a>
+<span class="sourceLineNo">207</span><a name="line.207"></a>
+<span class="sourceLineNo">208</span>        for (int i = 0; i &lt; polynomials.length; i++) {<a name="line.208"></a>
+<span class="sourceLineNo">209</span>            double w = xvals[i + 1] - xvals[i];<a name="line.209"></a>
+<span class="sourceLineNo">210</span>            double w2 = w * w;<a name="line.210"></a>
+<span class="sourceLineNo">211</span>            coefficients[0] = yvals[i];<a name="line.211"></a>
+<span class="sourceLineNo">212</span>            coefficients[1] = firstDerivatives[i];<a name="line.212"></a>
+<span class="sourceLineNo">213</span>            coefficients[2] = (3 * (yvals[i + 1] - yvals[i]) / w - 2 *<a name="line.213"></a>
+<span class="sourceLineNo">214</span>                               firstDerivatives[i] - firstDerivatives[i + 1]) /<a name="line.214"></a>
+<span class="sourceLineNo">215</span>                              w;<a name="line.215"></a>
+<span class="sourceLineNo">216</span>            coefficients[3] = (2 * (yvals[i] - yvals[i + 1]) / w +<a name="line.216"></a>
+<span class="sourceLineNo">217</span>                               firstDerivatives[i] + firstDerivatives[i + 1]) /<a name="line.217"></a>
+<span class="sourceLineNo">218</span>                              w2;<a name="line.218"></a>
+<span class="sourceLineNo">219</span>            polynomials[i] = new PolynomialFunction(coefficients);<a name="line.219"></a>
+<span class="sourceLineNo">220</span>        }<a name="line.220"></a>
+<span class="sourceLineNo">221</span><a name="line.221"></a>
+<span class="sourceLineNo">222</span>        return new PolynomialSplineFunction(xvals, polynomials);<a name="line.222"></a>
+<span class="sourceLineNo">223</span><a name="line.223"></a>
+<span class="sourceLineNo">224</span>    }<a name="line.224"></a>
+<span class="sourceLineNo">225</span>}<a name="line.225"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Propchange: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/analysis/interpolation/AkimaSplineInterpolator.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/analysis/interpolation/AkimaSplineInterpolator.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/ConstantRealDistribution.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/ConstantRealDistribution.html (added)
+++ websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/ConstantRealDistribution.html Sat Oct 18 20:10:38 2014
@@ -0,0 +1,193 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="fr">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one or more<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * contributor license agreements.  See the NOTICE file distributed with<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * this work for additional information regarding copyright ownership.<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *      http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * See the License for the specific language governing permissions and<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * limitations under the License.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> */<a name="line.16"></a>
+<span class="sourceLineNo">017</span><a name="line.17"></a>
+<span class="sourceLineNo">018</span>package org.apache.commons.math3.distribution;<a name="line.18"></a>
+<span class="sourceLineNo">019</span><a name="line.19"></a>
+<span class="sourceLineNo">020</span>import org.apache.commons.math3.exception.OutOfRangeException;<a name="line.20"></a>
+<span class="sourceLineNo">021</span><a name="line.21"></a>
+<span class="sourceLineNo">022</span>/**<a name="line.22"></a>
+<span class="sourceLineNo">023</span> * Implementation of the constant real distribution.<a name="line.23"></a>
+<span class="sourceLineNo">024</span> *<a name="line.24"></a>
+<span class="sourceLineNo">025</span> * @since 3.4<a name="line.25"></a>
+<span class="sourceLineNo">026</span> */<a name="line.26"></a>
+<span class="sourceLineNo">027</span>public class ConstantRealDistribution extends AbstractRealDistribution {<a name="line.27"></a>
+<span class="sourceLineNo">028</span><a name="line.28"></a>
+<span class="sourceLineNo">029</span>    /** Serialization ID */<a name="line.29"></a>
+<span class="sourceLineNo">030</span>    private static final long serialVersionUID = -4157745166772046273L;<a name="line.30"></a>
+<span class="sourceLineNo">031</span><a name="line.31"></a>
+<span class="sourceLineNo">032</span>    /** Constant value of the distribution */<a name="line.32"></a>
+<span class="sourceLineNo">033</span>    private final double value;<a name="line.33"></a>
+<span class="sourceLineNo">034</span><a name="line.34"></a>
+<span class="sourceLineNo">035</span>    /**<a name="line.35"></a>
+<span class="sourceLineNo">036</span>     * Create a constant real distribution with the given value.<a name="line.36"></a>
+<span class="sourceLineNo">037</span>     *<a name="line.37"></a>
+<span class="sourceLineNo">038</span>     * @param value the constant value of this distribution<a name="line.38"></a>
+<span class="sourceLineNo">039</span>     */<a name="line.39"></a>
+<span class="sourceLineNo">040</span>    public ConstantRealDistribution(double value) {<a name="line.40"></a>
+<span class="sourceLineNo">041</span>        super(null);  // Avoid creating RandomGenerator<a name="line.41"></a>
+<span class="sourceLineNo">042</span>        this.value = value;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>    }<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    /** {@inheritDoc} */<a name="line.45"></a>
+<span class="sourceLineNo">046</span>    public double density(double x) {<a name="line.46"></a>
+<span class="sourceLineNo">047</span>        return x == value ? 1 : 0;<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    }<a name="line.48"></a>
+<span class="sourceLineNo">049</span><a name="line.49"></a>
+<span class="sourceLineNo">050</span>    /** {@inheritDoc} */<a name="line.50"></a>
+<span class="sourceLineNo">051</span>    public double cumulativeProbability(double x)  {<a name="line.51"></a>
+<span class="sourceLineNo">052</span>        return x &lt; value ? 0 : 1;<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    }<a name="line.53"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>    @Override<a name="line.55"></a>
+<span class="sourceLineNo">056</span>    public double inverseCumulativeProbability(final double p)<a name="line.56"></a>
+<span class="sourceLineNo">057</span>            throws OutOfRangeException {<a name="line.57"></a>
+<span class="sourceLineNo">058</span>        if (p &lt; 0.0 || p &gt; 1.0) {<a name="line.58"></a>
+<span class="sourceLineNo">059</span>            throw new OutOfRangeException(p, 0, 1);<a name="line.59"></a>
+<span class="sourceLineNo">060</span>        }<a name="line.60"></a>
+<span class="sourceLineNo">061</span>        return value;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    }<a name="line.62"></a>
+<span class="sourceLineNo">063</span><a name="line.63"></a>
+<span class="sourceLineNo">064</span>    /**<a name="line.64"></a>
+<span class="sourceLineNo">065</span>     * {@inheritDoc}<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     */<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    public double getNumericalMean() {<a name="line.67"></a>
+<span class="sourceLineNo">068</span>        return value;<a name="line.68"></a>
+<span class="sourceLineNo">069</span>    }<a name="line.69"></a>
+<span class="sourceLineNo">070</span><a name="line.70"></a>
+<span class="sourceLineNo">071</span>    /**<a name="line.71"></a>
+<span class="sourceLineNo">072</span>     * {@inheritDoc}<a name="line.72"></a>
+<span class="sourceLineNo">073</span>     */<a name="line.73"></a>
+<span class="sourceLineNo">074</span>    public double getNumericalVariance() {<a name="line.74"></a>
+<span class="sourceLineNo">075</span>        return 0;<a name="line.75"></a>
+<span class="sourceLineNo">076</span>    }<a name="line.76"></a>
+<span class="sourceLineNo">077</span><a name="line.77"></a>
+<span class="sourceLineNo">078</span>    /**<a name="line.78"></a>
+<span class="sourceLineNo">079</span>     * {@inheritDoc}<a name="line.79"></a>
+<span class="sourceLineNo">080</span>     */<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    public double getSupportLowerBound() {<a name="line.81"></a>
+<span class="sourceLineNo">082</span>        return value;<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    }<a name="line.83"></a>
+<span class="sourceLineNo">084</span><a name="line.84"></a>
+<span class="sourceLineNo">085</span>    /**<a name="line.85"></a>
+<span class="sourceLineNo">086</span>     * {@inheritDoc}<a name="line.86"></a>
+<span class="sourceLineNo">087</span>     */<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    public double getSupportUpperBound() {<a name="line.88"></a>
+<span class="sourceLineNo">089</span>        return value;<a name="line.89"></a>
+<span class="sourceLineNo">090</span>    }<a name="line.90"></a>
+<span class="sourceLineNo">091</span><a name="line.91"></a>
+<span class="sourceLineNo">092</span>    /** {@inheritDoc} */<a name="line.92"></a>
+<span class="sourceLineNo">093</span>    public boolean isSupportLowerBoundInclusive() {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>        return true;<a name="line.94"></a>
+<span class="sourceLineNo">095</span>    }<a name="line.95"></a>
+<span class="sourceLineNo">096</span><a name="line.96"></a>
+<span class="sourceLineNo">097</span>    /** {@inheritDoc} */<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    public boolean isSupportUpperBoundInclusive() {<a name="line.98"></a>
+<span class="sourceLineNo">099</span>        return true;<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    }<a name="line.100"></a>
+<span class="sourceLineNo">101</span><a name="line.101"></a>
+<span class="sourceLineNo">102</span>    /**<a name="line.102"></a>
+<span class="sourceLineNo">103</span>     * {@inheritDoc}<a name="line.103"></a>
+<span class="sourceLineNo">104</span>     */<a name="line.104"></a>
+<span class="sourceLineNo">105</span>    public boolean isSupportConnected() {<a name="line.105"></a>
+<span class="sourceLineNo">106</span>        return true;<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    }<a name="line.107"></a>
+<span class="sourceLineNo">108</span><a name="line.108"></a>
+<span class="sourceLineNo">109</span>    /** {@inheritDoc} */<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    @Override<a name="line.110"></a>
+<span class="sourceLineNo">111</span>    public double sample()  {<a name="line.111"></a>
+<span class="sourceLineNo">112</span>        return value;<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    }<a name="line.113"></a>
+<span class="sourceLineNo">114</span><a name="line.114"></a>
+<span class="sourceLineNo">115</span>    /**<a name="line.115"></a>
+<span class="sourceLineNo">116</span>     * Override with no-op (there is no generator).<a name="line.116"></a>
+<span class="sourceLineNo">117</span>     * @param seed (ignored)<a name="line.117"></a>
+<span class="sourceLineNo">118</span>     */<a name="line.118"></a>
+<span class="sourceLineNo">119</span>    @Override<a name="line.119"></a>
+<span class="sourceLineNo">120</span>    public void reseedRandomGenerator(long seed) {}<a name="line.120"></a>
+<span class="sourceLineNo">121</span>}<a name="line.121"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Propchange: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/ConstantRealDistribution.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/ConstantRealDistribution.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/GumbelDistribution.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/GumbelDistribution.html (added)
+++ websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/GumbelDistribution.html Sat Oct 18 20:10:38 2014
@@ -0,0 +1,231 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="fr">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one or more<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * contributor license agreements.  See the NOTICE file distributed with<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * this work for additional information regarding copyright ownership.<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *      http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * See the License for the specific language governing permissions and<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * limitations under the License.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> */<a name="line.16"></a>
+<span class="sourceLineNo">017</span>package org.apache.commons.math3.distribution;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import org.apache.commons.math3.exception.NotStrictlyPositiveException;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import org.apache.commons.math3.exception.OutOfRangeException;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import org.apache.commons.math3.exception.util.LocalizedFormats;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.commons.math3.random.RandomGenerator;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.commons.math3.random.Well19937c;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.commons.math3.util.FastMath;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.commons.math3.util.MathUtils;<a name="line.25"></a>
+<span class="sourceLineNo">026</span><a name="line.26"></a>
+<span class="sourceLineNo">027</span>/**<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * This class implements the Gumbel distribution.<a name="line.28"></a>
+<span class="sourceLineNo">029</span> *<a name="line.29"></a>
+<span class="sourceLineNo">030</span> * @see &lt;a href="http://en.wikipedia.org/wiki/Gumbel_distribution"&gt;Gumbel Distribution (Wikipedia)&lt;/a&gt;<a name="line.30"></a>
+<span class="sourceLineNo">031</span> * @see &lt;a href="http://mathworld.wolfram.com/GumbelDistribution.html"&gt;Gumbel Distribution (Mathworld)&lt;/a&gt;<a name="line.31"></a>
+<span class="sourceLineNo">032</span> *<a name="line.32"></a>
+<span class="sourceLineNo">033</span> * @since 3.4<a name="line.33"></a>
+<span class="sourceLineNo">034</span> */<a name="line.34"></a>
+<span class="sourceLineNo">035</span>public class GumbelDistribution extends AbstractRealDistribution {<a name="line.35"></a>
+<span class="sourceLineNo">036</span><a name="line.36"></a>
+<span class="sourceLineNo">037</span>    /** Serializable version identifier. */<a name="line.37"></a>
+<span class="sourceLineNo">038</span>    private static final long serialVersionUID = 20141003;<a name="line.38"></a>
+<span class="sourceLineNo">039</span><a name="line.39"></a>
+<span class="sourceLineNo">040</span>    /**<a name="line.40"></a>
+<span class="sourceLineNo">041</span>     * Approximation of Euler's constant<a name="line.41"></a>
+<span class="sourceLineNo">042</span>     * see http://mathworld.wolfram.com/Euler-MascheroniConstantApproximations.html<a name="line.42"></a>
+<span class="sourceLineNo">043</span>     */<a name="line.43"></a>
+<span class="sourceLineNo">044</span>    private static final double EULER = FastMath.PI / (2 * FastMath.E);<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
+<span class="sourceLineNo">046</span>    /** The location parameter. */<a name="line.46"></a>
+<span class="sourceLineNo">047</span>    private final double mu;<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    /** The scale parameter. */<a name="line.48"></a>
+<span class="sourceLineNo">049</span>    private final double beta;<a name="line.49"></a>
+<span class="sourceLineNo">050</span><a name="line.50"></a>
+<span class="sourceLineNo">051</span>    /**<a name="line.51"></a>
+<span class="sourceLineNo">052</span>     * Build a new instance.<a name="line.52"></a>
+<span class="sourceLineNo">053</span>     *<a name="line.53"></a>
+<span class="sourceLineNo">054</span>     * @param mu location parameter<a name="line.54"></a>
+<span class="sourceLineNo">055</span>     * @param beta scale parameter (must be positive)<a name="line.55"></a>
+<span class="sourceLineNo">056</span>     * @throws NotStrictlyPositiveException if {@code beta &lt;= 0}<a name="line.56"></a>
+<span class="sourceLineNo">057</span>     */<a name="line.57"></a>
+<span class="sourceLineNo">058</span>    public GumbelDistribution(double mu, double beta) {<a name="line.58"></a>
+<span class="sourceLineNo">059</span>        this(new Well19937c(), mu, beta);<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    }<a name="line.60"></a>
+<span class="sourceLineNo">061</span><a name="line.61"></a>
+<span class="sourceLineNo">062</span>    /**<a name="line.62"></a>
+<span class="sourceLineNo">063</span>     * Build a new instance.<a name="line.63"></a>
+<span class="sourceLineNo">064</span>     *<a name="line.64"></a>
+<span class="sourceLineNo">065</span>     * @param rng Random number generator<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     * @param mu location parameter<a name="line.66"></a>
+<span class="sourceLineNo">067</span>     * @param beta scale parameter (must be positive)<a name="line.67"></a>
+<span class="sourceLineNo">068</span>     * @throws NotStrictlyPositiveException if {@code beta &lt;= 0}<a name="line.68"></a>
+<span class="sourceLineNo">069</span>     */<a name="line.69"></a>
+<span class="sourceLineNo">070</span>    public GumbelDistribution(RandomGenerator rng, double mu, double beta) {<a name="line.70"></a>
+<span class="sourceLineNo">071</span>        super(rng);<a name="line.71"></a>
+<span class="sourceLineNo">072</span><a name="line.72"></a>
+<span class="sourceLineNo">073</span>        if (beta &lt;= 0) {<a name="line.73"></a>
+<span class="sourceLineNo">074</span>            throw new NotStrictlyPositiveException(LocalizedFormats.SCALE, beta);<a name="line.74"></a>
+<span class="sourceLineNo">075</span>        }<a name="line.75"></a>
+<span class="sourceLineNo">076</span><a name="line.76"></a>
+<span class="sourceLineNo">077</span>        this.beta = beta;<a name="line.77"></a>
+<span class="sourceLineNo">078</span>        this.mu = mu;<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    }<a name="line.79"></a>
+<span class="sourceLineNo">080</span><a name="line.80"></a>
+<span class="sourceLineNo">081</span>    /**<a name="line.81"></a>
+<span class="sourceLineNo">082</span>     * Access the location parameter, {@code mu}.<a name="line.82"></a>
+<span class="sourceLineNo">083</span>     *<a name="line.83"></a>
+<span class="sourceLineNo">084</span>     * @return the location parameter.<a name="line.84"></a>
+<span class="sourceLineNo">085</span>     */<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    public double getLocation() {<a name="line.86"></a>
+<span class="sourceLineNo">087</span>        return mu;<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    }<a name="line.88"></a>
+<span class="sourceLineNo">089</span><a name="line.89"></a>
+<span class="sourceLineNo">090</span>    /**<a name="line.90"></a>
+<span class="sourceLineNo">091</span>     * Access the scale parameter, {@code beta}.<a name="line.91"></a>
+<span class="sourceLineNo">092</span>     *<a name="line.92"></a>
+<span class="sourceLineNo">093</span>     * @return the scale parameter.<a name="line.93"></a>
+<span class="sourceLineNo">094</span>     */<a name="line.94"></a>
+<span class="sourceLineNo">095</span>    public double getScale() {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>        return beta;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    }<a name="line.97"></a>
+<span class="sourceLineNo">098</span><a name="line.98"></a>
+<span class="sourceLineNo">099</span>    /** {@inheritDoc} */<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    public double density(double x) {<a name="line.100"></a>
+<span class="sourceLineNo">101</span>        final double z = (x - mu) / beta;<a name="line.101"></a>
+<span class="sourceLineNo">102</span>        final double t = FastMath.exp(-z);<a name="line.102"></a>
+<span class="sourceLineNo">103</span>        return FastMath.exp(-z - t) / beta;<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    }<a name="line.104"></a>
+<span class="sourceLineNo">105</span><a name="line.105"></a>
+<span class="sourceLineNo">106</span>    /** {@inheritDoc} */<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    public double cumulativeProbability(double x) {<a name="line.107"></a>
+<span class="sourceLineNo">108</span>        final double z = (x - mu) / beta;<a name="line.108"></a>
+<span class="sourceLineNo">109</span>        return FastMath.exp(-FastMath.exp(-z));<a name="line.109"></a>
+<span class="sourceLineNo">110</span>    }<a name="line.110"></a>
+<span class="sourceLineNo">111</span><a name="line.111"></a>
+<span class="sourceLineNo">112</span>    @Override<a name="line.112"></a>
+<span class="sourceLineNo">113</span>    public double inverseCumulativeProbability(double p) throws OutOfRangeException {<a name="line.113"></a>
+<span class="sourceLineNo">114</span>        if (p &lt; 0.0 || p &gt; 1.0) {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>            throw new OutOfRangeException(p, 0.0, 1.0);<a name="line.115"></a>
+<span class="sourceLineNo">116</span>        } else if (p == 0) {<a name="line.116"></a>
+<span class="sourceLineNo">117</span>            return Double.NEGATIVE_INFINITY;<a name="line.117"></a>
+<span class="sourceLineNo">118</span>        } else if (p == 1) {<a name="line.118"></a>
+<span class="sourceLineNo">119</span>            return Double.POSITIVE_INFINITY;<a name="line.119"></a>
+<span class="sourceLineNo">120</span>        }<a name="line.120"></a>
+<span class="sourceLineNo">121</span>        return mu - FastMath.log(-FastMath.log(p)) * beta;<a name="line.121"></a>
+<span class="sourceLineNo">122</span>    }<a name="line.122"></a>
+<span class="sourceLineNo">123</span><a name="line.123"></a>
+<span class="sourceLineNo">124</span>    /** {@inheritDoc} */<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    public double getNumericalMean() {<a name="line.125"></a>
+<span class="sourceLineNo">126</span>        return mu + EULER * beta;<a name="line.126"></a>
+<span class="sourceLineNo">127</span>    }<a name="line.127"></a>
+<span class="sourceLineNo">128</span><a name="line.128"></a>
+<span class="sourceLineNo">129</span>    /** {@inheritDoc} */<a name="line.129"></a>
+<span class="sourceLineNo">130</span>    public double getNumericalVariance() {<a name="line.130"></a>
+<span class="sourceLineNo">131</span>        return (MathUtils.PI_SQUARED) / 6.0 * (beta * beta);<a name="line.131"></a>
+<span class="sourceLineNo">132</span>    }<a name="line.132"></a>
+<span class="sourceLineNo">133</span><a name="line.133"></a>
+<span class="sourceLineNo">134</span>    /** {@inheritDoc} */<a name="line.134"></a>
+<span class="sourceLineNo">135</span>    public double getSupportLowerBound() {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>        return Double.NEGATIVE_INFINITY;<a name="line.136"></a>
+<span class="sourceLineNo">137</span>    }<a name="line.137"></a>
+<span class="sourceLineNo">138</span><a name="line.138"></a>
+<span class="sourceLineNo">139</span>    /** {@inheritDoc} */<a name="line.139"></a>
+<span class="sourceLineNo">140</span>    public double getSupportUpperBound() {<a name="line.140"></a>
+<span class="sourceLineNo">141</span>        return Double.POSITIVE_INFINITY;<a name="line.141"></a>
+<span class="sourceLineNo">142</span>    }<a name="line.142"></a>
+<span class="sourceLineNo">143</span><a name="line.143"></a>
+<span class="sourceLineNo">144</span>    /** {@inheritDoc} */<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    public boolean isSupportLowerBoundInclusive() {<a name="line.145"></a>
+<span class="sourceLineNo">146</span>        return false;<a name="line.146"></a>
+<span class="sourceLineNo">147</span>    }<a name="line.147"></a>
+<span class="sourceLineNo">148</span><a name="line.148"></a>
+<span class="sourceLineNo">149</span>    /** {@inheritDoc} */<a name="line.149"></a>
+<span class="sourceLineNo">150</span>    public boolean isSupportUpperBoundInclusive() {<a name="line.150"></a>
+<span class="sourceLineNo">151</span>        return false;<a name="line.151"></a>
+<span class="sourceLineNo">152</span>    }<a name="line.152"></a>
+<span class="sourceLineNo">153</span><a name="line.153"></a>
+<span class="sourceLineNo">154</span>    /** {@inheritDoc} */<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    public boolean isSupportConnected() {<a name="line.155"></a>
+<span class="sourceLineNo">156</span>        return true;<a name="line.156"></a>
+<span class="sourceLineNo">157</span>    }<a name="line.157"></a>
+<span class="sourceLineNo">158</span><a name="line.158"></a>
+<span class="sourceLineNo">159</span>}<a name="line.159"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Propchange: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/GumbelDistribution.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/GumbelDistribution.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/LaplaceDistribution.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/LaplaceDistribution.html (added)
+++ websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/LaplaceDistribution.html Sat Oct 18 20:10:38 2014
@@ -0,0 +1,225 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="fr">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one or more<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * contributor license agreements.  See the NOTICE file distributed with<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * this work for additional information regarding copyright ownership.<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *      http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * See the License for the specific language governing permissions and<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * limitations under the License.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> */<a name="line.16"></a>
+<span class="sourceLineNo">017</span>package org.apache.commons.math3.distribution;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import org.apache.commons.math3.exception.NotStrictlyPositiveException;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import org.apache.commons.math3.exception.OutOfRangeException;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import org.apache.commons.math3.exception.util.LocalizedFormats;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.commons.math3.random.RandomGenerator;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.commons.math3.random.Well19937c;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.commons.math3.util.FastMath;<a name="line.24"></a>
+<span class="sourceLineNo">025</span><a name="line.25"></a>
+<span class="sourceLineNo">026</span>/**<a name="line.26"></a>
+<span class="sourceLineNo">027</span> * This class implements the Laplace distribution.<a name="line.27"></a>
+<span class="sourceLineNo">028</span> *<a name="line.28"></a>
+<span class="sourceLineNo">029</span> * @see &lt;a href="http://en.wikipedia.org/wiki/Laplace_distribution"&gt;Laplace distribution (Wikipedia)&lt;/a&gt;<a name="line.29"></a>
+<span class="sourceLineNo">030</span> *<a name="line.30"></a>
+<span class="sourceLineNo">031</span> * @since 3.4<a name="line.31"></a>
+<span class="sourceLineNo">032</span> */<a name="line.32"></a>
+<span class="sourceLineNo">033</span>public class LaplaceDistribution extends AbstractRealDistribution {<a name="line.33"></a>
+<span class="sourceLineNo">034</span><a name="line.34"></a>
+<span class="sourceLineNo">035</span>    /** Serializable version identifier. */<a name="line.35"></a>
+<span class="sourceLineNo">036</span>    private static final long serialVersionUID = 20141003;<a name="line.36"></a>
+<span class="sourceLineNo">037</span><a name="line.37"></a>
+<span class="sourceLineNo">038</span>    /** The location parameter. */<a name="line.38"></a>
+<span class="sourceLineNo">039</span>    private final double mu;<a name="line.39"></a>
+<span class="sourceLineNo">040</span>    /** The scale parameter. */<a name="line.40"></a>
+<span class="sourceLineNo">041</span>    private final double beta;<a name="line.41"></a>
+<span class="sourceLineNo">042</span><a name="line.42"></a>
+<span class="sourceLineNo">043</span>    /**<a name="line.43"></a>
+<span class="sourceLineNo">044</span>     * Build a new instance.<a name="line.44"></a>
+<span class="sourceLineNo">045</span>     *<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     * @param mu location parameter<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     * @param beta scale parameter (must be positive)<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     * @throws NotStrictlyPositiveException if {@code beta &lt;= 0}<a name="line.48"></a>
+<span class="sourceLineNo">049</span>     */<a name="line.49"></a>
+<span class="sourceLineNo">050</span>    public LaplaceDistribution(double mu, double beta) {<a name="line.50"></a>
+<span class="sourceLineNo">051</span>        this(new Well19937c(), mu, beta);<a name="line.51"></a>
+<span class="sourceLineNo">052</span>    }<a name="line.52"></a>
+<span class="sourceLineNo">053</span><a name="line.53"></a>
+<span class="sourceLineNo">054</span>    /**<a name="line.54"></a>
+<span class="sourceLineNo">055</span>     * Build a new instance.<a name="line.55"></a>
+<span class="sourceLineNo">056</span>     *<a name="line.56"></a>
+<span class="sourceLineNo">057</span>     * @param rng Random number generator<a name="line.57"></a>
+<span class="sourceLineNo">058</span>     * @param mu location parameter<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     * @param beta scale parameter (must be positive)<a name="line.59"></a>
+<span class="sourceLineNo">060</span>     * @throws NotStrictlyPositiveException if {@code beta &lt;= 0}<a name="line.60"></a>
+<span class="sourceLineNo">061</span>     */<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    public LaplaceDistribution(RandomGenerator rng, double mu, double beta) {<a name="line.62"></a>
+<span class="sourceLineNo">063</span>        super(rng);<a name="line.63"></a>
+<span class="sourceLineNo">064</span><a name="line.64"></a>
+<span class="sourceLineNo">065</span>        if (beta &lt;= 0.0) {<a name="line.65"></a>
+<span class="sourceLineNo">066</span>            throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, beta);<a name="line.66"></a>
+<span class="sourceLineNo">067</span>        }<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>        this.mu = mu;<a name="line.69"></a>
+<span class="sourceLineNo">070</span>        this.beta = beta;<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    }<a name="line.71"></a>
+<span class="sourceLineNo">072</span><a name="line.72"></a>
+<span class="sourceLineNo">073</span>    /**<a name="line.73"></a>
+<span class="sourceLineNo">074</span>     * Access the location parameter, {@code mu}.<a name="line.74"></a>
+<span class="sourceLineNo">075</span>     *<a name="line.75"></a>
+<span class="sourceLineNo">076</span>     * @return the location parameter.<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     */<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    public double getLocation() {<a name="line.78"></a>
+<span class="sourceLineNo">079</span>        return mu;<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    }<a name="line.80"></a>
+<span class="sourceLineNo">081</span><a name="line.81"></a>
+<span class="sourceLineNo">082</span>    /**<a name="line.82"></a>
+<span class="sourceLineNo">083</span>     * Access the scale parameter, {@code beta}.<a name="line.83"></a>
+<span class="sourceLineNo">084</span>     *<a name="line.84"></a>
+<span class="sourceLineNo">085</span>     * @return the scale parameter.<a name="line.85"></a>
+<span class="sourceLineNo">086</span>     */<a name="line.86"></a>
+<span class="sourceLineNo">087</span>    public double getScale() {<a name="line.87"></a>
+<span class="sourceLineNo">088</span>        return beta;<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    }<a name="line.89"></a>
+<span class="sourceLineNo">090</span><a name="line.90"></a>
+<span class="sourceLineNo">091</span>    /** {@inheritDoc} */<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    public double density(double x) {<a name="line.92"></a>
+<span class="sourceLineNo">093</span>        return FastMath.exp(-FastMath.abs(x - mu) / beta) / (2.0 * beta);<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    }<a name="line.94"></a>
+<span class="sourceLineNo">095</span><a name="line.95"></a>
+<span class="sourceLineNo">096</span>    /** {@inheritDoc} */<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    public double cumulativeProbability(double x) {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        if (x &lt;= mu) {<a name="line.98"></a>
+<span class="sourceLineNo">099</span>            return FastMath.exp((x - mu) / beta) / 2.0;<a name="line.99"></a>
+<span class="sourceLineNo">100</span>        } else {<a name="line.100"></a>
+<span class="sourceLineNo">101</span>            return 1.0 - FastMath.exp((mu - x) / beta) / 2.0;<a name="line.101"></a>
+<span class="sourceLineNo">102</span>        }<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    }<a name="line.103"></a>
+<span class="sourceLineNo">104</span><a name="line.104"></a>
+<span class="sourceLineNo">105</span>    @Override<a name="line.105"></a>
+<span class="sourceLineNo">106</span>    public double inverseCumulativeProbability(double p) throws OutOfRangeException {<a name="line.106"></a>
+<span class="sourceLineNo">107</span>        if (p &lt; 0.0 || p &gt; 1.0) {<a name="line.107"></a>
+<span class="sourceLineNo">108</span>            throw new OutOfRangeException(p, 0.0, 1.0);<a name="line.108"></a>
+<span class="sourceLineNo">109</span>        } else if (p == 0) {<a name="line.109"></a>
+<span class="sourceLineNo">110</span>            return 0.0;<a name="line.110"></a>
+<span class="sourceLineNo">111</span>        } else if (p == 1) {<a name="line.111"></a>
+<span class="sourceLineNo">112</span>            return Double.POSITIVE_INFINITY;<a name="line.112"></a>
+<span class="sourceLineNo">113</span>        }<a name="line.113"></a>
+<span class="sourceLineNo">114</span>        double x = (p &gt; 0.5) ? -Math.log(2.0 - 2.0 * p) : Math.log(2.0 * p);<a name="line.114"></a>
+<span class="sourceLineNo">115</span>        return mu + beta * x;<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    }<a name="line.116"></a>
+<span class="sourceLineNo">117</span><a name="line.117"></a>
+<span class="sourceLineNo">118</span>    /** {@inheritDoc} */<a name="line.118"></a>
+<span class="sourceLineNo">119</span>    public double getNumericalMean() {<a name="line.119"></a>
+<span class="sourceLineNo">120</span>        return mu;<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    }<a name="line.121"></a>
+<span class="sourceLineNo">122</span><a name="line.122"></a>
+<span class="sourceLineNo">123</span>    /** {@inheritDoc} */<a name="line.123"></a>
+<span class="sourceLineNo">124</span>    public double getNumericalVariance() {<a name="line.124"></a>
+<span class="sourceLineNo">125</span>        return 2.0 * beta * beta;<a name="line.125"></a>
+<span class="sourceLineNo">126</span>    }<a name="line.126"></a>
+<span class="sourceLineNo">127</span><a name="line.127"></a>
+<span class="sourceLineNo">128</span>    /** {@inheritDoc} */<a name="line.128"></a>
+<span class="sourceLineNo">129</span>    public double getSupportLowerBound() {<a name="line.129"></a>
+<span class="sourceLineNo">130</span>        return Double.NEGATIVE_INFINITY;<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    }<a name="line.131"></a>
+<span class="sourceLineNo">132</span><a name="line.132"></a>
+<span class="sourceLineNo">133</span>    /** {@inheritDoc} */<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    public double getSupportUpperBound() {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>        return Double.POSITIVE_INFINITY;<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    }<a name="line.136"></a>
+<span class="sourceLineNo">137</span><a name="line.137"></a>
+<span class="sourceLineNo">138</span>    /** {@inheritDoc} */<a name="line.138"></a>
+<span class="sourceLineNo">139</span>    public boolean isSupportLowerBoundInclusive() {<a name="line.139"></a>
+<span class="sourceLineNo">140</span>        return false;<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    }<a name="line.141"></a>
+<span class="sourceLineNo">142</span><a name="line.142"></a>
+<span class="sourceLineNo">143</span>    /** {@inheritDoc} */<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    public boolean isSupportUpperBoundInclusive() {<a name="line.144"></a>
+<span class="sourceLineNo">145</span>        return false;<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    }<a name="line.146"></a>
+<span class="sourceLineNo">147</span><a name="line.147"></a>
+<span class="sourceLineNo">148</span>    /** {@inheritDoc} */<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    public boolean isSupportConnected() {<a name="line.149"></a>
+<span class="sourceLineNo">150</span>        return true;<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    }<a name="line.151"></a>
+<span class="sourceLineNo">152</span><a name="line.152"></a>
+<span class="sourceLineNo">153</span>}<a name="line.153"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Propchange: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/LaplaceDistribution.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/LaplaceDistribution.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/LogisticDistribution.html
==============================================================================
--- websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/LogisticDistribution.html (added)
+++ websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/LogisticDistribution.html Sat Oct 18 20:10:38 2014
@@ -0,0 +1,225 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="fr">
+<head>
+<title>Source code</title>
+<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
+</head>
+<body>
+<div class="sourceContainer">
+<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
+<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one or more<a name="line.2"></a>
+<span class="sourceLineNo">003</span> * contributor license agreements.  See the NOTICE file distributed with<a name="line.3"></a>
+<span class="sourceLineNo">004</span> * this work for additional information regarding copyright ownership.<a name="line.4"></a>
+<span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
+<span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
+<span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
+<span class="sourceLineNo">009</span> *      http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
+<span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
+<span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
+<span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
+<span class="sourceLineNo">014</span> * See the License for the specific language governing permissions and<a name="line.14"></a>
+<span class="sourceLineNo">015</span> * limitations under the License.<a name="line.15"></a>
+<span class="sourceLineNo">016</span> */<a name="line.16"></a>
+<span class="sourceLineNo">017</span>package org.apache.commons.math3.distribution;<a name="line.17"></a>
+<span class="sourceLineNo">018</span><a name="line.18"></a>
+<span class="sourceLineNo">019</span>import org.apache.commons.math3.exception.NotStrictlyPositiveException;<a name="line.19"></a>
+<span class="sourceLineNo">020</span>import org.apache.commons.math3.exception.OutOfRangeException;<a name="line.20"></a>
+<span class="sourceLineNo">021</span>import org.apache.commons.math3.exception.util.LocalizedFormats;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import org.apache.commons.math3.random.RandomGenerator;<a name="line.22"></a>
+<span class="sourceLineNo">023</span>import org.apache.commons.math3.random.Well19937c;<a name="line.23"></a>
+<span class="sourceLineNo">024</span>import org.apache.commons.math3.util.FastMath;<a name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.commons.math3.util.MathUtils;<a name="line.25"></a>
+<span class="sourceLineNo">026</span><a name="line.26"></a>
+<span class="sourceLineNo">027</span>/**<a name="line.27"></a>
+<span class="sourceLineNo">028</span> * This class implements the Logistic distribution.<a name="line.28"></a>
+<span class="sourceLineNo">029</span> *<a name="line.29"></a>
+<span class="sourceLineNo">030</span> * @see &lt;a href="http://en.wikipedia.org/wiki/Logistic_distribution"&gt;Logistic Distribution (Wikipedia)&lt;/a&gt;<a name="line.30"></a>
+<span class="sourceLineNo">031</span> * @see &lt;a href="http://mathworld.wolfram.com/LogisticDistribution.html"&gt;Logistic Distribution (Mathworld)&lt;/a&gt;<a name="line.31"></a>
+<span class="sourceLineNo">032</span> *<a name="line.32"></a>
+<span class="sourceLineNo">033</span> * @since 3.4<a name="line.33"></a>
+<span class="sourceLineNo">034</span> */<a name="line.34"></a>
+<span class="sourceLineNo">035</span>public class LogisticDistribution extends AbstractRealDistribution {<a name="line.35"></a>
+<span class="sourceLineNo">036</span><a name="line.36"></a>
+<span class="sourceLineNo">037</span>    /** Serializable version identifier. */<a name="line.37"></a>
+<span class="sourceLineNo">038</span>    private static final long serialVersionUID = 20141003;<a name="line.38"></a>
+<span class="sourceLineNo">039</span><a name="line.39"></a>
+<span class="sourceLineNo">040</span>    /** The location parameter. */<a name="line.40"></a>
+<span class="sourceLineNo">041</span>    private final double mu;<a name="line.41"></a>
+<span class="sourceLineNo">042</span>    /** The scale parameter. */<a name="line.42"></a>
+<span class="sourceLineNo">043</span>    private final double s;<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    /**<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     * Build a new instance.<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     *<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     * @param mu location parameter<a name="line.48"></a>
+<span class="sourceLineNo">049</span>     * @param s scale parameter (must be positive)<a name="line.49"></a>
+<span class="sourceLineNo">050</span>     * @throws NotStrictlyPositiveException if {@code beta &lt;= 0}<a name="line.50"></a>
+<span class="sourceLineNo">051</span>     */<a name="line.51"></a>
+<span class="sourceLineNo">052</span>    public LogisticDistribution(double mu, double s) {<a name="line.52"></a>
+<span class="sourceLineNo">053</span>        this(new Well19937c(), mu, s);<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    }<a name="line.54"></a>
+<span class="sourceLineNo">055</span><a name="line.55"></a>
+<span class="sourceLineNo">056</span>    /**<a name="line.56"></a>
+<span class="sourceLineNo">057</span>     * Build a new instance.<a name="line.57"></a>
+<span class="sourceLineNo">058</span>     *<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     * @param rng Random number generator<a name="line.59"></a>
+<span class="sourceLineNo">060</span>     * @param mu location parameter<a name="line.60"></a>
+<span class="sourceLineNo">061</span>     * @param s scale parameter (must be positive)<a name="line.61"></a>
+<span class="sourceLineNo">062</span>     * @throws NotStrictlyPositiveException if {@code beta &lt;= 0}<a name="line.62"></a>
+<span class="sourceLineNo">063</span>     */<a name="line.63"></a>
+<span class="sourceLineNo">064</span>    public LogisticDistribution(RandomGenerator rng, double mu, double s) {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>        super(rng);<a name="line.65"></a>
+<span class="sourceLineNo">066</span><a name="line.66"></a>
+<span class="sourceLineNo">067</span>        if (s &lt;= 0.0) {<a name="line.67"></a>
+<span class="sourceLineNo">068</span>            throw new NotStrictlyPositiveException(LocalizedFormats.NOT_POSITIVE_SCALE, s);<a name="line.68"></a>
+<span class="sourceLineNo">069</span>        }<a name="line.69"></a>
+<span class="sourceLineNo">070</span><a name="line.70"></a>
+<span class="sourceLineNo">071</span>        this.mu = mu;<a name="line.71"></a>
+<span class="sourceLineNo">072</span>        this.s = s;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>    }<a name="line.73"></a>
+<span class="sourceLineNo">074</span><a name="line.74"></a>
+<span class="sourceLineNo">075</span>    /**<a name="line.75"></a>
+<span class="sourceLineNo">076</span>     * Access the location parameter, {@code mu}.<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     *<a name="line.77"></a>
+<span class="sourceLineNo">078</span>     * @return the location parameter.<a name="line.78"></a>
+<span class="sourceLineNo">079</span>     */<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    public double getLocation() {<a name="line.80"></a>
+<span class="sourceLineNo">081</span>        return mu;<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    }<a name="line.82"></a>
+<span class="sourceLineNo">083</span><a name="line.83"></a>
+<span class="sourceLineNo">084</span>    /**<a name="line.84"></a>
+<span class="sourceLineNo">085</span>     * Access the scale parameter, {@code s}.<a name="line.85"></a>
+<span class="sourceLineNo">086</span>     *<a name="line.86"></a>
+<span class="sourceLineNo">087</span>     * @return the scale parameter.<a name="line.87"></a>
+<span class="sourceLineNo">088</span>     */<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    public double getScale() {<a name="line.89"></a>
+<span class="sourceLineNo">090</span>        return s;<a name="line.90"></a>
+<span class="sourceLineNo">091</span>    }<a name="line.91"></a>
+<span class="sourceLineNo">092</span><a name="line.92"></a>
+<span class="sourceLineNo">093</span>    /** {@inheritDoc} */<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    public double density(double x) {<a name="line.94"></a>
+<span class="sourceLineNo">095</span>        double z = (x - mu) / s;<a name="line.95"></a>
+<span class="sourceLineNo">096</span>        double v = FastMath.exp(-z);<a name="line.96"></a>
+<span class="sourceLineNo">097</span>        return 1 / s * v / ((1.0 + v) * (1.0 + v));<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    }<a name="line.98"></a>
+<span class="sourceLineNo">099</span><a name="line.99"></a>
+<span class="sourceLineNo">100</span>    /** {@inheritDoc} */<a name="line.100"></a>
+<span class="sourceLineNo">101</span>    public double cumulativeProbability(double x) {<a name="line.101"></a>
+<span class="sourceLineNo">102</span>        double z = 1 / s * (x - mu);<a name="line.102"></a>
+<span class="sourceLineNo">103</span>        return 1.0 / (1.0 + FastMath.exp(-z));<a name="line.103"></a>
+<span class="sourceLineNo">104</span>    }<a name="line.104"></a>
+<span class="sourceLineNo">105</span><a name="line.105"></a>
+<span class="sourceLineNo">106</span>    @Override<a name="line.106"></a>
+<span class="sourceLineNo">107</span>    public double inverseCumulativeProbability(double p) throws OutOfRangeException {<a name="line.107"></a>
+<span class="sourceLineNo">108</span>        if (p &lt; 0.0 || p &gt; 1.0) {<a name="line.108"></a>
+<span class="sourceLineNo">109</span>            throw new OutOfRangeException(p, 0.0, 1.0);<a name="line.109"></a>
+<span class="sourceLineNo">110</span>        } else if (p == 0) {<a name="line.110"></a>
+<span class="sourceLineNo">111</span>            return 0.0;<a name="line.111"></a>
+<span class="sourceLineNo">112</span>        } else if (p == 1) {<a name="line.112"></a>
+<span class="sourceLineNo">113</span>            return Double.POSITIVE_INFINITY;<a name="line.113"></a>
+<span class="sourceLineNo">114</span>        }<a name="line.114"></a>
+<span class="sourceLineNo">115</span>        return s * Math.log(p / (1.0 - p)) + mu;<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    }<a name="line.116"></a>
+<span class="sourceLineNo">117</span><a name="line.117"></a>
+<span class="sourceLineNo">118</span>    /** {@inheritDoc} */<a name="line.118"></a>
+<span class="sourceLineNo">119</span>    public double getNumericalMean() {<a name="line.119"></a>
+<span class="sourceLineNo">120</span>        return mu;<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    }<a name="line.121"></a>
+<span class="sourceLineNo">122</span><a name="line.122"></a>
+<span class="sourceLineNo">123</span>    /** {@inheritDoc} */<a name="line.123"></a>
+<span class="sourceLineNo">124</span>    public double getNumericalVariance() {<a name="line.124"></a>
+<span class="sourceLineNo">125</span>        return (MathUtils.PI_SQUARED / 3.0) * (1.0 / (s * s));<a name="line.125"></a>
+<span class="sourceLineNo">126</span>    }<a name="line.126"></a>
+<span class="sourceLineNo">127</span><a name="line.127"></a>
+<span class="sourceLineNo">128</span>    /** {@inheritDoc} */<a name="line.128"></a>
+<span class="sourceLineNo">129</span>    public double getSupportLowerBound() {<a name="line.129"></a>
+<span class="sourceLineNo">130</span>        return Double.NEGATIVE_INFINITY;<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    }<a name="line.131"></a>
+<span class="sourceLineNo">132</span><a name="line.132"></a>
+<span class="sourceLineNo">133</span>    /** {@inheritDoc} */<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    public double getSupportUpperBound() {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>        return Double.POSITIVE_INFINITY;<a name="line.135"></a>
+<span class="sourceLineNo">136</span>    }<a name="line.136"></a>
+<span class="sourceLineNo">137</span><a name="line.137"></a>
+<span class="sourceLineNo">138</span>    /** {@inheritDoc} */<a name="line.138"></a>
+<span class="sourceLineNo">139</span>    public boolean isSupportLowerBoundInclusive() {<a name="line.139"></a>
+<span class="sourceLineNo">140</span>        return false;<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    }<a name="line.141"></a>
+<span class="sourceLineNo">142</span><a name="line.142"></a>
+<span class="sourceLineNo">143</span>    /** {@inheritDoc} */<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    public boolean isSupportUpperBoundInclusive() {<a name="line.144"></a>
+<span class="sourceLineNo">145</span>        return false;<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    }<a name="line.146"></a>
+<span class="sourceLineNo">147</span><a name="line.147"></a>
+<span class="sourceLineNo">148</span>    /** {@inheritDoc} */<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    public boolean isSupportConnected() {<a name="line.149"></a>
+<span class="sourceLineNo">150</span>        return true;<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    }<a name="line.151"></a>
+<span class="sourceLineNo">152</span><a name="line.152"></a>
+<span class="sourceLineNo">153</span>}<a name="line.153"></a>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre>
+</div>
+</body>
+</html>

Propchange: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/LogisticDistribution.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: websites/production/commons/content/proper/commons-math/apidocs/src-html/org/apache/commons/math3/distribution/LogisticDistribution.html
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision



Mime
View raw message