// Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IChanceCorrectedAgreement.java
// public interface IChanceCorrectedAgreement
//     extends IAgreementMeasure
// {
//     /**
//      * Returns the observed agreement of an annotation study. The observed agreement is basically
//      * the proportion of annotation units that the raters agree on divided by the number of units in
//      * the given study.
//      */
//     public double calculateObservedAgreement();
// 
//     /**
//      * Returns the expected agreement of an annotation study. The expected agreement is the
//      * proportion of agreement that would be expected by chance alone. The expected agreement should
//      * be equal to the observed agreement if each rater makes a random decision for each unit.
//      */
//     public double calculateExpectedAgreement();
// }


import java.math.BigDecimal;
import java.math.MathContext;
import java.util.Map;
import org.dkpro.statistics.agreement.IChanceCorrectedAgreement;
/*
 * Copyright 2014
 * Ubiquitous Knowledge Processing (UKP) Lab
 * Technische Universität Darmstadt
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.dkpro.statistics.agreement.coding;



/**
 * Implementation of Scott's pi (1955) for calculating a chance-corrected inter-rater agreement for
 * two raters. The measure assumes the same probability distribution for all raters.<br>
 * <br>
 * References:
 * <ul>
 * <li>Artstein, R. &amp; Poesio, M.: Inter-Coder Agreement for Computational Linguistics.
 * Computational Linguistics 34(4):555-596, 2008.</li>
 * <li>Scott, W.A.: Reliability of content analysis: The case of nominal scale coding. Public
 * Opinion Quaterly 19(3):321-325, 1955.</li>
 * </ul>
 * 
 * @author Christian M. Meyer
 */
public class ScottPiAgreement
    extends CodingAgreementMeasure
// Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/IChanceCorrectedAgreement.java
// public interface IChanceCorrectedAgreement
//     extends IAgreementMeasure
// {
//     /**
//      * Returns the observed agreement of an annotation study. The observed agreement is basically
//      * the proportion of annotation units that the raters agree on divided by the number of units in
//      * the given study.
//      */
//     public double calculateObservedAgreement();
// 
//     /**
//      * Returns the expected agreement of an annotation study. The expected agreement is the
//      * proportion of agreement that would be expected by chance alone. The expected agreement should
//      * be equal to the observed agreement if each rater makes a random decision for each unit.
//      */
//     public double calculateExpectedAgreement();
// }


// Path: dkpro-statistics-agreement/src/main/java/org/dkpro/statistics/agreement/coding/ScottPiAgreement.java
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.Map;
import org.dkpro.statistics.agreement.IChanceCorrectedAgreement;

/*
 * Copyright 2014
 * Ubiquitous Knowledge Processing (UKP) Lab
 * Technische Universität Darmstadt
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.dkpro.statistics.agreement.coding;



/**
 * Implementation of Scott's pi (1955) for calculating a chance-corrected inter-rater agreement for
 * two raters. The measure assumes the same probability distribution for all raters.<br>
 * <br>
 * References:
 * <ul>
 * <li>Artstein, R. &amp; Poesio, M.: Inter-Coder Agreement for Computational Linguistics.
 * Computational Linguistics 34(4):555-596, 2008.</li>
 * <li>Scott, W.A.: Reliability of content analysis: The case of nominal scale coding. Public
 * Opinion Quaterly 19(3):321-325, 1955.</li>
 * </ul>
 * 
 * @author Christian M. Meyer
 */
public class ScottPiAgreement
    extends CodingAgreementMeasure
    implements IChanceCorrectedAgreement