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,
  coords_for_fit,
  coords_for_prediction,
  start_end_index,
  mesh = NULL,
  coordsForFit = NULL,
  coordsForPrediction = NULL,
  startendindex = 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

coords_for_fit

coordinates of the covariate data points within the polygons in x

coords_for_prediction

coordinates of the covariate data points in the whole raster extent

start_end_index

matrix containing the start and end index for each polygon

mesh

inla.mesh object to use in the fit

coordsForFit

Deprecated.

coordsForPrediction

Deprecated.

startendindex

Deprecated.

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.

coords_for_fit

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

coords_for_prediction

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

start_end_index

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 Oct. 3, 2024, 1:07 a.m.