Description Usage Arguments Examples
tupolyn
polynomial regression of the N-th order of time-uncertain time series.
1 |
y |
A vector of observations. |
ti.mu |
A vector of estimates of timing of observations. |
ti.sd |
A vector of standard deviations of timing. |
n.sim |
A number of simulations. |
CV |
cross-validation indicator. |
... |
A list of optional parameters. The list contains polynomial order with the default value set to polyorder=3, thinning parameter, with the default value set to Thin=4, and the number of mcmc chains with the default value set to n.chains=2. |
polyorder |
Order of the polynomial regression. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Import or simulate the data (simulation is chosen for illustrative purposes):
DATA=simtuts(N=50,Harmonics=c(10,30,0), sin.ampl=c(10,10, 0), cos.ampl=c(0,0,0), trend=0,y.sd=3, ti.sd=1)
y=DATA$observed$y.obs
ti.mu=DATA$observed$ti.obs.tnorm
ti.sd= rep(1, length(ti.mu))
# Set parameters and run the polynomial regression:
polyorder=2
n.sim=1000
PN=tupolyn(y=y,ti.mu=ti.mu,ti.sd=ti.sd,polyorder=polyorder,n.sim=n.sim, CV=TRUE)
# Generate summary results (optional parameters are listed in brackets):
summary(PN) # Summary statistics (burn, CI).
# Plots and diagnostics (optional parameters are listed in brackets):
plot(PN,type='predTUTS',CI=0.95) # One step out of salmple predictions of the model (CI, burn).
plot(PN,type='cv',burn=0.3) # 5 fold cross-validation (CI, burn).
plot(PN,type='GR',CI=0.95) # Gelman-Rubin diagnostic (CI).
plot(PN,type='mcmc') # MCMC diagnostics.
plot(PN,type='volatility') # Volatility realizaitons.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.