Time series data fitting method and device, equipment, storage medium and product

Through basis function combination matching and fitting curve, the problem of computational efficiency and accuracy imbalance in time series fitting is solved, and efficient and accurate historical data fitting of galaxy star formation rate is achieved, which is suitable for big data analysis.

CN118568406APending Publication Date: 2024-08-30PENG CHENG LAB
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410680630.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing time series fitting methods cannot achieve a balance between computational efficiency and computational accuracy. Especially in the analysis of historical data on galaxy star formation rates, parametric methods have lower accuracy and non-parametric methods have long calculation times and poor interpretability. .

Method used

By obtaining one-dimensional time series data and a preset number of basis functions, component decomposition and fitting are performed, the best fitting curve is judged based on the goodness of fit, and a combination of basis functions is used to match the fitting curve, solving the problem of parametric fitting. problems with lower accuracy while retaining the advantages of computational efficiency.

Benefits of technology

It achieves efficient and accurate time series fitting, which can meet the needs of big data analysis, and fully considers the fitting goodness of local and global data during the fitting process, so that the final fitting result can characterize data at different time scales.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568406A
    Figure CN118568406A
Patent Text Reader

Abstract

The invention discloses a time series data fitting method and device, equipment, a storage medium and a product, and relates to the technical field of data processing, and the time series data fitting method comprises the steps: obtaining one-dimensional time series data and a preset number of primary functions; performing component decomposition and fitting on the one-dimensional time sequence data through each primary function to obtain a data fitting result containing different quantities of primary functions; and based on the goodness of fit of each data fitting result, judging an optimal fitting curve in the fitting results to obtain a final fitting result. The fitting efficiency and precision of the data set curve are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a time series data fitting method, device, equipment, storage medium and computer program product. Background Art

[0002] In a large number of scientific studies, it is necessary to record the changes of specific physical quantities over time and conduct research and analysis. In the field of galaxy formation and evolution research, one-dimensional time series such as the history of star formation rates of galaxies are important research objects.

[0003] In order to verify the star formation history model, researchers need to study the star formation rate of galaxies at various time points from the data simulating the formation and evolution of galaxies, that is, the historical curve of the star formation rate, and analyze its characteristics. This process involves curve fitting of the historical data of the star formation rate of galaxies. The current curve fitting methods mainly include parametric methods and non-parametric methods. The non-parametric method is superior to the parametric method in flexibility and accuracy. The disadvantage is that it requires a lot of computing time, and its physical interpretation is poor due to the large parameter space. In other words, the previous one-dimensional time series fitting method cannot achieve a good balance between computational efficiency and computational accuracy.

[0004] Therefore, how to provide an efficient and accurate fitting simulation method is a problem that needs to be solved urgently.

