EstARTAp: Estimation of parameters of the the auxiliary Gaussian AR(p)...

Description Usage Arguments Value Note Examples

View source: R/EstARTAp.R

Description

Estimation of parameters of AR(p) model to simulate the auxiliary Gaussian process.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
EstARTAp(
  ACF,
  maxlag = 0,
  dist,
  params,
  NatafIntMethod = "GH",
  NoEval = 9,
  polydeg = 8,
  ...
)

Arguments

ACF

A vector with the target autocorrelation structure (including lag-0 coefficient that is equal to 1).

maxlag

A scalar incating the order of the AR(p) model. If maxlag=0, then the order of the model is p=(length(ACF)-1)

dist

A string indicating the quantile function of the target marginal distribution (i.e., the ICDF).

params

A named list with the parameters of the target distribution.

NatafIntMethod

A string ("GH", "Int", or "MC") indicating the intergation method to resolve the Nataf integral.

NoEval

A scalar indicating (default: 9) the number of evaluation points for the integration methods.

polydeg

A scalar indicating the order of the fitted polynomial. If polydeg=0, then another curve is fitted.

...

Additional named arguments for the selected "NatafIntMethod" method.

Value

A list with the parameters of the auxiliary Gaussian AR(p) model.

Note

Avoid the use of the "GH" method (i.e., NatafIntMethod='GH'), when the marginal(s) are discrete.

Examples

 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*csS # 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)

itsoukal/anySim documentation built on May 7, 2020, 11:57 p.m.