|
|
Using interp1 for timeseries data
Hi,
I am trying to do some interpolation of timeseries data (24 hours) over different months but my timeseries are not continous.
Here is an example of the timeseries:
A= [2007 11 19 0
2007 11 19 23
2008 3 15 0];
I have the data for November 2007 with hourly data, then I have data for March 2008 with hourly data. How do I interpolate between the hourly monthly data to make it hourly data between November 2007 to March 2008?
Thank you
|
|
0
|
|
|
|
Reply
|
Yvonne
|
4/29/2010 9:06:04 PM |
|
"Yvonne " <hwt3@waikato.ac.nz> wrote in message <hrcsbs$987$1@fred.mathworks.com>...
> Hi,
>
> I am trying to do some interpolation of timeseries data (24 hours) over different months but my timeseries are not continous.
> Here is an example of the timeseries:
> A= [2007 11 19 0
> 2007 11 19 23
> 2008 3 15 0];
>
> I have the data for November 2007 with hourly data, then I have data for March 2008 with hourly data. How do I interpolate between the hourly monthly data to make it hourly data between November 2007 to March 2008?
>
> Thank you
There is probably another (better/easier) way using cells but this is one way:
-Calculate what each day is in relation to the first hour of the first day being zero.
-Then convert each full date/time (year, month, day,hour) to the hours past the first time, put these all in a vector.
-You now have a vector with all the times for which you have data.
-Run interp1 on this vector.
There is probably a file on the FEX to help with getting day of year.
|
|
0
|
|
|
|
Reply
|
Sean
|
4/29/2010 9:37:04 PM
|
|
On Apr 30, 9:06=A0am, "Yvonne " <h...@waikato.ac.nz> wrote:
> Hi,
>
> I am trying to do some interpolation of timeseries data (24 hours) over d=
ifferent months but my timeseries are not continous.
> Here is an example of the timeseries:
> A=3D [2007 =A0 =A0 =A0 =A011 =A0 =A0 =A019 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0
> =A0 =A0 =A02007 =A0 =A0 =A0 11 =A0 =A0 =A019 =A0 =A0 =A023 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0
> =A0 =A0 =A02008 =A0 =A0 =A0 3 =A0 =A0 =A0 15 =A0 =A0 =A00];
>
> I have the data for November 2007 with hourly data, then I have data for =
March 2008 with hourly data. How do I interpolate between the hourly monthl=
y data to make it hourly data between November 2007 to March 2008?
>
> Thank you =A0 =A0 =A0 =A0 =A0 =A0 =A0
% Convert your times to Matlab days:
t=3Ddatenum(A(:,1),A(:,2),A(,3),A(:,4),0,0);
% Generate the new times at hourly intervals
tt=3D[t(1):1/24:t(end)]';
% Interpolate
yy=3Dinterp1(t,y,tt);
|
|
0
|
|
|
|
Reply
|
TideMan
|
4/29/2010 11:07:05 PM
|
|
|
2 Replies
285 Views
(page loaded in 0.021 seconds)
Similiar Articles: filter fft data - comp.soft-sys.matlab... is sampled non-uniformly (avg sampling 0.548Hz) - I re-sample the data by using 'interp1 ... averaging smoothing, and savitzky-golay smoothing on your noisy time series data. How to align dates in Matlab fast? - comp.soft-sys.matlab ...... corresponding data points using the > data from previously available data. .... doc interp1 -- ... all, I have two time series, both are in the following format: Date Data ... Changing Inputs per Time Step in ODE45 - comp.soft-sys.matlab ...... ModelS1(Inputs, T1, b, c) % Define Store input time series ... Use INTERP1 for this. -- Steve Lord slord@mathworks.com ... how convert sampled scope data into dBV/sqrt(Hz ... how to solve a differential equation with Gaussian white noise ...... nonlinear random vibrations using an amplitude-dependent autoregressive time series model ... odefun(t,y, g) gTemp = interp1 ... However, the data obtained is NAN ... Durbin Watson table or other test for autocorrelation of residuals ...... they are serially correlated % %If the input time series 'x ... Null hypothesis IS REJECTED') disp(['The data ... 0025, 0.001, 0.0005') end critical_value = interp1 ... interp1 - 1-D data interpolation (table lookup)The interp1 command interpolates between data points. It finds values at intermediate points, of a one-dimensional function f(x) that underlies the data. Animate Aero.Animation object given position/angle time series ...MATLAB time series data with six values per time: x y z phi theta psi. The values are ... Signals are linearly interpolated vs. time using interp1. 'Array6DoF' A double ... 7/24/2012 11:55:46 AM
|
|
|
|
|
|
|
|
|