Dgsm_iter_cpp: Time series creation with discretized output

Description Usage Arguments Details Value Author(s) Examples

View source: R/RcppExports.R

Description

Create time series produced by discrete model of the general symmetric map

Usage

1
Dgsm_iter_cpp(N, x0, r, alpha, N_discr, skipFirst)

Arguments

N

integer - Number of iterations

x0

double - starting value

r

double - controll parameter

alpha

double - exponent of general symmetric map

N_discr

integer - controlls discretization of state space

skipFirst

Boolean - If set to FALSE, the resulting time series contains the initial value x0

Details

This routine is implemented in C++

Value

vector of type double - the resulting time series

Author(s)

J.C. Lemm, P. v.W. Crommelin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
//C++ DEFINITION
Rcpp::NumericVector Dgsm_iter_cpp(int N, double x0, double r, double alpha, int N_discr, bool skipFirst){
  Rcpp::NumericMatrix A = getMat(r,alpha,N_discr);
  //create vector from starting value
  Rcpp::NumericVector x = valToVec_cpp(x0,N_discr);
  Rcpp::NumericVector Series(N);
  //initialization
  if(skipFirst){
    x = dotProd(A,x);
  }
  Series[0] = vecToVal_cpp(x);
  for(int i=1 ; i<N ; i++){
    x = dotProd(A,x);
    Series[i] = vecToVal_cpp(x);
  }
  return(Series);
}

PhilippVWC/myBayes documentation built on Oct. 2, 2020, 8:25 a.m.