[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The main purpose of the present application is to provide a time series data fitting method, device, equipment, storage medium and computer program product, aiming to solve the technical problem in the related art that the time series fitting methods using parametric methods and non-parametric methods cannot take into account both computational efficiency and computational accuracy.

[0007] To achieve the above purpose, the present application proposes a time series data fitting method, which includes:

[0008] Get one-dimensional time series data and a preset number of basis functions;

[0009] Performing component decomposition and fitting on the one-dimensional time series data through each of the basis functions to obtain data fitting results containing different numbers of basis functions;

[0010] Based on the goodness of fit of each of the data fitting results, the best fitting curve in the fitting results is determined to obtain a final fitting result.

[0011] In one embodiment, the one-dimensional time series data is subjected to component decomposition and fitting by each of the basis functions to obtain fitting results containing different numbers of basis functions, including:

[0012] Performing component decomposition processing on the one-dimensional time series data for a preset number of times to obtain a plurality of single-component data;

[0013] For the single component data obtained by each decomposition, a single basis function is used to perform fitting processing to obtain multiple single component fitting results;

[0014] The single component fitting results are combined to obtain an overall fitting result;

[0015] The overall fitting result is subjected to curve fitting with a preset initial condition to obtain a data fitting result containing different numbers of basis functions, wherein the preset initial condition includes parameters of each basis function in the overall fitting result.

[0016] In one embodiment, the data fitting result and the single component fitting result are obtained by fitting based on the least squares method.

[0017] In one embodiment, the step of determining the best fitting curve in the fitting results based on the goodness of fit of each of the data fitting results to obtain the final fitting result includes:

[0018] Subtracting the previous N-minus-1 single-component fitting curve from the one-dimensional time series data to obtain the current time series to be fitted, where N is the sequence number of the current fitting component;

[0019] Based on the time series to be fitted, determining a global time series to be fitted;

[0020] Performing fitting tests on the global time series to be fitted by using different types of basis functions to obtain a plurality of first test results;

[0021] Selecting the first test result corresponding to the best goodness of fit as the best global fit of the Nth component;

[0022] Based on the time series to be fitted, the data within the time interception window range on both sides are intercepted with the maximum value moment as the center to obtain the local time series to be fitted;

[0023] Performing fitting tests on the local time series to be fitted by using different types of basis functions to obtain multiple second test results, and selecting the second test result corresponding to the best goodness of fit as the best global fit of the Nth component;

[0024] Based on the best global fit of the Nth component and the best local fit of the Nth component, the fitting result with the best goodness of fit is selected as the final single-component fitting result.

[0025] In one embodiment, the step of determining the best fitting curve in the fitting results based on the goodness of fit of each of the data fitting results to obtain the final fitting result includes:

[0026] Based on the goodness of fit of each of the data fitting results, determine the best fitting curve in the fitting results to obtain a final fitting result;

[0027] The goodness of fit is expressed as follows:

[0028]

[0029] Among them, R 2 Indicates the degree of fit of the fitting result, R 2 The larger the value, the better the fitting degree. i is the data point number, k is the number of data points, and y fit,i is the value of the i-th data point of the fitted curve, y i is the value of the i-th data point of the time series to be fitted, is the average value of all data points in the time series to be fitted.

[0030] In one embodiment, the basis functions include a Gaussian distribution function, a gamma distribution function, a lognormal distribution function, and an exponential function.

[0031] In addition, to achieve the above purpose, the present application also proposes a time series data fitting device, the time series data fitting device comprising:

[0032] An acquisition module, used to acquire one-dimensional time series data and a preset number of basis functions;

[0033] A fitting module, used for performing component decomposition and fitting on the one-dimensional time series data through each of the basis functions to obtain data fitting results containing different numbers of basis functions;

[0034] The judgment module is used to judge the best fitting curve in the fitting results based on the goodness of fit of each of the data fitting results to obtain a final fitting result.

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a time series data fitting device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the time series data fitting method as described above.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the time series data fitting method described above are implemented.

[0037] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the time series data fitting method described above.

[0038] The present application proposes a fitting method, device, equipment, storage medium and computer program product for time series data. The present application obtains one-dimensional time series data and a preset number of basis functions; decomposes and fits the one-dimensional time series data by each basis function to obtain a data fitting result containing different numbers of basis functions; based on the goodness of fit of each data fitting result, the best fitting curve in the fitting result is judged to obtain the final fitting result. In the present application, the fitting curve is matched by combining basis functions, which solves the problem of low accuracy of parameterized fitting and retains its advantage of high computational efficiency, which can meet the needs of future big data analysis. At the same time, the goodness of fit of the fitting function for local data and global data is fully considered in the fitting process, so that the final fitting result can simultaneously characterize data of different time scales.

[0039] In summary, the present application matches the fitting curve through a combination of basis functions, thereby solving the problem of low accuracy of parameterized fitting and retaining its advantage of high computational efficiency, which can meet the needs of future big data analysis. At the same time, the goodness of fit of the fitting function for local data and global data is fully considered during the fitting process, so that the final fitting result can simultaneously characterize data of different time scales. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 A schematic diagram of a flow chart provided for the first embodiment of the method for fitting time series data of the present application;

[0043] Figure 2A flow chart of the second embodiment of the method for fitting time series data of the present application;

[0044] Figure 3 A flow chart of the third embodiment of the method for fitting time series data of the present application;

[0045] Figure 4 This is a schematic diagram of the module structure of a fitting device for time series data according to an embodiment of the present application;

[0046] Figure 5 A schematic diagram of the system structure of a time series data fitting device according to an embodiment of the present application;

[0047] Figure 6 A schematic diagram of the star formation rate history of a galaxy and its fitting results involved in the time series data fitting method in the embodiment of the present application;

[0048] Figure 7 A schematic diagram of the fitting simulation results of a simulated galaxy involved in the time series data fitting method in an embodiment of the present application.

[0049] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0050] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0051] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0052] The main solutions of the embodiments of this application are:

