Description Usage Arguments Value Examples
Simulation of stationary process with target marginal distribution and autocorrelation structure via ARTA(p) model.
1 | SimARTAp(ARTApar, burn = 1000, steps = 10000, stand = F)
|
ARTApar |
A list containing the parameters of the model. The list is generated by function "EstARTAp". |
burn |
A scalar specifying the length of burn-out sample. |
steps |
A scalar specifying the length of the time series to be generated. |
stand |
A boolean (T or F) indicating whether to standardize (or not) the auxiliary Gaussian time series prior to their mapping to the actual domain. The default value is FALSE. |
A list of the 3 generated time series (in vector format): X: The final time series at the target domain with the target marginal distribution and correlation structure; Z: The auxiliary Gaussian time series at the Gaussian domain and; U: The auxiliary uniform time series at the Copula domain (i.e., in [0,1]).
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | ## Simulation of univariate stationary process with Gamma marginal distribution
## and autocorrelation structure given by the product of a CAS and a periodic ACS.
## Not run:
set.seed(12)
# Define the target autocorrelation structure.
acsS=csCAS(param=c(3,0.6),lag=1000) # Stationary CAS with b=3 and k=0.6.
acsP=csPeriodic(param=c(12,1.5),lag=1000) # Periodic ACS with p=12 and l=1.5.
ACS=csP*acsS # The target ACS as product of the two previous ones.
# Define the target distribution function (ICDF).
FX='qgamma' # the Gamma distribution
# Define the parameters of the target distribution.
pFX=list(shape=5,scale=1)
# Estimate the parameters of the auxiliary Gaussian AR(p) model.
ARTApar=EstARTAp(ACF=ACS,maxlag=0,dist=FX,params=pFX,NatafIntMethod='GH')
# Generate a synthetic series of 10000 length.
SynthARTAcont=SimARTAp(ARTApar=ARTApar,steps=10^5)
## End(Not run)
## Simulation of univariate stationary process with discrete marginal distribution
## (Beta-Binomial) and autocorrelation structure given by CAS.
## Not run:
set.seed(16)
# Define the target autocorrelation structure.
ACS=acsCAS(param=c(1.5,0.3),lag=1000) # CAS with b=1.5 and k=0.3.
# Define the target distribution function (ICDF).
require(TailRank)
FX='qbb' # the Beta-Binomial distribution.
# Define the parameters of the target distribution.
pFX=list(N=10,u=3,v=10)
# Estimate the parameters of the auxiliary Gaussian AR(p) model.
ARTApar=EstARTAp(ACF=ACS,maxlag=0,dist=FX,params=pFX,NatafIntMethod="MC")
# Generate a synthetic series of 10000 length.
SynthARTAdiscr=SimARTAp(ARTApar=ARTApar,steps=10^5)
## End(Not run)
## Simulation of univariate stationary process with zero-inflated marginal distribution
## (Gen. Gamma for the continuous part) and autocorrelation structure given by CAS.
## Not run:
set.seed(18)
# Define the target autocorrelation structure.
ACS=acsCAS(param=c(0.91,1.09),lag=1000) # CAS with b=0.91 and k=1.09.
# Define the target distribution function (ICDF).
FX='qmixed' # Define that distribution is of zero-inflated type.
# Define the distribution for the continuous part of the process.
# Here, a re-parameterized version of Gen. Gamma distribution is used.
qgengamma=function(p,scale,shape1,shape2){
require(VGAM)
X=qgengamma.stacy(p=p,scale=scale,k=(shape1/shape2),d=shape2)
return(X)
}
# Define the parameters of the zero-inflated distribution function.
pFX=list(Distr=qgengamma,p0=0.8,scale=0.25,shape1=1.16,shape2=0.54)
# Estimate the parameters of the auxiliary Gaussian AR(p) model.
ARTApar=EstARTAp(ACF=ACS,dist=FX,params=pFX,NatafIntMethod="GH",NoEval=9,polydeg=0)
# Generate a synthetic series of 10000 length.
SynthARTAzi=SimARTAp(ARTApar=ARTApar,steps=10^5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.