Description Usage Arguments Details Value Author(s) Examples
This function provides batch implementation for interpolation of the missing values for multiple locations for a raster, supporting multi-core parallel computing.
1 | inter2conOpt(tarPDf, pol_season_trends, ncore)
|
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 |
ncore |
number of cores for parallel computing. |
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.
A data frame similar to the input data frame, tarPDf but with the missing values interpolated by constrained optimizaiotn.
Lianfa Li lspatial@gmail.com
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.