inter2conOpt: Batch Interpolation of the Missing Values for Time Series...

Description Usage Arguments Details Value Author(s) Examples

View source: R/inter2conOpt.R

Description

This function provides batch implementation for interpolation of the missing values for multiple locations for a raster, supporting multi-core parallel computing.

Usage

1

Arguments

tarPDf

The target data frame with missing values. Each row corresponds to a location (rowname as location id) and each column corresonds to a time point. The sequence of the location and time should be in sequence in spatial and temporal dimension. This dataset comes from the raster dataset and the sequence is kept for convenience of making raster with the interpolated value.

pol_season_trends

The temporal basis function using getTBasisFun

ncore

number of cores for parallel computing.

Details

This function aims to implement the batch computing to use constrained optimization to get the concentrations for the missing values of a time series, such as PM2.5 concentration.

Value

A data frame similar to the input data frame, tarPDf but with the missing values interpolated by constrained optimizaiotn.

Author(s)

Lianfa Li lspatial@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Here is the sample for the first 500 locations.
# In practice, you may need more point locations and more cores.
data("allPre500","shdSeries2014")
# Get the temporal basis functions to be used in constrained optimization
season_trends=getTBasisFun(shdSeries2014,idStr="siteid",dateStr="date",
                           valStr="obs",df=10,n.basis=2,tbPath=NA)

#Constrained optimization
season_trends$tid=as.numeric(strftime(season_trends$date, format = "%j"))
allPre_part_filled=inter2conOpt(tarPDf=allPre500[c(1:6),],pol_season_trends=season_trends,ncore=2)

lspatial/sptemUS documentation built on May 29, 2019, 3:42 a.m.