[R] Resampling 1 time series at another set of (known) irregularly spaced times

Jeff Newmiller jdnewmil @ending from dcn@d@vi@@c@@u@
Thu Jan 10 00:17:14 CET 2019


The key to accomplishing this is to clarify how you want to address selecting values between the existing points, but there are many base R functions and packages that address this problem. In general the methods fall into two categories: interpolation and smoothing. Interpolation includes piecewise linear interpolation, splines, last-observation-carried-forward, and  first-order-extrapolation, all of which yield the same values of applied only at the original independent values. Smoothing methods such as regression, loess, kriging, and kernel interpolation may not have this identity property but you don't need unique input values at each independent variable value either.

Read some Task Views, e.g.

https://cran.r-project.org/web/views/NumericalMathematics.html

https://cran.r-project.org/web/views/TimeSeries.html

https://cran.r-project.org/web/views/MissingData.html



On January 9, 2019 2:55:04 PM PST, John Hillier <J.Hillier using lboro.ac.uk> wrote:
>Dear All,
>
>
>I would appreciate a quick pointer in the right direction (e.g. www
>page I could look at, or indicator of which function within a package).
>
>
>The problem: I have a regular time series of values x at times t (i.e.
>t, x). I would like to sample them at irregular, known times - this is
>a second time series (T).
>
>
>I can move these data between formats as required (i.e. file, vector,
>matrix, ts etc ....)
>
>
>I have been searching around for a while and found many packages to
>regularise time-series (e.g. xts, lubricate, ..... ), but not the
>reverse as I want to.
>
>
>Before you ask, I know it might seem a bit odd, but it is necessary for
>the particular question I'm asking.
>
>
>Thank you for your time,
>
>
>John
>
>
>-------------------------
>Work days: Mon-Thurs
>Web page: <http://homepages.lboro.ac.uk/~gyjh5/>
><http://www.lboro.ac.uk/departments/geography/staff/john-hillier/>
>http://www.lboro.ac.uk/departments/geography/staff/john-hillier/
>Latest research:
>http://publications.lboro.ac.uk/publications/all/collated/gyjh5.html<https://lb-public.lboro.ac.uk/cgi-bin/personcite?username=gyjh5&dobranding=1&hits=10>
>
>Dr John Hillier
>Senior Lecturer & NERC Knowledge Exchange Fellow (Insurance Sector)
>Geography and Environment
>Loughborough University
>01509 223727
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list