ab.gbounds {AIGIS} | R Documentation |
Calculate the upper and lower bounds on values that could be contained inside fire perimeters of arbitrary area in every single 1/8 degree gridcell in California. Assumes the fire occupied the highest and lowest density block groups respectively, and does (at present) not enforce contiguity requirements. Also, at present this function is not generalizable beyond the CA wildfire problem, and area
, units
, recvar
and appdam
are the only arguments that can be safely changed from the default.
ab.gbounds(gridgpcobj = gridgpc, gws = gridinws, area = 200, units = "ha", recvar = 1, recvals = bgvals, recarea = rbgarea, appdam = TRUE, dr = damrats, cap = TRUE, maskobj=MASK)
gridgpcobj |
A list object containing gridcells in gpc form as well as indexing vectors. See help for the data object gridgpc for exact form. |
gws |
Grid weights. A list of matrices giving zone indices and overlaps for each gridcell. For now gridinws is the appropriate companion object to gridgpc . |
area |
An numeric area expressed in one of five units, specified by units . |
units |
A character object indicating the units on area , one of:
|
recvar |
An integer indicating which column of the record value matrix to use. That is, what variable is to be bounded. |
recvals |
A matrix containing the data to be bounded, with rows corresponding to zones, and columns corresponding to different variables. |
recarea |
A vector giving the area of each polygon corresponding to the records in recvals , in units of lat-lon degree area. Unlike for the standard areal interpolation functions built around arealw , this must be provided and cannot be set to “none”. |
appdam |
CA Wildfire specific. A logical indicating whether or not to apply the empirically derived damage ratio. |
dr |
CA Wildfire specific. A vector giving precalculated damage ratios by block group. |
cap |
Logical passed to area2frac , indicating whether or not to automatically cap the answer at one, if the area called for is greater than the area of the cell. |
maskobj |
A matrix of ones and zeros noting which gridcells should be used and which omitted |
This is primarily a midlevel wrapper, which loops calls to ab.gcbounds
. It itself is wrapped by ab.gstats
, which uses its output in assembling the final array reporting expected values, and bounds for housing structures, housing structures damaged, and total property value damaged.
Returns an array with dimensions dim=nrow(MASK),ncol(MASK),2)
, where the value[i,j,] is a length two vector whose first entry is the lower bound estimate for the gridcell identified by MASK[i,j], and whose second entry is the upper bound estimate.
If enough area within a gridcell is overlapping the border, the results will always be zero for the lower bound - thus fire sizes need to become reasonable large before the lower bound will be nonzero anywhere.
Benjamin P. Bryant, bryant@prgs.edu
data(bgvals) data(damrats) data(gridgpc) data(gridinws) data(MASK) data(rbgarea) #find upper and lower bounds of housing value threatened by 200 ha fires in all #gridcells. (Will take a minute or two of calculating time.) somebounds <- ab.gbounds(gridgpcobj = gridgpc, gws = gridinws, area = 200, units = "ha", recvar = 2, recvals = bgvals, recarea = rbgarea, appdam = FALSE, dr = damrats, cap = TRUE)