Skip to content

Commit

Permalink
Features:
Browse files Browse the repository at this point in the history
Bug Fixes/Re-organization:

Samples:

	- Spline Stretch Multi Segment Sequence Builder - Create Calibrated Estimator #1 (1)
	- Spline Stretch Multi Segment Sequence Builder - Create Calibrated Estimator #2 (2, 3, 4)
	- Spline Stretch Multi Segment Sequence Builder - Create Calibrated Estimator #3 (5, 6, 7)
	- Spline Stretch Multi Segment Sequence Builder - Create Regression Estimator (8, 9, 10)
	- Spline Tension KLK Hyperbolic Phy #1 (11, 12, 13)
	- Spline Tension KLK Hyperbolic Phy #2 (14, 15)
	- Spline Tension KLK Hyperbolic Phy - Constructor (16, 17, 18)
	- Spline Tension KLK Hyperbolic Phy - Evaluate (19, 20)
	- Spline Tension KLK Hyperbolic Phy - Derivative (21, 22)
	- Spline Tension KLK Hyperbolic Phy - Integrate (23, 24, 25)
	- Spline Tension KLK Hyperbolic Psy #1 (26, 27, 28)
	- Spline Tension KLK Hyperbolic Psy #2 (29, 30)
	- Spline Tension KLK Hyperbolic Psy - Constructor (31, 32)
	- Spline Tension KLK Hyperbolic Psy - Evaluate (33, 34)
	- Spline Tension KLK Hyperbolic Psy - Derivative (35, 36)
	- Spline Tension KLK Hyperbolic Psy - Integrate (37, 38, 39)
	- Spline Tension Koch Lyche Kvasov Basis (40, 41, 42)
	- Spline Tension Koch Lyche Kvasov Basis - Generate Monic BSpline Set (43, 44, 45)
	- Spline Tension Koch Lyche Kvasov Basis - Generate Quadratic BSpline Set (46, 47)
	- Spline Tension Koch Lyche Kvasov Family (48, 49, 50)
	- Spline Tension Koch Lyche Kvasov Family - From Hyperbolic Primitive #1 (51, 52, 53)
	- Spline Tension Koch Lyche Kvasov Family - From Hyperbolic Primitive #2 (54, 55, 56)
	- Spline Tension Koch Lyche Kvasov Family - From Hyperbolic Primitive #3 (57, 56, 59)
	- Spline Tension Koch Lyche Kvasov Family - From Hyperbolic Primitive #4 (60)


IdeaDRIP:
  • Loading branch information
Lakshmik committed Jan 15, 2024
1 parent 5371dd8 commit 4896983
Show file tree
Hide file tree
Showing 7 changed files with 400 additions and 315 deletions.
34 changes: 34 additions & 0 deletions ReleaseNotes/05_11_2023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Features:

Bug Fixes/Re-organization:

Samples:

- Spline Stretch Multi Segment Sequence Builder - Create Calibrated Estimator #1 (1)
- Spline Stretch Multi Segment Sequence Builder - Create Calibrated Estimator #2 (2, 3, 4)
- Spline Stretch Multi Segment Sequence Builder - Create Calibrated Estimator #3 (5, 6, 7)
- Spline Stretch Multi Segment Sequence Builder - Create Regression Estimator (8, 9, 10)
- Spline Tension KLK Hyperbolic Phy #1 (11, 12, 13)
- Spline Tension KLK Hyperbolic Phy #2 (14, 15)
- Spline Tension KLK Hyperbolic Phy - Constructor (16, 17, 18)
- Spline Tension KLK Hyperbolic Phy - Evaluate (19, 20)
- Spline Tension KLK Hyperbolic Phy - Derivative (21, 22)
- Spline Tension KLK Hyperbolic Phy - Integrate (23, 24, 25)
- Spline Tension KLK Hyperbolic Psy #1 (26, 27, 28)
- Spline Tension KLK Hyperbolic Psy #2 (29, 30)
- Spline Tension KLK Hyperbolic Psy - Constructor (31, 32)
- Spline Tension KLK Hyperbolic Psy - Evaluate (33, 34)
- Spline Tension KLK Hyperbolic Psy - Derivative (35, 36)
- Spline Tension KLK Hyperbolic Psy - Integrate (37, 38, 39)
- Spline Tension Koch Lyche Kvasov Basis (40, 41, 42)
- Spline Tension Koch Lyche Kvasov Basis - Generate Monic BSpline Set (43, 44, 45)
- Spline Tension Koch Lyche Kvasov Basis - Generate Quadratic BSpline Set (46, 47)
- Spline Tension Koch Lyche Kvasov Family (48, 49, 50)
- Spline Tension Koch Lyche Kvasov Family - From Hyperbolic Primitive #1 (51, 52, 53)
- Spline Tension Koch Lyche Kvasov Family - From Hyperbolic Primitive #2 (54, 55, 56)
- Spline Tension Koch Lyche Kvasov Family - From Hyperbolic Primitive #3 (57, 56, 59)
- Spline Tension Koch Lyche Kvasov Family - From Hyperbolic Primitive #4 (60)


