psim_artif {stppSim} | R Documentation |
Stpp from synthetic origins
Description
Generates spatiotemporal point patterns based on a set of synthesized origins.
Usage
psim_artif(n_events=1000, start_date = "2021-01-01",
poly, netw = NULL, n_origin, restriction_feat=NULL, field,
n_foci, foci_separation, mfocal = NULL, conc_type = "dispersed",
p_ratio=20, s_threshold = 50, step_length = 20,
trend = "stable", shortTerm = "cyclical", fPeak=90,
s_band = c(0, 200),
t_band = c(1, 5, 10),
slope = NULL, interactive = FALSE, show.plot=FALSE, show.data=FALSE, ...)
Arguments
n_events |
number of points
(events) to simulate. Default: |
start_date |
the start date of the temporal pattern.
The date should be in the format |
poly |
(An sf or S4 object) a polygon shapefile defining the extent of the landscape. |
netw |
(An sf or S4 object)
The network path of the landscape
(e.g. road and/or street). Default: |
n_origin |
number of locations to serve as
origins for walkers. Default: |
restriction_feat |
(An S4 object) optional
shapefile containing features
in which walkers cannot walk through.
Default: |
field |
a number in the range of |
n_foci |
number of focal points amongst the origin
locations. The origins to serve as focal
points are based on random selection. |
foci_separation |
a value from |
mfocal |
the c(x, y) coordinates of a single point,
representing a pre-defined |
conc_type |
concentration of the rest of the
origins (non-focal origins) around the focal ones. The options
are |
p_ratio |
the smaller of the
two terms of proportional ratios.
For example, a value of |
s_threshold |
defines the spatial
perception range of a walker at a given
location. Default: |
step_length |
the maximum step taken by a walker from one point to the next. |
trend |
specifies the direction of the
long-term trend. Options are:
|
shortTerm |
type of short- to medium-term
fluctuations (patterns) of the time series.
Options are: |
fPeak |
first seasonal
peak of cyclical short term. Default value is |
s_band |
distance bandwidth within which
the event re-occurences are maximized (i.e.,
interactions are maximum). Specified as a vector of
two distance values. Default: |
t_band |
temporal bandwidth within which
event re-occurences are maximized (i.e., interactions
are maximum). Specified as a vector of values (in days)
|
slope |
slope of the long-term trend when
an |
interactive |
Whether to run the process in
interactive mode. Default is |
show.plot |
(logical) Shows GTP.
Default is |
show.data |
(TRUE or FALSE) To show the output
data. Default is |
... |
additional arguments to pass from
|
Details
Simulate artificial spatiotemporal patterns and interactions based user specifications.
Value
Returns a list of artificial spatiotemporal point patterns based on user-defined parameters.
Examples
## Not run:
#load boundary and land use of Camden
#load(file = system.file("extdata", "camden.rda",
#package="stppSim"))
#boundary = camden$boundary # get boundary
#landuse = camden$landuse # get landuse
boundary <- stppSim:::boundary
landuse <- stppSim:::landuse
#In this example, we will use a minimal number of
#'n_origin' (i.e. `20`) for faster computation:
#simulate data
simulated_stpp <- psim_artif(n_events=200, start_date = "2021-01-01",
poly=boundary, netw = NULL, n_origin=20, restriction_feat = NULL,
field = NULL,
n_foci=1, foci_separation = 10, mfocal = NULL,
conc_type = "dispersed",
p_ratio = 20, s_threshold = 50,
step_length = 20,
trend = "stable", shortTerm = "cyclical",
fPeak=90, s_band = c(0, 200),
t_band = c(1, 5, 10),
slope = NULL, interactive = FALSE, show.plot=FALSE, show.data=FALSE)
#If `n_events` is a vector of values,
#retrieve the simulated data for the
#corresponding vector element by using
#`simulated_stpp[[enter-element-index-here]]`, e.g.,
#to retrieve the first dataframe, use
#simulated_stpp[[1]].
#The above example simulates point patterns on
#an unrestricted landscape. If set ,
#`restriction_feat = landuse` and
#`field = "restrVal"`, then the simulation
#is performed on a restricted landscape.
## End(Not run)