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: 1000. A vector of integer values can be supplied, such as, c(a1, a2, ....)⁠, where ⁠a⁠1, ⁠a'2, ... represent different integer values.

start_date

the start date of the temporal pattern. The date should be in the format "yyyy-mm-dd". The 'gtp' will normally cover a 1-year period.

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: NULL. If provided each event is snapped to the closest network path/segment.

n_origin

number of locations to serve as origins for walkers. Default:50.

restriction_feat

(An S4 object) optional shapefile containing features in which walkers cannot walk through. Default: NULL.

field

a number in the range of [0-1] (i.e. restriction values) assigned to all features; or the name of a numeric field to extract such restriction values for different classes of feature. Restriction value 0 and 1 indicate the lowest and the highest obstructions, respectively. Default: NULL.

n_foci

number of focal points amongst the origin locations. The origins to serve as focal points are based on random selection. n_foci must be smaller than n_origins.

foci_separation

a value from 1 to 100 indicating the nearness of focal points to one another. A 0 separation indicates that focal points are in close proximity of one another, while a 100 indicates focal points being evenly distributed across space.

mfocal

the c(x, y) coordinates of a single point, representing a pre-defined main focal point (origin) in the area. The default is NULL in which a random coordinate is chosen within the polygon area.

conc_type

concentration of the rest of the origins (non-focal origins) around the focal ones. The options are "nucleated" and "dispersed".

p_ratio

the smaller of the two terms of proportional ratios. For example, a value of 20 implies 20:80 proportional ratios.

s_threshold

defines the spatial perception range of a walker at a given location. Default: 250 (in the same linear unit as the poly - polygon shapefile).

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: "falling", "stable", and "rising". Default value is: "stable".

shortTerm

type of short- to medium-term fluctuations (patterns) of the time series. Options are: `"cyclical"` and `"acyclical"`. Default is: `"cyclical"`.

fPeak

first seasonal peak of cyclical short term. Default value is 90. Only used for "cyclical" short term pattern.

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: c(0, 200).

t_band

temporal bandwidth within which event re-occurences are maximized (i.e., interactions are maximum). Specified as a vector of values (in days) c(1, 5, 7, 14).

slope

slope of the long-term trend when an "rising" or "falling" trend is specified. Options: "gentle" or "steep". The default value is set as NULL for the stable trend.

interactive

Whether to run the process in interactive mode. Default is FALSE. If TRUE, a user is able to preview the spatial and temporal models of the expected distribution of the final simulated events (points).

show.plot

(logical) Shows GTP. Default is FALSE.

show.data

(TRUE or FALSE) To show the output data. Default is FALSE.

...

additional arguments to pass from gtp, walker and artif_spo functions.

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)


[Package stppSim version 1.3.2 Index]