Description Usage Arguments Details Author(s) References Examples
Generates a time Series generated by the DISCRETIZED version of the general symmetric map (gsm) and computes the likelihood given the data
1 | Lik_Dgsm_cpp(alpha, r, x0, Y, sigma, N_discr)
|
alpha |
double - exponent of gsm |
r |
double - control parameter of gsm |
x0 |
double - initial value of the time series |
Y |
vector of type double - the given data |
sigma |
double - the standard deviation of the gaussian likelihood |
N_discr |
integer - discretization of the state space |
This routine is implemented in C++
J.C. Lemm, P. v.W. Crommelin
S. Sprott, Chaos and Time-series analysis
1 2 3 4 5 6 7 8 9 10 11 12 | //C++ DEFINITION:
double Lik_Dgsm_cpp(double alpha, double r, double x0, Rcpp::NumericVector Y, double sigma, int N_discr){
int n = Y.size();
bool skipFirst = true;
Rcpp::NumericVector X = Dgsm_iter_cpp(n,x0,r,alpha,N_discr,skipFirst);
double sum = 0;
for(int i = 0; i<n ; i++){
sum += pow(Y[i]-X[i],2.0);
}
double L = pow(2.0*PI*pow(sigma,2),-0.5*n)*exp(-0.5*sum/pow(sigma,2.0));
return(L);
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.