marks {PtProcess}R Documentation

Mark Distributions

Description

Contains densities and random number generators for some example mark distributions. The mark distributions can be multi-dimensional. Users can write their own functions, and general rules are given under “Details”.

Usage

dexp_mark(x, data, params)
rexp_mark(ti, data, params)

Arguments

ti scalar, time of an event.
x a data.frame of mark values at given times, often a subset of the history.
data a data.frame containing the history of the process, denoted below as Ht.
params numeric vector of parameters.

Details

The functions listed under “Usage” calculate the (mark) density and simulate earthquake magnitudes assuming an exponential distribution that is independent of the history of the process. This corresponds to the Gutenberg-Richter law.

All mark densities and random number generators have three arguments as shown in the examples above. Multi-parameter distributions have their parameters specified as a vector in the params argument. Other ancillary data or information can be passed into the function non formally, though one needs to be careful with names of other objects.

In the “Examples” below, the function dmagn_mark is an example where the density of the magnitude distribution is dependent on the value of the ground intensity function (etas_gif), and in this case, the history of the process. This function assumes that after large events, there is a deficit of smaller magnitude events with more larger magnitude events. It has seven parameters with parameters p_1, ..., p_5 relating to etas_gif. It assumes that the magnitude distribution is gamma (GammaDist), with a shape parameter given by

shape = 1 + sqrt{lambda_g(t|Ht)} * p_7 ,

where p_7 (p_7 > 0) is a free estimable parameter, and parameter p_6 is the scale parameter. Hence when lambda_g(t|Ht) is small, the magnitude distribution returns to the exponential distribution with an approximate rate of p_6 (i.e. Gutenberg Richter law).

Value

Mark density functions must return a vector with length being equal to the number of rows in x. Each element contains the joint density of the marks corresponding to each time (row) in x.
The random number generator simulates each mark for a single value of ti. It must return a list of simulated marks corresponding to the specified time ti. Further, the list must have its elements named, e.g. "magnitude", "longitude", "latitude", etc. Note that each component in the list will be of length one. A list is used (rather than a vector) because it allows marks to be character as well as numeric. For example, one mark might be the region name. See function rexample_mark in “Examples” below.

Examples

#   Below is an example of a 3-D mark distribution. Each component
#   is independent of each other and history, hence the arguments
#   ti and data do not occur in the function.

rexample_mark <- function(ti, data, params)
    return(list(magnitude=rexp(n=1, params[1]),
                longitude=rnorm(1, mean=params[2]),
                latitude=rnorm(1, mean=params[3])))

#-----------------------------------------------------------------
#   Below is an example of a density for magnitudes of events
#   in and etas model but where the magnitude density is
#   dependent on the value of the ground intensity function
#   and hence the history of the process (See Details above for
#   more explanation).

dmagn_mark <- function(x, data, params){
    lambda <- etas_gif(data, x[,"time"], params=params[1:5])
    y <- dgamma(x[,"magnitude"], shape=1+sqrt(lambda)*params[7],
                rate=params[6], log=TRUE)
    return(y)
}

[Package PtProcess version 3.1-0 Index]