Filling data gaps in a periodic timeseries in MATLAB

조회 수: 13 (최근 30일)
Donald John
Donald John 2014년 10월 23일
댓글: Muhammad Usman Saleem 2022년 6월 17일
I am looking for a method to fill in data gaps in a time-series that contains periodic data (in this case with a frequency equal to a tidal frequency, so both semi-diurnal and spring/neap frequencies) using MATLAB. The data series also contains noise which I would like to superimpose on top of the artificial data that fills the time gap. The data has a certain trend that I want to preserve. Ideally I would be looking at a method that uses the recorded data on either side of the time gap. The data files are too large to post here. However the sampling rate is 5 mins and there is approximately a week worth of data missing.
<<
>>
Is there anyway of doing this in Matlab?
Thank you.
Donald John
  댓글 수: 2
Yona
Yona 2014년 10월 23일
편집: Yona 2014년 10월 23일
how this gap is in the data? It is a NaN value in voltage or every time that 2 consecutive data have difference of more that X time, it a gap or something else?
when this gap will define, you just need to find it and plot separated data set.
To help you remove noise, we need your definition of noise. if you just what to smooth your data, take a look on figure "tools"-> "basic fitting"
Donald John
Donald John 2014년 10월 23일
Thank you for your response. The gap is represented by NaN values in the voltage. Can you explain what you mean when you say, 'you just need to find it and plot separated data set', how would I go about doing this?

댓글을 달려면 로그인하십시오.

답변 (2개)

Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014년 10월 24일
편집: Bruno Pop-Stefanov 2014년 10월 24일
This is definitely not an easy problem. There are several ways you can go about this.
1) Curve Fitting
The easiest method would be to try to fit a curve to the data you have. Curve Fitting Toolbox has an app that allows you to quickly try different models, adjust parameters, and immediately see whether you found a good fit or not. The downside of this method would be that it only estimates the parameters of a curve. It won't estimate the noise. You'll get a smooth curve for the week of missing points, instead of noisy measurements.
Read more here:
There are also numerous other examples listed here:
2) Time Series Regression
A better approach would be to estimate your time series as an auto-regressive model (AR, MA, ARMA, ARMAX, GARCH, or others). Econometrics Toolbox provides tools for estimation, simulation and forecasting of time series.
Take a look at the examples on this page and see if you could adapt something your problem:
I am not sure whether you can use the left and right ends of your data to estimate a model at once, or if you can only use once at a time.

Donald John
Donald John 2014년 10월 30일
Thanks for your response. I am going to give both of these methods a try. I'll report back here once I have had a chance to do so. In the meantime any further input is much appreciated!! Thanks again.

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by