[0053] Get one-dimensional time series data and a preset number of basis functions;

[0054] Performing component decomposition and fitting on the one-dimensional time series data through each of the basis functions to obtain data fitting results containing different numbers of basis functions;

[0055] Based on the goodness of fit of each of the data fitting results, the best fitting curve in the fitting results is determined to obtain a final fitting result.

[0056] In this embodiment, for the convenience of description, the following description is made by taking the time series data fitting device as the execution subject.

[0057] In the prior art, the commonly used methods for fitting the history of star formation rate include parametric methods and non-parametric methods. The parametric method assumes that the star formation history conforms to a certain fixed function form, such as exponential rise and fall, lognormal distribution, gamma distribution, Gaussian distribution, Bessel function, etc. Its advantages are simple concept, convenient calculation, and easy explanation of its physical drive. The disadvantage is that the single function form is too simple and may not conform to the actual shape of the star formation history curve, which will cause the star formation history fitting curve to be over-smoothed and deviated. The non-parametric method does not preset a specific fitting function form, but uses piecewise function, polynomial expansion, Gaussian process regression and other methods to fit the data. The non-parametric method is superior to the parametric method in flexibility and accuracy. The disadvantage is that it requires a lot of calculation time and its physical interpretation is poor due to the large parameter space.

[0058] The present application provides a fitting method for time series data, which matches the fitting curve through a combination of basis functions, solves the problem of low parameterized fitting accuracy, and retains its advantage of high computational efficiency, which can meet the needs of future big data analysis. At the same time, in the fitting process, the fitting goodness of the fitting function for local data and global data is fully considered, so that the final fitting result can simultaneously characterize data of different time scales.

[0059] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a time series data fitting device, etc. The following takes the time series data fitting device as an example to illustrate this embodiment and the following embodiments.

[0060] Based on this, the present application embodiment provides a time series data fitting method, referring to Figure 1 , Figure 1 Schematic diagram of the flow chart of the first embodiment of the time series data fitting method of the present application.

[0061] In this embodiment, the time series data fitting method includes steps S10 to S30:

[0062] Step S10, obtaining one-dimensional time series data and a preset number of basis functions;

[0063] It should be noted that one-dimensional time series data can be time series data for calculating the motion process and property change process of a large number of simulated particles, where all information of each particle is recorded in the simulation output file, including: position, velocity, metallicity, luminosity, feedback intensity, formation time, etc. Find all particles in the simulated galaxy, read the data of their formation time, and obtain the age information of each particle.

[0064] Specifically, the age distribution of all particles was statistically analyzed by partitioning them into time intervals of 100 million years (100Myr);

[0065] The total mass of all particles with ages between t-100Myr and t is divided by 100Myr to obtain the star formation rate SFR(t) at time t. More specifically,

[0066]

[0067] Among them, M * is the stellar mass of the galaxy.

[0068] The star formation rate SFR(t) is calculated from t = 0 to t = 13600 Myr with a time interval of 100 million years (100 Myr) at each time point.

[0069] It should be noted that the basis functions include Gaussian distribution function, gamma distribution function, lognormal distribution function and exponential function. The time series data are fitted through various basis functions, which retains the calculation power of each basis function while also retaining the accuracy of these functions.

[0070] It should be noted that the preset number can be 5, 10, 15, etc., and can be changed according to user needs without specific limitation.

[0071] In a feasible implementation manner, the basis functions include a Gaussian distribution function, a gamma distribution function, a lognormal distribution function, and an exponential function.

[0072] Step S20, performing component decomposition and fitting on the one-dimensional time series data through each of the basis functions to obtain data fitting results containing different numbers of basis functions;

[0073] It should be noted that each time a basis function number Nc is selected, the corresponding best fitting curve is calculated.

[0074] More specifically, in this embodiment, N c For cases 1, 2, 3, 4, 5, and 6, the fitting curves were obtained respectively.

[0075] It should be noted that when performing data fitting, each decomposed one-dimensional time series data is fitted one by one through each basis function. After obtaining different fitting results, the optimal fitting curve is selected to ensure the calculation accuracy of the fitting curve.

[0076] Step S30, based on the goodness of fit of each of the data fitting results, determining the best fitting curve in the fitting results to obtain a final fitting result;

[0077] It should be noted that in this embodiment, 6 fitting curves were obtained. Select the fitting curve with the best goodness of fit as the final fitting curve Right now

[0078] The present application proposes a fitting method, device, equipment, storage medium and computer program product for time series data. The present application obtains one-dimensional time series data and a preset number of basis functions; decomposes and fits the one-dimensional time series data by each basis function to obtain a data fitting result containing different numbers of basis functions; based on the goodness of fit of each data fitting result, the best fitting curve in the fitting result is judged to obtain the final fitting result. In the present application, the fitting curve is matched by combining basis functions, which solves the problem of low accuracy of parameterized fitting and retains its advantage of high computational efficiency, which can meet the needs of future big data analysis. At the same time, the goodness of fit of the fitting function for local data and global data is fully considered in the fitting process, so that the final fitting result can simultaneously characterize data of different time scales.

[0079] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , step S20 in the time series data fitting method further includes steps S21 to S24:

[0080] Step S21, performing component decomposition processing on the one-dimensional time series data for a preset number of times to obtain a plurality of single-component data;

[0081] It should be noted that since multiple basis functions are used to decompose the one-dimensional time series data into components, as many decomposition steps are required as there are functions.

[0082] It should be noted that the single-component data is obtained after component decomposition based on each basis function, and each single-component data corresponds to a basis function.

[0083] Step S22, for the single component data obtained by each decomposition, a single basis function is used to perform fitting processing to obtain multiple single component fitting results;

[0084] It should be noted that, for each single-component data obtained by decomposition, a basis function is used for fitting to obtain multiple single-component fitting results, which can be fitting curves or other results.

[0085] Specifically, based on the time series SFR(t) of the star formation rate history, Nc component decompositions are performed, and a single basis function is used to fit the single component obtained by each decomposition to obtain Nc single component fitting results, where the nth single component fitting result is recorded as

[0086] Step S23, merging the single component fitting results to obtain an overall fitting result;

[0087] It should be noted that the overall fitting result after merging is:

[0088]

[0089] Step S24, performing curve fitting on the overall fitting result with preset initial conditions to obtain data fitting results containing different numbers of basis functions, wherein the preset initial conditions include parameters of each basis function in the overall fitting result.

[0090] It should be noted that The data is the initial condition, and the SFR(t) is fitted again by the least squares method to obtain the best fitting curve of the star formation history when the number of basis functions is Nc.

[0091] The data fitting result and the single component fitting result are obtained by fitting based on the least squares method.

[0092] In this embodiment, one-dimensional time series data is decomposed into components, and a single basis function is used to fit each single component data obtained after decomposition. Then, the single component fitting results are merged to obtain an overall fitting result, which includes data fitting results of different numbers of basis functions, and the calculation accuracy and efficiency of each basis function are also retained in the overall fitting result.

[0093] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those of the above-mentioned first and second embodiments can refer to the above introduction, and will not be repeated later. Figure 3 , step S22 in the time series data fitting method further includes steps S221 to S227:

[0094] Step S221, subtracting the previous N minus 1 single component fitting curve from the one-dimensional time series data to obtain the current time series to be fitted, where N is the sequence number of the current fitting component;

[0095] It should be noted that the time series to be fitted is expressed as SFR n (t), specifically,

[0096]

[0097] Step S222, determining a global time series to be fitted based on the time series to be fitted;

[0098] It should be noted that all data in the time series to be fitted are taken as the global time series to be fitted.

[0099] Step S223, performing fitting tests on the global time series to be fitted by using different types of basis functions to obtain a plurality of first test results;

[0100] Step S224, selecting the first test result corresponding to the best goodness of fit as the best global fit of the Nth component;

[0101] It should be noted that based on the global time series y to be fitted global (t), different types of basis functions are used to perform fitting tests respectively, and the result with the best goodness of fit among all the fitting test results is selected as the best global fit of the nth component. More specifically, in the embodiment of the present application, two basis functions, Gaussian distribution and gamma distribution, are selected for fitting respectively, including the following three steps:

[0102] S2204: Use Gaussian distribution function to calculate y global (t) is fitted to obtain the fitting curve

[0103] S2205: Use the gamma distribution function to calculate y global (t) is fitted to obtain the fitting curve

[0104] S2206: From Select the goodness of fit R 2 The largest one is taken as the best global fitting curve of the current component More specifically,

[0105]

[0106] The calculation formula for the goodness of fit is:

[0107]

[0108] The calculation formula for the goodness of fit is:

[0109]

[0110] Step S225, based on the time series to be fitted, taking the time of maximum value as the center, intercepting the data within the time interception window on both sides to obtain a local time series to be fitted;

[0111] It should be noted that based on the data to be fitted SFR n (t), with its maximum star formation rate tpeak as the center, intercept the data within the range of dt on both sides as the local time series ylocal(t) to be fitted, where dt is the half-width of the time interception window that can be freely set, and dt is a positive natural number and is not greater than the time series SFR to be fitted n Half the length of (t).

[0112] Specifically, in this application example, the half-width of the interception window is selected to be 1 trillion years (1 Gyr), and

[0113] y local (t) = SFR n (t peak -1Gyr≤t≤t peak +1Gyr)

[0114] Step S226, performing fitting tests on the local time series to be fitted respectively by using different types of basis functions to obtain multiple second test results, and selecting the second test result corresponding to the best goodness of fit as the best global fit of the Nth component;

[0115] It should be noted that based on the local time series yloca to be fitted l (t), different types of basis functions are used to perform fitting tests respectively, and the result with the best goodness of fit among all the fitting test results is selected as the best global fit of the nth component. More specifically, in the embodiment of the present invention, two basis functions, Gaussian distribution and gamma distribution, are selected to perform fitting respectively, including the following three steps:

[0116] S2208: Use Gaussian distribution to fit ylocal(t) to obtain the fitting curve

[0117] S2209: Use gamma distribution to calculate y local (t) is fitted to obtain the fitting curve

[0118] S2210: From Select the goodness of fit R 2 The largest one is taken as the best local fitting curve of the current component More specifically,

[0119]

[0120] The calculation formula for the goodness of fit is:

[0121]

[0122] The calculation formula for the goodness of fit is:

[0123]

[0124] Step S227: Based on the best global fit of the Nth component and the best local fit of the Nth component, a fitting result with the best goodness of fit is selected as the final single-component fitting result.

[0125] It should be noted that, based on the best global fit of the nth component and the best local fit of the nth component, the fitting result with the best goodness of fit is selected as the final fitting result of this component decomposition and single component fitting. More specifically, Select the goodness of fit R 2 The largest one is taken as the best fitting curve of the current nth component. More specifically,

[0126]

[0127] In a feasible implementation manner, judging the best fitting curve in the fitting results based on the goodness of fit of each of the data fitting results to obtain the final fitting result includes:

[0128] Based on the best global fit of the Nth component and the best local fit of the Nth component, selecting the fitting result with the best goodness of fit as the final single-component fitting result;

[0129] The goodness of fit is expressed as follows:

[0130]

[0131] Among them, R 2 Indicates the degree of fit of the fitting result, R 2 The larger the value, the better the fitting degree. i is the data point number, k is the number of data points, and y fit,i is the value of the i-th data point of the fitted curve, y i is the value of the i-th data point of the time series to be fitted, is the average value of all data points in the time series to be fitted.

[0132] In this embodiment, each single component data is fitted based on each basis function, and then the best single component fitting result is selected by the goodness of fit, so as to obtain the best fitting result of each single component data.

[0133] For example, to help understand the implementation process of the time series data fitting method obtained in this embodiment, please refer to Figure 5 , Figure 5 A schematic diagram of the fitting simulation results of a simulated galaxy involved in the fitting method of time series data is provided, specifically:

[0134] Figure 5 Provides a simulation of a galaxy with a fraction N C =4. The solid line (labeled SFH) is the time series SFR(t) of the star formation rate history. The dotted line (labeled Fit SFH) is the best fitting curve when the number of basis functions is 4, corresponding to the result obtained in step S24. The dotted lines are the results of the 4th component decomposition and component fitting, corresponding to the results obtained in steps S2201 to S2211. The dotted lines labeled part 1, part 2, part 3, and part 4 correspond to the best fitting curves of components 1, 2, 3, and 4, respectively.

[0135] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the fitting method of the time series data of the present application. More forms of simple transformations based on this technical concept are all within the protection scope of the present application.

