setSampling: Set sampling information and create a 'sampling' object.

View source: R/yuima.sampling.R

setSamplingR Documentation

Set sampling information and create a ‘sampling’ object.

Description

setSampling is a constructor for yuima.sampling-class.

Usage

  setSampling(Initial = 0, Terminal = 1, n = 100, delta, 
   grid, random = FALSE, sdelta=as.numeric(NULL), 
   sgrid=as.numeric(NULL), interpolation="pt" )

Arguments

Initial

Initial time of the grid.

Terminal

Terminal time of the grid.

n

number of time intervals.

delta

mesh size in case of regular time grid.

grid

a grid of times for the simulation, possibly empty.

random

specify if it is random sampling. See Details.

sdelta

mesh size in case of regular space grid.

sgrid

a grid in space for the simulation, possibly empty.

interpolation

a rule of interpolation in case of subsampling. By default, the previous tick interpolation. See Details.

Details

The function creates an object of type yuima.sampling-class with several slots.

Initial:

initial time of the grid.

Terminal:

terminal time fo the grid.

n:

the number of observations - 1.

delta:

in case of a regular time grid it is the mesh.

grid:

the grid of times.

random:

either FALSE or the distribution of the random times.

regular:

indicator of whether the grid is regular or not. For internal use only.

sdelta:

in case of a regular space grid it is the mesh.

sgrid:

the grid in space.

oindex:

in case of interpolation, a vector of indexes corresponding to the original observations used for the approximation.

interpolation:

the name of the interpolation method used.

In case of subsampling, the observations are subsampled on some given grid/sgrid or according to some random times. When the original observations do not exist at a give point of the grid they are obtained by some approximation method. Available methods are "pt" or "previous tick" observation method, "nt" or "next tick" observation method, or by l"linear" interpolation. In case of interpolation, the slot oindex contains the vector of indexes corresponding to the original observations used for the approximation. For the linear method the index corresponds to the left-most observation.

The slot random is used as information in case a grid is already determined (e.g. n or delta, etc. ot the grid itself are given) or if some subsampling has occurred or if some particular method which causes a random grid is used in simulation (for example the space discretized Euler scheme). The slot random contains a list of two elements distr and scale, where distr is a the distribution of independent random times and scale is either a scaling constant or a scaling function. If the grid of times is deterministic, then random is FALSE.

If not specified and random=FALSE, the slot grid is filled automatically by the function. It is eventually modified or created after the call to the function simulate.

If delta is not specified, it is calculated as (Terminal-Initial)/n). If delta is specified, the Terminal is adjusted to be equal to Initial+n*delta.

The vectors delta, n, Initial and Terminal may have different lengths, but then they are extended to the maximal length to keep consistency. See examples.

If grid is specified, it takes precedence over all other arguments.

Value

An object of type yuima.sampling-class.

Author(s)

The YUIMA Project Team

Examples

samp <- setSampling(Terminal=1, n=1000)
str(samp)

samp <- setSampling(Terminal=1, n=1000, delta=0.3)
str(samp)


samp <- setSampling(Terminal=1, n=1000, delta=c(0.1,0.3))
str(samp)

samp <- setSampling(Terminal=1:3, n=1000)
str(samp)

yuima documentation built on Nov. 14, 2022, 3:02 p.m.

Related to setSampling in yuima...