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

net.finmath.marketdata.model.curves.locallinearregression.Partition Maven / Gradle / Ivy

Go to download

finmath lib is a Mathematical Finance Library in Java. It provides algorithms and methodologies related to mathematical finance.

There is a newer version: 6.0.19
Show newest version
/*
 * (c) Copyright finmath.net, Germany. Contact: [email protected].
 *
 * Created on 01.06.2018
 */
package net.finmath.marketdata.model.curves.locallinearregression;

import java.util.Arrays;

/**
 * This class represents a set of discrete points in time with weighted interval reference points.
 *
 * @author Moritz Scherrmann
 * @version 1.0
 */
public class Partition {

	private final double[] points;
	private final double weight;
	private final double[] referencePoints;

	/**
	 * Creates a partition.
	 *
	 * @param points The points of the partition. It should be kept in mind that no point should be included twice.
	 *               There is no need to take care of the order of the points.
	 * @param weight The weight if the partition as double. It is needed to compute the reference points.
	 */
	public Partition(
			final double[] points,
			final double weight
			){
		this.points=points;
		this.weight=weight;
		Arrays.sort(this.points);
		referencePoints=new double[points.length-1];
		for(int i=0; i=points[points.length-1]) {
			return points.length;
		}
		for(int i=0; i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy