Description Usage Arguments Examples
tupoispn
performs estimation of parameters of Poisson N-th order polynomial regression 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. |
polyorder |
Order of the polynomial regression. |
CV |
cross-validation indicator. |
... |
optional arguments: |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # Note: Most of models included in tuts package are computationally intensive. In the example
# below I set parameters to meet CRAN's testing requirement of maximum 5 sec per example.
# A more practical example would contain N=50 in the first line of the code and n.sim=10000.
#1. Import or simulate the data (a simulation is chosen for illustrative purposes):
DATA=simtuts(N=10,Harmonics=c(4,0,0), sin.ampl=c(10,0, 0), cos.ampl=c(0,0,0),
trend=0,y.sd=2, ti.sd=0.2)
y=DATA$observed$y.obs
y=round(y-min(y))
ti.mu=DATA$observed$ti.obs.tnorm
ti.sd= rep(0.2, length(ti.mu))
#2. Fit the model:
polyorder=2
n.sim=1000
PPN=tupoispn(y=y,ti.mu=ti.mu,ti.sd=ti.sd,polyorder=polyorder,n.sim=n.sim,CV=TRUE,n.cores=2)
#3. Generate summary results (optional parameters are listed in brackets):
summary(PPN) # Summary results (burn, CI).
#4. Generate plots and diagnostics of the model (optional parameters are listed in brackets):
plot(PPN,type='predTUTS',CI=0.95) # One step out of salmple predictions (CI, burn).
plot(PPN,type='cv',burn=0.3) # 5 fold cross-validation (CI, burn).
plot(PPN,type='GR',CI=0.95) # Gelman-Rubin diagnostic (CI).
plot(PPN,type='mcmc') # MCMC diagnostics.
plot(PPN,type='lambda') # Volatility realizaitons.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.