fdata | R Documentation |
Prepares and organizes datasets for use with the exponential Factor Copula Model (eFCM). The function converts raw station-level observations and their spatial coordinates into an "fdata" object, which contains the data, grid structure, and neighborhood information required for model fitting with fcm()
.
fdata(
data,
coord,
grid = NULL,
neigh = NULL,
theta0 = NULL,
cellsize = c(0.5, 0.5),
parallel = TRUE,
ncpus = 4,
mc.set.seed = TRUE,
...
)
data |
A matrix or data.frame. Each column corresponds to a station, with rows containing observations (on the original scale). |
coord |
A two-column matrix or data frame of station coordinates (longitude and latitude), one row per station. |
grid |
Optional two-column matrix or data frame of grid locations (longitude, latitude) at which the model will be fitted. If |
neigh |
Optional list of neighborhood station indices for each grid point. If |
theta0 |
Optional matrix or data.frame with two columns: initial lambda and delta. Must match number of stations. |
cellsize |
Numeric vector of length 1 or 2, specifying longitude and latitude resolution. |
parallel |
Logical; if |
ncpus |
Integer; number of worker processes when |
mc.set.seed |
Logical; seed the RNG streams in workers (default |
... |
Additional arguments passed to |
An object of class "fdata"
, which is a list with elements:
data |
Original input data |
coord |
Coordinates of stations |
grid |
Grid points with assigned IDs |
neigh |
List of neighbor station indices per grid point |
theta0 |
Initial values matrix |
N |
Number of stations |
fcm()
, neighborhood_HT()
# Load precipitation data for counterfactual scenarios
data("counterfactual")
data("LonLat")
coord = LonLat # station coordinates (longitude-latitude)
cf_data <- fdata(counterfactual, coord, cellsize = c(1, 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.