All Downloads are FREE. Search and download functionalities are using the official Maven repository.

repicea.stats.model.glm.copula.CopulaExpression Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
/*
 * This file is part of the repicea-statistics library.
 *
 * Copyright (C) 2009-2012 Mathieu Fortin for Rouge-Epicea
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This library is distributed with 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 GNU Lesser General Public
 * License for more details.
 *
 * Please see the license at http://www.gnu.org/copyleft/lesser.html.
 */
package repicea.stats.model.glm.copula;

import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

import repicea.math.AbstractMathematicalFunctionWrapper;
import repicea.math.Matrix;
import repicea.stats.LinearStatisticalExpression;
import repicea.stats.data.HierarchicalStatisticalDataStructure;
import repicea.stats.data.StatisticalDataException;
import repicea.stats.model.StatisticalModel;


/**
 * This class is a basic class for all the copula expressions contained in the CopulaLibrary class.
 * @author Mathieu Fortin - October 2011
 */
@SuppressWarnings("serial")
public abstract class CopulaExpression extends AbstractMathematicalFunctionWrapper {
	
	protected List levels = new ArrayList();
	
	protected CopulaExpression(String hierarchicalLevels) {
		super(new LinearStatisticalExpression());
		StringTokenizer tkz = new StringTokenizer(hierarchicalLevels, "/");
		for (int i = 0; i < tkz.countTokens(); i++) {
			levels.add(tkz.nextToken().trim());
		}
	}

	@Override
	public LinearStatisticalExpression getOriginalFunction() {return (LinearStatisticalExpression) super.getOriginalFunction();}
	
	protected List getHierarchicalLevelSpecifications() {return levels;}
	
	protected abstract void setX(int indexFirstObservation, int indexSecondObservation);
	
	protected void initialize(StatisticalModel model, HierarchicalStatisticalDataStructure data) throws StatisticalDataException {
		data.setHierarchicalStructureLevel(levels);
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy