condhparetomixt: The conditional hybrid Pareto mixture distribution

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Distribution function for the conditional hybrid Pareto mixture with and without discrete component at zero and density function for the conditional hybrid Pareto mixture without discrete component.

Usage

1
2
3

Arguments

params

m x 4 x n matrix of mixture parameters where n is the number of examples for condhparetomixt and (4m+1) x n matrix for condhparetomixt.dirac

m

Number of mixture components.

y

Vector of n dependent variables.

log

logical, if TRUE, probabilities p are given as log(p).

trunc

logical, if TRUE (default), the hybrid Pareto density is truncated below zero. A mixture with a Dirac component at zero is always truncated below zero.

Details

params can be computed from the forward functions on the explanatory variables x of dimension d x n associated with y : condhparetomixt.fwd and condhparetomixt.dirac.fwd

Value

Distribution function evaluated at n points for pcondhparetomixt and pcondhparetomixt.dirac and density function for dcondhparetomixt.

Author(s)

Julie Carreau

References

Carreau, J. and Bengio, Y. (2009), A Hybrid Pareto Mixture for Conditional Asymmetric Fat-Tailed Distributions, 20, IEEE Transactions on Neural Networks

See Also

condmixt.nll, condmixt.fwd

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
# generate train data with a mass at zero
ntrain <- 200
xtrain <- runif(ntrain,0,2*pi)
alpha.train <- sin(2*xtrain)/2+1/2
data.train <- rep(0,ntrain)
for (i in 1:ntrain){
  if (sample(c(0,1),1,prob=c(1-alpha.train[i],alpha.train[i]))){
   # rainy day, sample from a Frechet
    data.train[i] <-rfrechet(1,loc=3*sin(2*xtrain[i])+4,scale=1/(1+exp(-(xtrain[i]-1))),
                    shape=(1+exp(-(xtrain[i]/5-2))))
  }
}

plot(xtrain,data.train,pch=20)


h <- 4 # number of hidden units
m <- 2 # number of components

# initialize a conditional mixture with hybrid Pareto components and a dirac at zero
thetainit <- condhparetomixt.dirac.init(1,h,m,data.train)


# compute mixture parameters on test data
params.mixt <- condhparetomixt.dirac.fwd(thetainit,h,m,t(xtrain))



cdf <- pcondhparetomixt.dirac(params.mixt,m,data.train) # compute CDF on test data

condmixt documentation built on July 1, 2020, 6:04 p.m.