Description Usage Arguments Details Examples
tuar1redf(y,ti.mu,ti.sd,n.sim,CV=FALSE,...)
estimates parameters of AR(1) model using specification described in
"Climate Time Series Analysis" by M.Mudelsee. We modify the model to account for time-uncertainty.
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 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. |
n.chains |
A number of chains. |
Model estimates the autocorrelation parameter with a certain bias, which is still present after correction. The model is also not suitable for estimation of negative values of autocorrelation.
We include this function for further validation of applicability of the REDFIT model, which is often used in spectral analysis of unevenly spaced data.
Note: the function tuar1 generates unbiased estimates, and is not limited to positive values unlike the tuar1redf.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 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))
# Run the tuar1redf model with cross validation:
n.sim=1000; n.chains=2
AR1REDF=tuar1redf(y=y,ti.mu=ti.mu,ti.sd=ti.sd,n.sim=n.sim,n.chains=n.chains, CV=TRUE)
# Generate summary results (optional parameters are listed in brackets):
summary(AR1REDF) # Summary statistics (urn, CI).
# Plots and diagnostics (optional parameters are listed in brackets):
plot(AR1REDF,type='predTUTS',burn=0.2,CI=0.99) # One step out of salmple predictions of the model (CI, burn).
plot(AR1REDF,type='par', burn=0.4) # Distributions of parameters; (burn).
plot(AR1REDF,type='mcmc') # mcmc diagnostics.
plot(AR1REDF,type='cv', burn=0.4) # 5 fold cross validation plot (CI, burn).
plot(AR1REDF,type='GR', burn=0.4) # Gelman-Rubin diagnostic (CI, burn).
plot(AR1REDF,type='tau') # Volatility realizaitons.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.