setLaw: Random Variable Constructor

View source: R/yuima.law.r

setLawR Documentation

Random Variable Constructor

Description

'setLaw' constructs an object of class yuima.law that contains user-defined random number generator, density, cdf, quantile function and characteristic function of a driving noise for a stochastic model.

Usage

setLaw(rng = function(n, ...) {
    NULL
}, density = function(x, ...) {
    NULL
}, cdf = function(q, ...) {
    NULL
}, quant = function(p, ...) {
    NULL
}, characteristic = function(u, ...) {
    NULL
}, time.var = "t", dim = NA)

Arguments

rng

A user defined function for the generation of the noise sample.

density

A user defined function for the computation of the noise density.

cdf

A user defined function for the computation of the noise cumulative distribution function.

characteristic

A user defined function for the computation of the characteristi function.

quant

A user defined function for the computation of the quantile.

time.var

A label of the time variable.

dim

Dimension of the noise.

Details

The constructor produces an yuima.law-object entirely specified by the user. This object can be employed in all stochastic processes available in yuima as a driving noise.

The minimal requirement for simulating the stochastic model is the specification of the rng function.

The density function is used internally in the qmleLevy function for the estimation of the Levy parameters.

Value

The constructor returns an object of class yuima.law

Note

There may be missing information in the description. Please contribute with suggestions and fixings.

Contacts: Lorenzo Mercuri lorenzo.mercuri@unimi.it

Author(s)

YUIMA TEAM

References

Masuda, H., Mercuri, L. and Uehara, Y. (2022), Noise Inference For Ergodic Levy Driven SDE, Electronic Journal of Statistics, 16(1), 2432-2474. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/22-EJS2006")}

Examples

## Not run: 
### The following example reports all steps 
### for the construction of an yuima.law
### object using the external R package 
### VarianceGamma available on CRAN

library(VarianceGamma)

## Definition of a yuima.law object 

# User defined rng
myrng <- function(n, eta, t){ 
          rvg(n, vgC = 0, sigma = sqrt(t), theta = 0, nu = 1/(eta*t))
}

# User defined density
mydens <- function(x, eta, t){
           dvg(x, vgC = 0, sigma = sqrt(t), theta = 0, nu = 1/(eta*t))
}

mylaw <- setLaw(rng = myrng, density = mydens, dim = 1)


## End(Not run)


yuima documentation built on April 16, 2025, 5:12 p.m.