Lik_Dgsm_cpp: Gaussian likelihood for given data

Description Usage Arguments Details Author(s) References Examples

View source: R/RcppExports.R

Description

Generates a time Series generated by the DISCRETIZED version of the general symmetric map (gsm) and computes the likelihood given the data

Usage

1
Lik_Dgsm_cpp(alpha, r, x0, Y, sigma, N_discr)

Arguments

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

Details

This routine is implemented in C++

Author(s)

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

References

S. Sprott, Chaos and Time-series analysis

Examples

 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);
}

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