IdeaDRIP:
Binary file modified ScheduleSheet.xlsx
Binary file not shown.
163 changes: 96 additions & 67 deletions src/main/java/org/drip/spline/stretch/MultiSegmentSequenceBuilder.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

package org.drip.spline.stretch;

import org.drip.numerical.common.NumberUtil;
import org.drip.spline.basis.ExponentialMixtureSetParams;
import org.drip.spline.basis.ExponentialRationalSetParams;
import org.drip.spline.basis.ExponentialTensionSetParams;
Expand Down Expand Up @@ -615,108 +616,136 @@ public static final MultiSegmentSequence CreateCalibratedStretchEstimator (
* Create a calibrated Stretch Instance over the specified Predictor Ordinates and the Response Value
* Constraints, with the Segment Builder Parameters.
*
* @param strName Name of the Stretch
* @param adblPredictorOrdinate Predictor Ordinate Array
* @param srvcStretchLeft Stretch Left Constraint
* @param aSRVC Array of Segment Constraints - One per Segment
* @param aSCBC Array of Segment Builder Parameters - One per Segment
* @param sbfr Stretch Fitness Weighted Response
* @param bs The Calibration Boundary Condition
* @param iCalibrationDetail The Calibration Detail
* @param name Name of the Stretch
* @param predictorOrdinateArray Predictor Ordinate Array
* @param stretchLeftSegmentResponseValueConstraint Stretch Left Constraint
* @param segmentResponseValueConstraintArray Array of Response Value Constraints - One per Segment
* @param segmentCustomBuilderControlArray Array of Segment Builder Parameters - One per Segment
* @param stretchBestFitResponse Stretch Fitness Weighted Response
* @param boundarySettings The Calibration Boundary Condition
* @param calibrationDetail The Calibration Detail
*
* @return Stretch Instance
*/

public static final org.drip.spline.stretch.MultiSegmentSequence CreateCalibratedStretchEstimator (
final java.lang.String strName,
final double[] adblPredictorOrdinate,
final org.drip.spline.params.SegmentResponseValueConstraint srvcStretchLeft,
final org.drip.spline.params.SegmentResponseValueConstraint[] aSRVC,
final org.drip.spline.params.SegmentCustomBuilderControl[] aSCBC,
final org.drip.spline.params.StretchBestFitResponse sbfr,
final org.drip.spline.stretch.BoundarySettings bs,
final int iCalibrationDetail)
public static final MultiSegmentSequence CreateCalibratedStretchEstimator (
final String name,
final double[] predictorOrdinateArray,
final SegmentResponseValueConstraint stretchLeftSegmentResponseValueConstraint,
final SegmentResponseValueConstraint[] segmentResponseValueConstraintArray,
final SegmentCustomBuilderControl[] segmentCustomBuilderControlArray,
final StretchBestFitResponse stretchBestFitResponse,
final BoundarySettings boundarySettings,
final int calibrationDetail)
{
org.drip.spline.stretch.MultiSegmentSequence mss = CreateUncalibratedStretchEstimator (strName,
adblPredictorOrdinate, aSCBC);
MultiSegmentSequence multiSegmentSequence = CreateUncalibratedStretchEstimator (
name,
predictorOrdinateArray,
segmentCustomBuilderControlArray
);

return null == mss ? null : mss.setup (srvcStretchLeft, aSRVC, sbfr, bs, iCalibrationDetail) ? mss :
null;
return null == multiSegmentSequence ? null : multiSegmentSequence.setup (
stretchLeftSegmentResponseValueConstraint,
segmentResponseValueConstraintArray,
stretchBestFitResponse,
boundarySettings,
calibrationDetail
) ? multiSegmentSequence : null;
}

/**
* Create a Calibrated Stretch Instance from the Array of Predictor Ordinates and a flat Response Value
*
* @param strName Name of the Stretch
* @param adblPredictorOrdinate Predictor Ordinate Array
* @param dblResponseValue Response Value
* @param scbc Segment Builder Parameters - One per Segment
* @param sbfr Stretch Fitness Weighted Response
* @param bs The Calibration Boundary Condition
* @param iCalibrationDetail The Calibration Detail
* @param name Name of the Stretch
* @param predictorOrdinateArray Predictor Ordinate Array
* @param responseValue Response Value
* @param segmentCustomBuilderControl Segment Builder Parameters
* @param stretchBestFitResponse Stretch Fitness Weighted Response
* @param boundarySettings The Calibration Boundary Condition
* @param calibrationDetail The Calibration Detail
*
* @return Stretch Instance
*/

public static final org.drip.spline.stretch.MultiSegmentSequence CreateCalibratedStretchEstimator (
final java.lang.String strName,
final double[] adblPredictorOrdinate,
final double dblResponseValue,
final org.drip.spline.params.SegmentCustomBuilderControl scbc,
final org.drip.spline.params.StretchBestFitResponse sbfr,
final org.drip.spline.stretch.BoundarySettings bs,
final int iCalibrationDetail)
public static final MultiSegmentSequence CreateCalibratedStretchEstimator (
final String name,
final double[] predictorOrdinateArray,
final double responseValue,
final SegmentCustomBuilderControl segmentCustomBuilderControl,
final StretchBestFitResponse stretchBestFitResponse,
final BoundarySettings boundarySettings,
final int calibrationDetail)
{
if (!org.drip.numerical.common.NumberUtil.IsValid (dblResponseValue) || null == adblPredictorOrdinate ||
null == scbc)
if (!NumberUtil.IsValid (responseValue) ||
null == predictorOrdinateArray ||
null == segmentCustomBuilderControl) {
return null;
}

int iNumPredictorOrdinate = adblPredictorOrdinate.length;
int predictorOrdinateCount = predictorOrdinateArray.length;

if (1 >= iNumPredictorOrdinate) return null;
if (1 >= predictorOrdinateCount) {
return null;
}

double[] adblResponseValue = new double[iNumPredictorOrdinate];
org.drip.spline.params.SegmentCustomBuilderControl[] aSCBC = new
org.drip.spline.params.SegmentCustomBuilderControl[iNumPredictorOrdinate - 1];
double[] responseValueArray = new double[predictorOrdinateCount];
SegmentCustomBuilderControl[] segmentCustomBuilderControlArray =
new SegmentCustomBuilderControl[predictorOrdinateCount - 1];

for (int i = 0; i < iNumPredictorOrdinate; ++i) {
adblResponseValue[i] = dblResponseValue;
for (int predictorOrdinateIndex = 0; predictorOrdinateIndex < predictorOrdinateCount;
++predictorOrdinateIndex) {
responseValueArray[predictorOrdinateIndex] = responseValue;

if (0 != i) aSCBC[i - 1] = scbc;
if (0 != predictorOrdinateIndex) {
segmentCustomBuilderControlArray[predictorOrdinateIndex - 1] = segmentCustomBuilderControl;
}
}

return CreateCalibratedStretchEstimator (strName, adblPredictorOrdinate, adblResponseValue, aSCBC,
sbfr, bs, iCalibrationDetail);
return CreateCalibratedStretchEstimator (
name,
predictorOrdinateArray,
responseValueArray,
segmentCustomBuilderControlArray,
stretchBestFitResponse,
boundarySettings,
calibrationDetail
);
}

/**
* Create a Regression Spline Instance over the specified array of Predictor Ordinate Knot Points and the
* Set of the Points to be Best Fit.
* <li>Create a Regression Spline Instance over the specified array of Predictor Ordinate Knot Points and the Set of the Points to be Best Fit</li>
*
* @param strName Name of the Stretch
* @param adblKnotPredictorOrdinate Array of the Predictor Ordinate Knots
* @param aSCBC Array of Segment Builder Parameters
* @param sbfr Stretch Fitness Weighted Response
* @param bs The Calibration Boundary Condition
* @param iCalibrationDetail The Calibration Detail
* @param name Name of the Stretch
* @param knotPredictorOrdinateArray Array of the Predictor Ordinate Knots
* @param segmentCustomBuilderControlArray Array of Segment Builder Parameters
* @param stretchBestFitResponse Stretch Fitness Weighted Response
* @param boundarySettings The Calibration Boundary Condition
* @param calibrationDetail The Calibration Detail
*
* @return Stretch instance
*/

public static final org.drip.spline.stretch.MultiSegmentSequence CreateRegressionSplineEstimator (
final java.lang.String strName,
final double[] adblKnotPredictorOrdinate,
final org.drip.spline.params.SegmentCustomBuilderControl[] aSCBC,
final org.drip.spline.params.StretchBestFitResponse sbfr,
final org.drip.spline.stretch.BoundarySettings bs,
final int iCalibrationDetail)
public static final MultiSegmentSequence CreateRegressionSplineEstimator (
final String name,
final double[] knotPredictorOrdinateArray,
final SegmentCustomBuilderControl[] segmentCustomBuilderControlArray,
final StretchBestFitResponse stretchBestFitResponse,
final BoundarySettings boundarySettings,
final int calibrationDetail)
{
org.drip.spline.stretch.MultiSegmentSequence mss = CreateUncalibratedStretchEstimator (strName,
adblKnotPredictorOrdinate, aSCBC);

if (null == mss) return null;
MultiSegmentSequence multiSegmentSequence = CreateUncalibratedStretchEstimator (
name,
knotPredictorOrdinateArray,
segmentCustomBuilderControlArray
);

return mss.setup (null, null, sbfr, bs, iCalibrationDetail) ? mss : null;
return null == multiSegmentSequence ? null : multiSegmentSequence.setup (
null,
null,
stretchBestFitResponse,
boundarySettings,
calibrationDetail
) ? multiSegmentSequence : null;
}
}
Loading

0 comments on commit 4896983

Please sign in to comment.