Tag: Represents the decimal point time POW var function related 5.6 decimals
The general formula for the self-covariance function of 1 samples is as follows:
2 in fact, the autocorrelation function to be computed later can also be expressed as self-covariance:
1TimeSeries = [11.67602657, 5.637492979, 1.375516942, 0.618705492,-0.152047234,-0.508555434,-6.065288121,- 9.417602801, 2-10.47205437,-8.018063902, 0.523277554, 4.86893283, 4.23977562,-10.2344375,-3.463362573, 36.51326577, 3-8.518370963,-15.37474905,-7.687911176, 4.818978874, 7.876681639, 1.763788865]4Zt = []5Lzt = []6Autocovariance = []7 #the self-covariance is saved as a list, showing the following format:8 #[γ0,γ1,γ2,γ3,....]9 #[Γk,....] K = 0,1,2,3 ....TenTotal =0 Onei = 1 A whileI <Len (TimeSeries): -L =timeseries[i::] -LL = timeseries[:-I:] theTotal = Total + timeseries[i-1] - zt.append (L) - lzt.append (LL) -i + = 1 +Total = Total + timeseries[-1] -AVG = Total/Len (TimeSeries) + AK =0 atResult_temp0 =0 - #First, we ask for the value of γ0 - whileK <Len (TimeSeries): -Result_temp0 = result_temp0 + POW ((Timeseries[k]-avg), 2) -K + = 1 - autocovariance.append (result_temp0) in Print(autocovariance) - #Show Results: to #[2418.4380925669107] + - #then calculate the molecule thep =0 *Q =0 $ whileP <Len (Zt):Panax NotoginsengQ =0 -RESULT_TEMP1 =0 the whileQ <Len (zt[p]): +RESULT_TEMP1 = Result_temp1 + (Zt[p][q]-avg) * (Lzt[p][q]-avg) AQ + = 1 theAutocovariance.append (RESULT_TEMP1)#keep three digits after the decimal point +p + = 1 - Print(autocovariance) $ Print(Len (autocovariance)) $ #Show Results: - #[2418.4380925669107, 154.73148259271665,-909.2825195711046,-216.01009095585525, 381.064309087456, 253.8899860047866, - #-455.76866093122146,-513.7425279639118,-234.77764765735802, 51.726042700512416, 266.05419016606146, 116.26795577123028, the #-76.63272849007276,-209.6990237967077, 78.50856193561651, 336.9664948029677,-195.8237009651655,- 211.6227696432054, -50.67152070500246, - #103.09738426011762, 101.91169142979405, 20.59404564489024]
Measurement Economics and Time series _ self-covariance (autocovariance) algorithm parsing (Python)