Provides methods for the generic function
1 2 3 4 5 6
an object with class
has no effect, and is only included for compatibility with the generic function
seed for the random number generator.
maximum rate, only used if the attribute of
a function returning a logical value. It is called after the addition of each simulated event. The simulation continues until either
The thinning method (Ogata, 1981; Lewis & Shedler, 1979) is used to simulate a point process with specified ground intensity function. The method involves calculating an upper bound for the intensity function, simulating a value for the time to the next possible event using a rate equal to this upper bound, and then calculating the intensity at this simulated point; hence these “events” are simulated too frequently. The ratio of this rate with the upper bound is compared with a uniform random number to randomly determine whether the simulated time is retained or not (i.e. thinned).
The functions need to calculate an upper bound for the intensity function. The ground intensity functions will usually be discontinuous at event times, but may be monotonically increasing or decreasing at other times. The ground intensity functions have an attribute called
rate with values of
"decreasing". This information is used to determine the required upper bounded.
simulate.linksrm is currently only used in conjunction with
linksrm_gif, or a variation of that function. It expects the
gif function to have an attribute called
regions, which may be an expression, being the number of regions. The method used by the function
simulate.linksrm also assumes that the function is “increasing” (i.e. rate, summed over all regions, apart from discontinuous jumps), hence a positive tectonic input over the whole system.
The returned value is an object of the same class as
object. It will contain all events prior to
object$data and all subsequently simulated events. Variables (columns) in
object$data will be restricted to
"time" and those for which a mark is simulated.
The interval of time over which events are simulated is determined by
object$TT. Simulation starts at
object$TT and stops at
object$TT. The “current” dataset will consist of all events prior to
object, plus subsequently simulated events. A more complicated stopping condition can be formulated by using the argument
stop.condition can be assigned a function that returns a logical value. The assigned function is a function of the “current” dataset. It is executed near the bottom of
simulate.mpp (check by printing the function). Simulation will then continue until either the stopping condition has been met or the current time exceeds
For example, we may want to simulate until the first earthquake with a magnitude of 8. Assume that the current dataset contains a variable with name
"magnitude" (untransformed). We would then assign
object$TT, and write this condition as a function:
1 2 3 4 5
Cited references are listed on the PtProcess manual page.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
TT <- c(0, 1000) bvalue <- 1 params <- c(-2.5, 0.01, 0.8, bvalue*log(10)) x <- mpp(data=NULL, gif=srm_gif, marks=list(NULL, rexp_mark), params=params, gmap=expression(params[1:3]), mmap=expression(params), TT=TT) x <- simulate(x, seed=5) y <- hist(x$data$magnitude, xlab="Magnitude", main="") # overlay with an exponential density magn <- seq(0, 3, length.out=100) points(magn, nrow(x$data)*(y$breaks-y$breaks)* dexp(magn, rate=1/mean(x$data$magnitude)), col="red", type="l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.