sstl_local: Apply sstl routine to a data.frame of spatial-temporal...

Description Usage Arguments Author(s) Examples

Description

Assuming data has been read into the memory as a data.frame. Each row of the data.frame contains the observation in a given month at given location. Month index and station location information are saved in 5 columns of the data.frame. The name of these columns should be "lon", "lat", "elev", "year", and "month".

Usage

1

Arguments

data

The input data.frame which contains observation, lon, lat, elev, and year, month

mlcontrol

Should be a list object generated from spacetime.control function. The list including all necessary smoothing parameters of nonparametric fitting.

Author(s)

Xiaosu Tong

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
    head(tmax_all)
    n <- 1000 # just use 1000 stations as example
    set.seed(99)
    first_stations <- sample(unique(tmax_all$station.id), n)
    small_dt <- subset(tmax_all, station.id %in% first_stations)
    small_dt$station.id <- as.character(small_dt$station.id)
    small_dt$month <- as.character(small_dt$month)

    mcontrol <- spacetime.control(
      vari="tmax", n=576, n.p=12, stat_n=n, surf = "interpolate",
      s.window=13, t.window = 241, degree=2, span=0.15, Edeg=0
    )

    rst <- sstl_local(small_dt, mlcontrol=mcontrol)

XiaosuTong/drSpaceTime documentation built on May 9, 2019, 11:06 p.m.