/*
Copyright (C) 2009 Ueli Hofstetter
This source code is release under the BSD License.
This file is part of JQuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://jquantlib.org/
JQuantLib is free software: you can redistribute it and/or modify it
under the terms of the JQuantLib license. You should have received a
copy of the license along with this program; if not, please email
. The license is also available online at
.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
JQuantLib is based on QuantLib. http://quantlib.org/
When applicable, the original copyright notice follows this notice.
*/
/*
Copyright (C) 2003 Ferdinando Ametrano
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify it
under the terms of the QuantLib license. You should have received a
copy of the license along with this program; if not, please email
. The license is also available online at
.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
*/
package org.jquantlib.math.statistics;
import org.jquantlib.QL;
import org.jquantlib.lang.annotation.QualityAssurance;
import org.jquantlib.lang.annotation.QualityAssurance.Quality;
import org.jquantlib.lang.annotation.QualityAssurance.Version;
import org.jquantlib.math.matrixutilities.Array;
@QualityAssurance(quality = Quality.Q4_UNIT, reviewers = { "Richard Gomes" }, version = Version.V097)
public class DiscrepancyStatistics extends SequenceStatistics {
private static final String DIMENSION_NOT_ALLOWED = "dimension==1 not allowed";
private /*@Real*/ double bdiscr_;
private /*@Real*/ double ddiscr_;
private /*@Real*/ double adiscr_;
private /*@Real*/ double cdiscr_;
// constructor
public DiscrepancyStatistics(final /*@Size*/ int dimension) {
super(dimension);
reset(dimension);
}
//--- name 1-dimensional inspectors
public /*@Real*/ double discrepancy() /*@ReadOnly*/ {
/*@Size*/ int N = samples();
/*
* THIS BLOCK IS COMMENTED OUT AT ORIGINAL QuantLib/C++ SOURCES
*
Size i;
Real double r_ik, r_jk, cdiscr = adiscr = 0.0, temp = 1.0;
for (i=0; i
Ads help maintain this website.