File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,31 @@ where
167167 integral
168168}
169169
170- ///
170+ // Fractional Lévy Ornstein-Uhlenbeck inner product function (Unstable)
171+ // https://projecteuclid.org/journals/bernoulli/volume-17/issue-1/Fractional-L%C3%A9vy-driven-OrnsteinUhlenbeck-processes-and-stochastic-differential-equations/10.3150/10-BEJ281.pdf
172+ fn cov_ld ( t : f64 , s : f64 , d : f64 , e_l1_squared : f64 ) -> f64 {
173+ if d <= 0.0 || d >= 1.0 {
174+ panic ! ( "The 'd' parameter must be in the range (0, 1)." ) ;
175+ }
176+
177+ let gamma_term = gamma ( 2.0 * d + 2.0 ) ;
178+ let sin_term = ( ( std:: f64:: consts:: PI * ( d + 0.5 ) ) . sin ( ) ) . abs ( ) ; // Biztosítjuk, hogy pozitív legyen
179+ let denominator = 2.0 * gamma_term * sin_term;
180+
181+ // Ellenőrizzük, hogy a nevező nem nulla
182+ if denominator == 0.0 {
183+ panic ! ( "The denominator is zero." ) ;
184+ }
185+
186+ let t_term = t. abs ( ) . powf ( 2.0 * d + 1.0 ) ;
187+ let s_term = s. abs ( ) . powf ( 2.0 * d + 1.0 ) ;
188+ let ts_term = ( t - s) . abs ( ) . powf ( 2.0 * d + 1.0 ) ;
189+
190+ let covariance = ( e_l1_squared / denominator) * ( t_term + s_term - ts_term) ;
191+
192+ covariance
193+ }
194+
171195#[ cfg( test) ]
172196mod tests {
173197 use super :: * ;
You can’t perform that action at this time.
0 commit comments