as.disag_data: Function to fit the disaggregation model

View source: R/prepare_data.R

as.disag_dataR Documentation

Function to fit the disaggregation model

Description

Function to fit the disaggregation model

Usage

as.disag_data(
  polygon_shapefile,
  shapefile_names,
  covariate_rasters,
  polygon_data,
  covariate_data,
  aggregation_pixels,
  coordsForFit,
  coordsForPrediction,
  startendindex,
  mesh = NULL
)

Arguments

polygon_shapefile

sf object containing the response data

shapefile_names

List of 2: polygon id variable name and response variable name from x

covariate_rasters

SpatRaster of covariates

polygon_data

data.frame with two columns: polygon id and response

covariate_data

data.frame with cell id, polygon id and covariate columns

aggregation_pixels

vector with value of aggregation raster at each pixel

coordsForFit

coordinates of the covariate data points within the polygons in x

coordsForPrediction

coordinates of the covariate data points in the whole raster extent

startendindex

matrix containing the start and end index for each polygon

mesh

inla.mesh object to use in the fit

Value

A list is returned of class disag_data. The functions summary, print and plot can be used on disag_data. The list of class disag_data contains:

x

The sf object used as an input.

covariate_rasters

The SpatRaster used as an input.

polygon_data

A data frame with columns of area_id, response and N (sample size: all NAs unless using binomial data). Each row represents a polygon.

covariate_data

A data frame with columns of area_id, cell_id and one for each covariate in covariate_rasters. Each row represents a pixel in a polygon.

aggregation_pixels

An array with the value of the aggregation raster for each pixel in the same order as the rows of covariate_data.

coordsForFit

A matrix with two columns of x, y coordinates of pixels within the polygons. Used to make the spatial field.

coordsForPrediction

A matrix with two columns of x, y coordinates of pixels in the whole Raster. Used to make predictions.

startendindex

A matrix with two columns containing the start and end index of the pixels within each polygon.

mesh

A INLA mesh to be used for the spatial field of the disaggregation model.


disaggregation documentation built on Nov. 8, 2023, 5:07 p.m.