timeseries1D generates a one-dimensional Langevin process using a
simple Euler integration. The drift function is a cubic polynomial, the
diffusion funcation a quadratic.
a scalar denoting the length of the time-series to generate.
startpoint
a scalar denoting the starting point of the time series.
d13,d12,d11,d10
scalars denoting the coefficients for the drift polynomial.
d22,d21,d20
scalars denoting the coefficients for the diffusion polynomial.
sf
a scalar denoting the sampling frequency.
dt
a scalar denoting the maximal time step of integration. Default
dt=0 yields dt=1/sf.
Value
timeseries1D returns a time-series object of length
N with the generated time-series.
Author(s)
Philip Rinn
See Also
timeseries2D
Examples
# Generate standardized Ornstein-Uhlenbeck-Process (d11=-1, d20=1)
# with integration time step 0.01 and sampling frequency 1
s <- timeseries1D(N=1e4, sf=1, dt=0.01);
t <- 1:1e4;
plot(t, s, t="l", main=paste("mean:", mean(s), " var:", var(s)));
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Langevin)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Langevin/timeseries1D.Rd_%03d_medium.png", width=480, height=480)
> ### Name: timeseries1D
> ### Title: Generate a 1D Langevin process
> ### Aliases: timeseries1D
>
> ### ** Examples
>
> # Generate standardized Ornstein-Uhlenbeck-Process (d11=-1, d20=1)
> # with integration time step 0.01 and sampling frequency 1
> s <- timeseries1D(N=1e4, sf=1, dt=0.01);
> t <- 1:1e4;
> plot(t, s, t="l", main=paste("mean:", mean(s), " var:", var(s)));
>
>
>
>
>
> dev.off()
null device
1
>