[0136] This application also provides a time series data fitting device, please refer to Figure 4 , the time series data fitting device comprises:

[0137] An acquisition module 10 is used to acquire one-dimensional time series data and a preset number of basis functions;

[0138] A fitting module 20, configured to perform component decomposition and fitting on the one-dimensional time series data through each of the basis functions to obtain data fitting results containing different numbers of basis functions;

[0139] The judgment module 30 is used to judge the best fitting curve in the fitting results based on the goodness of fit of each of the data fitting results to obtain a final fitting result.

[0140] Optionally, the fitting module includes:

[0141] A processing unit, used for performing a component decomposition process on the one-dimensional time series data for a preset number of times to obtain a plurality of single-component data;

[0142] A fitting processing unit, used for performing fitting processing using a single basis function on the single component data obtained by each decomposition to obtain multiple single component fitting results;

[0143] A merging unit, used to merge the single component fitting results to obtain an overall fitting result;

[0144] The curve fitting unit is used to perform curve fitting on the overall fitting result with a preset initial condition to obtain a data fitting result containing different numbers of basis functions, wherein the preset initial condition includes parameters of each basis function in the overall fitting result.

[0145] Optionally, the judging module includes:

[0146] A calculation unit, used for subtracting the previous N minus 1 single component fitting curve from the one-dimensional time series data to obtain the current time series to be fitted, wherein N is the sequence number of the current fitting component;

[0147] A determination unit, used for determining a global time series to be fitted based on the time series to be fitted;

[0148] A fitting test unit, used for performing fitting tests on the global time series to be fitted respectively through different types of basis functions to obtain a plurality of first test results;

[0149] A first selection unit, used for selecting the first test result corresponding to the best goodness of fit as the best global fit of the Nth component;

[0150] A cutting unit is used to cut the data within the time cutting window on both sides of the time series to be fitted, taking the time series with the maximum value as the center, to obtain a local time series to be fitted;

[0151] A second selection unit is used to perform fitting tests on the local time series to be fitted by using different types of basis functions, obtain multiple second test results, and select the second test result corresponding to the best goodness of fit as the best global fit of the Nth component;

[0152] The third selection unit is used to select the fitting result with the best goodness of fit as the final single-component fitting result based on the best global fit of the Nth component and the best local fit of the Nth component.

[0153] Optionally, the third selection unit includes:

[0154] A selection subunit is used to select a fitting result with the best goodness of fit as a final single component fitting result based on the best global fit of the Nth component and the best local fit of the Nth component;

[0155] The goodness of fit is expressed as follows:

[0156]

[0157] Among them, R 2 Indicates the degree of fit of the fitting result, R 2 The larger the value, the better the fitting degree. i is the data point number, k is the number of data points, and y fit,i is the value of the i-th data point of the fitted curve, y i is the value of the i-th data point of the time series to be fitted, is the average value of all data points in the time series to be fitted.

[0158] The time series data fitting device provided by the present application adopts the time series data fitting method in the above embodiment, which can solve the technical problem of time series data fitting. Compared with the prior art, the beneficial effects of the time series data fitting device provided by the present application are the same as the beneficial effects of the time series data fitting method provided by the above embodiment, and other technical features in the time series data fitting device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0159] The present application provides a time series data fitting device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the time series data fitting method in the above-mentioned embodiment one.

[0160] Reference below Figure 5 , which shows a schematic diagram of the structure of a time series data fitting device suitable for implementing the embodiment of the present application. The time series data fitting device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The fitting device for time series data shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0161] like Figure 5As shown, the time series data fitting device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the time series data fitting device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the time series data fitting device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a time series data fitting device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0162] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0163] The time series data fitting device provided by the present application adopts the time series data fitting method in the above embodiment, which can solve the technical problem of time series data fitting. Compared with the prior art, the beneficial effects of the time series data fitting device provided by the present application are the same as the beneficial effects of the time series data fitting method provided by the above embodiment, and other technical features in the time series data fitting device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0164] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0165] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0166] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the time series data fitting method in the above-mentioned embodiment.

[0167] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0168] The computer-readable storage medium may be included in the time series data fitting device; or may exist independently without being assembled into the time series data fitting device.

[0169] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the time series data fitting device, the time series data fitting device:

