Title: | Determination of Intervals Using Georeferenced Survey Simulation |
---|---|
Description: | Simulation tool to estimate the rate of success that surveys possessing user-specific characteristics have in identifying archaeological sites (or any groups of clouds of objects), given specific parameters of survey area, survey methods, and site properties. The survey approach used is largely based on the work of Kintigh (1988) <doi:10.2307/281113>. |
Authors: | Mark Hubbe [aut, cre], Cara Hubbell [aut], William Pestle [aut] |
Maintainer: | Mark Hubbe <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.2 |
Built: | 2025-03-08 04:16:25 UTC |
Source: | https://github.com/markhubbe/digss |
Estimate the area of multiple overlapping ellipses
areaEstimator(sitemap, fieldarea, precision = 1000)
areaEstimator(sitemap, fieldarea, precision = 1000)
sitemap |
a matrix with sites per row and columns:
|
fieldarea |
vector with dimensions of field surveyed in km: |
precision |
how many dots will be projected of field. Total dots equal |
This function will estimate the area occupied by sites (ellipses) in a rectangular
field, taking into consideration the fact that sites can overlap. It is formatted to be used inside
fieldMap()
.
This function is a cookie-cutter area estimator, given the complexities of calculating the real areas of overlapping ellipses. It projects N x N equally spaced dots in the survey field and calculates the ratio of how many of them fall inside at least one site (ellipse). Using a precision of 1000 x 1000 dots, it approximates area to within 0.1% of real area.
The rate of points that are inside at least one ellipse divided by all points projected in the area.
#create a matrix with 2 sites randomly located using `fieldMap()` site.example<-fieldMap(c(1,1),2,250000,plot=TRUE) #define size of field field.area<-c(1,1) #calculate area areaEstimator(site.example$site.frame,field.area)
#create a matrix with 2 sites randomly located using `fieldMap()` site.example<-fieldMap(c(1,1),2,250000,plot=TRUE) #define size of field field.area<-c(1,1) #calculate area areaEstimator(site.example$site.frame,field.area)
Creates a cloud of dots inside ellipsoid sites
cloudGenerator( density, a, b, angle, center.x, center.y, type = "uniform", precision = 30, plot = FALSE )
cloudGenerator( density, a, b, angle, center.x, center.y, type = "uniform", precision = 30, plot = FALSE )
density |
dots (artifacts) per m2 |
a |
ellipse (site) long axis in km |
b |
ellipse (site) short axis in km |
angle |
ellipse (site) angle of rotation in radians |
center.x |
center of ellipse in x axis |
center.y |
center of ellipse in y axis |
type |
type of density distribution. Choose from:
|
precision |
how many slices of the distribution will be made (more = much slower run times). Default = |
plot |
if function should plot results. function does not work outside |
cloudGenerator()
creates a cloud of point inside an ellipsoid site of predefined
size and shape, to represent the locations of artifacts in a site. The function can build artifact scatters
with different densities profiles. The function uses an "onion-layer" approach to approximate the density of points from the center.
In practice, it means that each site is composed of N ellipse slices surrounding the previous slice, with each slice
having a different artifact density depending on the density function selected. This approach also makes
the surveySim
function more efficient, since it will search for artifact hits only on the slices that intersect the
survey pits.
A list with two objects:
coords |
A list of the bands (N=precision ) that represent the site, each populated with the
X and Y coordinates for all artifacts generates inside them. |
info |
A list with the number of pieces created ($total.pieces ), area of the site ($total.area ), and
artifact density in the site ($actual.density ) |
#create a small site with low density uniform distribution uni.site<-cloudGenerator(0.1,0.1,0.05,pi/4,0.5,0.5,type="u") #plot a site with uniform artifact distribution through surveySim SiteParameters<-parametersExample SiteParameters$simulations=1 SiteParameters$site.density=1 SiteParameters$obj.density=0.1 SiteParameters$obj.distribution = "u" surveySim(SiteParameters,plot.artifacts = TRUE) #plot a site with sinusoidal artifact distribution through surveySim SiteParameters$obj.distribution = "si" surveySim(SiteParameters,plot.artifacts = TRUE)
#create a small site with low density uniform distribution uni.site<-cloudGenerator(0.1,0.1,0.05,pi/4,0.5,0.5,type="u") #plot a site with uniform artifact distribution through surveySim SiteParameters<-parametersExample SiteParameters$simulations=1 SiteParameters$site.density=1 SiteParameters$obj.density=0.1 SiteParameters$obj.distribution = "u" surveySim(SiteParameters,plot.artifacts = TRUE) #plot a site with sinusoidal artifact distribution through surveySim SiteParameters$obj.distribution = "si" surveySim(SiteParameters,plot.artifacts = TRUE)
Creates randomly placed ellipsoid sites in a rectangular field.
fieldMap( area, site.density, site.area, overlap = 0.5, plot = FALSE, areaprecision = 1000 )
fieldMap( area, site.density, site.area, overlap = 0.5, plot = FALSE, areaprecision = 1000 )
area |
vector with horizontal and vertical size |
site.density |
number of sites/km2. Can be one constant value or vector with two values |
site.area |
either:
|
overlap |
proportion of overlap possible between sites: from (0 = no overlap allowed to 1 = sites can occupy same space) |
plot |
whether site ellipses should should be plotted. |
areaprecision |
value passed to |
fieldMap()
creates and plots randomly placed ellipses representing
archaeological sites. The sites are created inside a user-defined rectangle, with random positions
and random rotations. It allows also to control the percentage of overlap between sites.
A list with three objects:
site.frame |
A matrix with the properties of each site generated. |
totalArea |
The sum of areas of all site ellipses. |
actualArea |
The area occupied by the site ellipses taking into account their overlap) |
#example of map with 8 sites or variable areas and partial overlap field.example<-fieldMap( area=c(1,1), site.density=8, site.area=c(50000,250000,150000,50000), overlap=0.5, plot=TRUE)
#example of map with 8 sites or variable areas and partial overlap field.example<-fieldMap( area=c(1,1), site.density=8, site.area=c(50000,250000,150000,50000), overlap=0.5, plot=TRUE)
A test list of parameters for surveySim()
parametersExample
parametersExample
An object of class surveySim
of length 10.
This is just a test list of parameters to be used as an example in surveySim()
.
The values of this parameters are:
Width between survey lines (col.width
) = 50 m
Type of survey grid (grid.type
) = hexagonal
Number of simulations
= 10
Survey area
= 0.5km x 0.5km
Density of sites (site.density
) = 20
Area of sites (site.area
) = 10,000m2
Maximum site overlap
= 0.5
Density of artifacts (obj.density
) = 1/m2
Artifact distribution (obj.distribution
) = spherical
Survey radius (survey.radius
) = 0.5m
Plots the different results from surveySim()
plotSurveySumm(summaryList, plot = "sites.found", labels = NULL)
plotSurveySumm(summaryList, plot = "sites.found", labels = NULL)
summaryList |
a list of survey summaries, the output of |
plot |
what variable to plot. Options are:
|
labels |
vector with name of each item in list, to be added to the legend. If |
This function will plot the results of the surveySim()
simulations using Kernel Density plots.
All the grids that are to be compared should be grouped into 1 list (list(a,b,c,etc...))
The plot function allows you to choose different parts of the survey summaries produced by surveySim()
you want to plot.
#create 3 Simulations with sites of different sizes: small.sites<-parametersExample small.sites$site.area=500 medium.sites<-parametersExample medium.sites$site.area=1000 large.sites<-parametersExample large.sites$site.area=2000 #run the 3 simulations small.survey<-surveySim(small.sites) medium.survey<-surveySim(medium.sites) large.survey<-surveySim(large.sites) #create the comparative plot. #note that the results go into a list. If labels are not given, legend is built on list names plotSurveySumm( list(small.survey,medium.survey,large.survey), plot="sites.found", labels=c("Small sites","Medium sites","Large sites"))
#create 3 Simulations with sites of different sizes: small.sites<-parametersExample small.sites$site.area=500 medium.sites<-parametersExample medium.sites$site.area=1000 large.sites<-parametersExample large.sites$site.area=2000 #run the 3 simulations small.survey<-surveySim(small.sites) medium.survey<-surveySim(medium.sites) large.survey<-surveySim(large.sites) #create the comparative plot. #note that the results go into a list. If labels are not given, legend is built on list names plotSurveySumm( list(small.survey,medium.survey,large.survey), plot="sites.found", labels=c("Small sites","Medium sites","Large sites"))
Perform multiple survey simulations changing values on one variable and plot the results
surveyLoops(surveyParameters, loopVariable, loopSequence, plotResult)
surveyLoops(surveyParameters, loopVariable, loopSequence, plotResult)
surveyParameters |
list of parameters (object class |
loopVariable |
variable to be looped. Can be any of the variables that exist in
|
loopSequence |
object with varying values, as defined above |
plotResult |
which results from the summary table will be plotted:
|
surveyLoops()
will run a series of simulations along one variable with values
provided by user. Through this function, the user can simulate and evaluate the changes
in efficiency and efficacy of specific variables, while holding every other value constant. The function
runs multiple instances of surveySim()
using values of surveyParameters
and replacing one of them with a sequence of values offered by the user.
A list with five objects:
surveysPerSim |
A matrix with the number of survey pits done in each simulation. |
sitesFound |
A matrix with the summary statistics about frequency of sites found in each simulation. |
sitesFoundOnArtifacts |
A matrix with the summary statistics about frequency of sites detected based on artifacts found in survey pits in each simulation. |
artifactsPerSurver |
A matrix with the summary statistics about artifacts found per survey pit in each simulation. |
succesRateIndex |
A matrix with the summary statistics about success rate (number of succesful survey pits/total survey pits) in each simulation. |
#Loop the impact of increasing distances between survey rows width.loop<-surveyLoops(parametersExample,"col.width",c(50,75,100,125,150),"sitesFound") #Loop the impact of different artifact distributions on surveys distr.loop<-surveyLoops( parametersExample, "obj.distribution", c("uniform","linear","spherical","sinusoidal"), "sitesFoundOnArtifacts")
#Loop the impact of increasing distances between survey rows width.loop<-surveyLoops(parametersExample,"col.width",c(50,75,100,125,150),"sitesFound") #Loop the impact of different artifact distributions on surveys distr.loop<-surveyLoops( parametersExample, "obj.distribution", c("uniform","linear","spherical","sinusoidal"), "sitesFoundOnArtifacts")
Master function that runs survey simulations
surveySim( survey.parameters, artifact.analysis = TRUE, plot = TRUE, plot.artifacts = FALSE, areaprecision = 1000 )
surveySim( survey.parameters, artifact.analysis = TRUE, plot = TRUE, plot.artifacts = FALSE, areaprecision = 1000 )
survey.parameters |
List of class
|
artifact.analysis |
Includes the analysis of artifacts in sites. Can be very time-consuming for mid-high artifact densities. Default = |
plot |
If |
plot.artifacts |
If |
areaprecision |
Area covered by sites is approximated by a cookie-cutter approach. Default precision = |
surveySim()
is the main function that will conduct the simulations
of survey grids based on the Survey Parameters created by user.
A list with four objects:
Summary |
A matrix with summary statistics about number of surveys, frequency of site founds, artifacts presence, and success rate of simulations. |
BySite |
A matrix with results of the analyses by site from each of the survey areas created in the simulation. |
ByArtifact |
A matrix with results of the analyses by artifact presence in survey pits from each of the survey areas created in the simulation. |
Parameters |
A list with the parameters used to run the simulation. |
#'@references Kintigh (1988) The Effectiveness of Subsurface Testing: A Simulation Approach. American Antiquity, 53:686-707. doi:10.2307/281113
#Runs simulations based on parametersExample surveyExample<-surveySim(parametersExample) #Edit parametersExample to have 50 simulations and then run simulations tmp_parameters <-parametersExample tmp_parameters$simulations<-50 survey50<-surveySim(tmp_parameters)
#Runs simulations based on parametersExample surveyExample<-surveySim(parametersExample) #Edit parametersExample to have 50 simulations and then run simulations tmp_parameters <-parametersExample tmp_parameters$simulations<-50 survey50<-surveySim(tmp_parameters)