Package com.polytechnik.freemoney
Class WIntegrator
java.lang.Object
com.polytechnik.freemoney.WIntegrator
- Direct Known Subclasses:
WIntegratorLaguerre
,WIntegratorLegendreShifted
,WIntegratorMonomials
A simple accumulator with integration.
Subclasses contain recurrent code for fast calculation of the moments.
Basis recurrence relations used in
WIntegratorMonomials
correspond to QVMData
,
WIntegratorLaguerre
correspond to QVMDataL
, and
WIntegratorLegendreShifted
correspond to QVMDataP
.-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal double
Time scale of integration measure.long
The time the moments are calculated on.final double[][]
Integration moments.final int
Timeseries number.final int
The number of moments <fQk> to calculate, k=0 … ntm-1.final double[]
The sum[i] is the sum of all posted Fdt[i]. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSingleObservation
(long currenttime, long t, double[] Fdt) Add a single observation at time t to all stored series.abstract void
addSingleObservationToSomeObservables
(long currenttime, long t, double[] Fdt, int staringSerieIndex) Add a single observation at time t to a range of stored series.abstract double
getXFromTime
(long currenttime, long t) Used internally to calculate basis function argument.abstract void
updateSavedMomentsToNewTimeReference
(long currenttime) The method shifts basis functions offset as the time progresses.
-
Field Details
-
currenttime_previous
public long currenttime_previousThe time the moments are calculated on. -
ntm
public final int ntmThe number of moments <fQk> to calculate, k=0 … ntm-1. -
nobservables
public final int nobservablesTimeseries number. -
atau
public final double atauTime scale of integration measure. -
integration_moments
public final double[][] integration_momentsIntegration moments. The integration_moments[i][k] is the Fdt[i]--th moments <F[i]Qk>. -
sum
public final double[] sumThe sum[i] is the sum of all posted Fdt[i].
-
-
Constructor Details
-
WIntegrator
public WIntegrator(int ntm, double atau, int nobservables) - Parameters:
ntm
- The number of moments to caclucate.atau
- Time scale.nobservables
- The number of observables.
-
-
Method Details
-
getXFromTime
public abstract double getXFromTime(long currenttime, long t) Used internally to calculate basis function argument. -
updateSavedMomentsToNewTimeReference
public abstract void updateSavedMomentsToNewTimeReference(long currenttime) The method shifts basis functions offset as the time progresses. -
addSingleObservation
public void addSingleObservation(long currenttime, long t, double[] Fdt) Add a single observation at time t to all stored series. No basis time-shift is performed, theupdateSavedMomentsToNewTimeReference(long)
should be called separately.- Parameters:
currenttime
- Current time.t
- Event time.Fdt
- All observables, array dimension must be equal to thenobservables
.
-
addSingleObservationToSomeObservables
public abstract void addSingleObservationToSomeObservables(long currenttime, long t, double[] Fdt, int staringSerieIndex) Add a single observation at time t to a range of stored series. No basis time-shift is performed, theupdateSavedMomentsToNewTimeReference(long)
should be called separately.- Parameters:
currenttime
- Current time.t
- Event time.Fdt
- The observables, to be added starting with staringSerieIndex (inclusive).staringSerieIndex
- The serie index, the data will be added tointegration_moments
[staringSerieIndex]..integration_moments
[staringSerieIndex+Fdt.length-1].
-