Description Usage Arguments Value References Examples
View source: R/predict_sgstar.R
Predicting value based on Sgstar object
1 | predict_sgstar(formula, n_time)
|
formula |
an object from the output from sgstar() function. |
n_time |
number of steps ahead for which prediction is required. |
returns output a dataframe that shown predict value based on model, with rows as time and column that shown for each location.
Setiawan, Suhartono, and Prastuti M.(2016).S GSTAR-SUR for Seasonal Spatio Temporal Data Forecasting. Malaysian Journal Of Mathematical Sciences.10.<Corpus ID :189955959>.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(sgstar)
data("coords")
data("simulatedata")
#create weight matrix using distance inverse matrix
z<-dist(coords,method = "euclidean")
z <- as.matrix(z)
matriksd <- 1/z
matriksd[is.infinite(matriksd)] <- 0
matriksd_w <- matriksd / rowSums(as.data.frame(matriksd))
fit <- sgstar(data = simulatedata, w = matriksd_w, p = 2,ps = 1, s =4)
#predicting for 12 time ahead
predict.fit <-predict_sgstar(fit,12)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.