# set.to.class: Building of model classes In SimoneHermann/BaPreStoPro: Bayesian Prediction of Stochastic Processes

## Description

Definition of the model classes.

## Usage

 ```1 2 3 4``` ```set.to.class(class.name = c("jumpDiffusion", "Merton", "Diffusion", "mixedDiffusion", "hiddenDiffusion", "hiddenmixedDiffusion", "jumpRegression", "NHPP", "Regression", "mixedRegression"), parameter, prior, start, b.fun, s.fun, h.fun, sT.fun, y0.fun, fun, Lambda, priorDensity) ```

## Arguments

 `class.name` name of model class `parameter` list of parameter values `prior` optional list of prior parameters `start` optional list of starting values `b.fun` drift function b `s.fun` variance function s `h.fun` jump high function h `sT.fun` variance function \widetilde{s} `y0.fun` function for the starting point, if dependent on parameter `fun` regression function `Lambda` intensity rate of Poisson process `priorDensity` list of functions for prior densities, if missing: non-informative estimation

## Details

`set.to.class` is the central function to define a S4 model class, where the `simulate` and the `estimate` methods build up. Main input parameter is `class.name`, which is one out of "jumpDiffusion", "Merton", "Diffusion", "mixedDiffusion", "hiddenDiffusion", "hiddenmixedDiffusion", "jumpRegression", "NHPP", "Regression" and "mixedRegression", which is the name of the class object containing all information of the model. If you write `set.to.class(class.name)` without any further input parameter, the function tells you which entries the list `parameter` has to contain. This is the second central input parameter. If input parameter `start` is missing, it is set to `parameters`. If input parameter `prior`, which is a list of prior parameters, is missing, they are calculated from `parameter` in that way, that prior mean and standard deviation is equal to the entries of `parameter`. Functions `b.fun, s.fun, h.fun` can be seen in the model definition of the jump diffusion dY_t = b(φ, t, Y_t)dt + s(γ^2, t, Y_t)dW_t + h(θ, t, Y_t)dN_t. In the case of a continuous diffusion, one out of "Diffusion", "mixedDiffusion", "hiddenDiffusion" or "hiddenmixedDiffusion", variance function s(γ^2, t, y) is restricted to the case s(γ^2, t, y)=γ\widetilde{s}(t, y). `sT.fun` stands for \widetilde{s}(t, y). In the case of a regression model, "Regression" or "mixedRegression", `sT.fun` means the variance function dependent on t of the regression error ε_i\sim N(0,σ^2\widetilde{s}(t)). In both cases, default value is `sT.fun = function(t, y) 1`. `y0.fun` is for the models, where the starting value depends on the parameter phi, "mixedDiffusion", "hiddenDiffusion" or "hiddenmixedDiffusion". Default value is a constant function in 1. `fun` is the regression function for the models "Regression", "mixedRegression" and "jumpRegression". In the first two cases, this is f(φ, t) and in the third f(t, N_t, θ). Function `Lambda` is the cumulative intensity function in the models including the non-homogeneous Poisson process. Input parameter `priorDensity` is for the model class `jumpDiffusion-class` a list of functions for the prior density functions. For the model classes `NHPP-class` and `Merton-class`, `priorDensity` is the density of the intensity rate parameter of the Poisson process. Default is a non-informative approach for all cases.

## Examples

 ```1 2 3 4 5``` ```set.to.class("jumpDiffusion") (names <- set.to.class("jumpDiffusion")) model <- set.to.class("jumpDiffusion", parameter = list(theta = 0.1, phi = 0.01, gamma2 = 0.1, xi = 3)) summary(class.to.list(model)) ```

SimoneHermann/BaPreStoPro documentation built on May 10, 2017, 1:42 p.m.