[0170] Get one-dimensional time series data and a preset number of basis functions;

[0171] Performing component decomposition and fitting on the one-dimensional time series data through each of the basis functions to obtain data fitting results containing different numbers of basis functions;

[0172] Based on the goodness of fit of each of the data fitting results, the best fitting curve in the fitting results is determined to obtain a final fitting result.

[0173] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0174] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0175] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0176] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned time series data fitting method, and can solve the technical problem of time series data fitting. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the time series data fitting method provided in the above-mentioned embodiment, and will not be repeated here.

[0177] The present application also provides a computer program product, including a computer program, which implements the steps of the time series data fitting method as described above when executed by a processor.

[0178] The computer program product provided by the present application can solve the technical problem of fitting time series data. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the time series data fitting method provided by the above embodiment, which will not be repeated here.

[0179] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A time series data fitting method, characterized in that: The fitting method of the time series data includes: Get one-dimensional time series data and a preset number of basis functions; Performing component decomposition and fitting on the one-dimensional time series data through each of the basis functions to obtain data fitting results containing different numbers of basis functions; Based on the goodness of fit of each of the data fitting results, the best fitting curve in the fitting results is determined to obtain a final fitting result.

2. The method according to claim 1, characterized in that The one-dimensional time series data is subjected to component decomposition and fitting by each of the basis functions to obtain fitting results containing different numbers of basis functions, including: Performing component decomposition processing on the one-dimensional time series data for a preset number of times to obtain a plurality of single-component data; For the single component data obtained by each decomposition, a single basis function is used to perform fitting processing to obtain multiple single component fitting results; The single component fitting results are combined to obtain an overall fitting result; The overall fitting result is subjected to curve fitting with a preset initial condition to obtain a data fitting result containing different numbers of basis functions, wherein the preset initial condition includes parameters of each basis function in the overall fitting result.

3. The method according to claim 2, characterized in that The data fitting result and the single component fitting result are obtained by fitting based on the least square method.

4. The method according to claim 2, characterized in that The single component data obtained by each decomposition is fitted using a single basis function to obtain multiple single component fitting results, including: Subtracting the previous N-minus-1 single-component fitting curve from the one-dimensional time series data to obtain the current time series to be fitted, where N is the sequence number of the current fitting component; Based on the time series to be fitted, determining a global time series to be fitted; Performing fitting tests on the global time series to be fitted by using different types of basis functions to obtain a plurality of first test results; Selecting the first test result corresponding to the best goodness of fit as the best global fit of the Nth component; Based on the time series to be fitted, the data within the time interception window range on both sides are intercepted with the maximum value moment as the center to obtain the local time series to be fitted; Performing fitting tests on the local time series to be fitted by using different types of basis functions to obtain multiple second test results, and selecting the second test result corresponding to the best goodness of fit as the best global fit of the Nth component; Based on the best global fit of the Nth component and the best local fit of the Nth component, the fitting result with the best goodness of fit is selected as the final single-component fitting result.

5. The method according to claim 1, characterized in that The step of determining the best fitting curve in the fitting results based on the goodness of fit of each of the data fitting results to obtain a final fitting result includes: Based on the goodness of fit of each of the data fitting results, determine the best fitting curve in the fitting results to obtain a final fitting result; The goodness of fit is expressed as follows: Among them, R 2 Indicates the degree of fit of the fitting result, R 2 The larger the value, the better the fitting degree. i is the data point number, k is the number of data points, and y fit,i is the value of the i-th data point of the fitted curve, y i is the value of the i-th data point of the time series to be fitted, is the average value of all data points in the time series to be fitted.

6. The method according to claim 1, characterized in that The basis functions include a Gaussian distribution function, a gamma distribution function, a lognormal distribution function and an exponential function.

7. A time series data fitting device, characterized in that: The time series data fitting device comprises: An acquisition module, used to acquire one-dimensional time series data and a preset number of basis functions; A fitting module, used for performing component decomposition and fitting on the one-dimensional time series data through each of the basis functions to obtain data fitting results containing different numbers of basis functions; The judgment module is used to judge the best fitting curve in the fitting results based on the goodness of fit of each of the data fitting results to obtain a final fitting result.

8. A time series data fitting device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the time series data fitting method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the time series data fitting method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the time series data fitting method according to any one of claims 1 to 6 are implemented.