R/RcppExports.R

Defines functions rwme

Documented in rwme

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' @title Random Walk using Rcpp
#' @description A Random Walk sampler using Rcpp
#' @param sigma the standard deviation of the normal random increment with a zero mean 
#' @param x0 the initial iteration point
#' @param N the designated number of random numbers (including the initial point x0)
#' @return the sample
#' @examples
#' \dontrun{
#' laplace<-function(x) return(1/2*exp(-abs(x)))
#' lapC <- rwme(2,25,2000);
#' plot(1:2000,lapC,type='l')
#' abline(h=c(-3*sqrt(2),3*sqrt(2)))
#' }
#' @export
rwme <- function(sigma, xo, N) {
    .Call('_SC19074_rwme', PACKAGE = 'SC19074', sigma, xo, N)
}
wangq326/SC19074 documentation built on Jan. 2, 2020, 8:48 p.m.