Forecasting at New Locations
Source:vignettes/forecasting-new-locations.Rmd
forecasting-new-locations.RmdOverview
krige_new() extends an estimated MCGF model to spatial
locations that were not used for fitting. This is useful when:
- a station is newly installed;
- forecasts are required on a target grid;
- some sites are intentionally held out for validation; or
- future scenario generation is needed at additional locations.
There are two ways to describe the new sites:
- provide their coordinates with
locations_new, or - provide precomputed signed distances with
dists_new.
This vignette demonstrates the coordinate workflow.
Fit the base covariance model
For a first new-location forecast, a separable base model is sufficient.
Forecast with krige_new()
pred <- krige_new(
x,
locations_new = new_location,
model = "base",
interval = TRUE
)
dim(pred$fit)
#> [1] 1000 11The output contains forecasts for the original sites and the appended new site. The new site is the last spatial column.
Forecast using new observed data
If you have a separate future period for the original locations,
supply it with newdata:
pred_future <- krige_new(
x,
newdata = future_data,
locations_new = new_location,
model = "base",
interval = TRUE
)future_data must have the same columns, in the same
order, as the fitted mcgf object.
If observations at the new location are available
You can also provide newdata_new. These observations are
then included in the lagged information used for forecasting.
pred_with_new_history <- krige_new(
x,
newdata = future_data,
locations_new = new_location,
newdata_new = future_new_site,
model = "base",
interval = TRUE
)The number of rows in newdata_new must match
newdata, and the number of columns must match the number of
new locations.
Supplying distances directly
If the object does not contain coordinates, calculate the distances
yourself and pass them through dists_new.
d_new <- find_dists_new(
locations = observed_locations,
locations_new = new_location,
longlat = TRUE
)
pred <- krige_new(
x,
dists_new = d_new,
model = "base"
)Do not supply both locations_new and
dists_new.
General stationary model
Once a Lagrangian model has been fitted and added with
add_lagr(), switch to:
pred_all <- krige_new(
x,
locations_new = new_location,
model = "all",
interval = TRUE
)This extends both the base and directional Lagrangian covariance to the new location.
Regime-switching objects
krige_new() also has an mcgf_rs method. Use
dists_new_ls and sds_new_ls when distance or
marginal-variance assumptions differ by regime. For soft regime
forecasts, supply regime probabilities using prob.
See vignette("mcgf_rs", package = "mcgf") for a complete
RS-MCGF fit.