Description Usage Arguments Details Value Author(s) Examples
Create time series produced by discrete model of the general symmetric map
1 | Dgsm_iter_cpp(N, x0, r, alpha, N_discr, skipFirst)
|
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 |
This routine is implemented in C++
vector of type double - the resulting time series
J.C. Lemm, P. v.W. Crommelin
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);
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.