Description Usage Arguments Details Value Author(s) References Examples

This function computes a Bayesian joint scedasis density estimate generating a posterior sample of a finite Mixture of Polya trees.

1 2 | ```
cPTdensity(XY, tau = 0.95, raw = TRUE, prior, mcmc, state,status, data =
sys.frame(sys.parent()), na.action = na.fail)
``` |

`XY` |
data frame from which the estimate is to be computed; first
column corresponds to time, the second and third columns correspond
to the variables of interest |

`tau` |
value used to threshold the data |

`raw` |
logical; if |

`prior` |
a list giving the prior information. The list includes the
following parameter: |

`mcmc` |
a list giving the MCMC parameters. The list must include
the following integers: |

`state` |
a list giving the current value of the parameters. This list is used if the current analysis is the continuation of a previous analysis. |

`status` |
a logical variable indicating whether this run is new
( |

`data` |
data frame. |

`na.action` |
a function that indicates what should happen when the data
contain |

This function learns about the joint scedasis function using a Mixture of Polya Trees (MPT) prior as proposed in Palacios and de Carvalho (2020). In the particular case where XY contains no third column, the function learns about the scedasis function of Einmahl et al (2016) using an MPT prior. The details are as follows. Let

*Z_i = min(X_i, Y_i)*

. The model is given by:

*Z1,...,Zn | G ~ G*

*G | alpha,a,b ~ PT(Pi^{al,be},\textit{A})*

where, the the PT is centered around a *Beta(al,be)* distribution, by taking each *m* level of the partition *Π^{al, be}* to coincide
with the *k/2^m, k=0,…,2^m* quantile of the *Beta(al,be)* distribution.
The family *\textit{A}={alphae: e \in E^{*}}*,
where *E^{*}=\bigcup_{m=0}^{M} E^m*
and *E^m* is the *m*-fold product of *E=\{0,1\}*,
was specified as *alpha{e1 … em}=α m^2*.

In the univariate case,the following proper priors can be assigned:

*al | m0, S0 ~ LNormal(m0,S0)*

*be | tau1, tau2 ~ LNormal(tau1,tau2)*

To complete the model specification, independent hyperpriors are assumed,

*alpha | a0, b0 ~ Γ(a0,b0)*

The precision parameter, *alpha*, of the `PT`

prior
can be considered as random, having a `gamma`

distribution, *Γ(a0,b0)*,
or fixed at some particular value. To let *alpha* to be fixed at a particular
value, set *a0* to NULL in the prior specification.

In the computational implementation of the model, Metropolis–Hastings steps are used to sample the posterior distribution of the baseline and precision parameters.

`c` |
Joint scedasis density estimator. |

`k` |
number of exceedances above the threshold. |

`w` |
standardized indices of exceedances. |

`Y` |
raw data. |

`al` |
giving the value of the baseline shape parameter. |

`be` |
giving the value of the baseline scale parameter. |

`alpha` |
giving the value of the precision parameter. |

The `plot`

method depicts the estimated joint scedasis density.

Miguel de Carvalho and Vianey Palacios

Palacios, V., de Carvalho, M. (2020) Bayesian semiparametric modeling
of jointly heteroscedastic extremes. *Preprint.*

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 | ```
## Not run:
## Example from Palacios and de Carvalho (2020, submitted)
library(evd)
## Initial state
state <- NULL
## MCMC parameters
nburn <- 2000
nsave <- 1000
nskip <- 0
ndisplay <- 500
mcmc <- list(nburn=nburn,nsave=nsave,nskip=nskip,ndisplay=ndisplay,
tune1=1.1,tune2=1.1,tune3=1.1)
## Prior information
prior<-list(a0=1,b0=1,M=8,m0=.01,S0=.01,tau1=.01,tau2=.01);
T <- 5000
time <- seq(1/T, 1, by = 1/T)
set.seed(12333)
aux <- matrix(0, T, 2)
for (i in 1:T) {
aux[i,]<-rbvevd(1, dep =.5, asy=c(sin(pi*time[i]),time[i]),
model="alog",mar1 = c(1, 1, 1), mar2 = c(1, 1, 1))
}
XY <- cbind(time, aux)
fit <- cPTdensity(XY, prior = prior, mcmc = mcmc, state = state, status =
TRUE)
plot(fit)
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.