Description Usage Arguments Value See Also Examples
The maxlik.*
function family computes the
maximum likelihood from data of a max-stable distribution or in the maximum
domain of attraction of a max-stable distribution. *
must be one of the following: "maxstable
", "excess
" or "simultoccur
".
1 2 3 |
... |
all the arguments to be passed to the likelihood function including:
|
returns a list l
including the following components:
l$estimate
giving the estimated parameter values, l$message
giving a short message describing if the convergence is successfull,
l$iterations
giving the number of iterations...
maxLik
, maxstable.l.clusters
, excess.l
, simultoccur.l
.
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 | # ML estimation for a sample from a Schlather max-stable distribution
# (Use larger values for n.site and n.obs to get good results!)
n.site<-2
n.obs<-2
xy<-matrix(runif(2 * n.site, 0, 0.5), ncol = 2)
param<-c(0.5,1.5)
library(SpatialExtremes)
data<-t(rmaxstab(n.obs, xy, "whitmat",
nugget = 0, range = param[1], smooth = param[2]))
ml<-maxlik.maxstable(data,params=c(NA,NA),start=c(1,1),
category="normal",
spatial=list(sites=xy,family=spatialWhittleMatern),
iterlim=4)
# ML estimation for a sample in the max domain of attraction
# of from an homogeneous clustered max-stable distribution
#
# WARNING: these exemples are quite time-consuming, but yet need
# larger values for n and the dimensions for correct results
# A) using excess
raw.data<-rCMS(copulas=c(copClayton,copGumbel),
margins=c(marginLnorm,marginFrechet),
classes=c(rep(1,3),rep(2,3)),
params=c(0.5,1,1.5,1.7),n=20)
data<-excess.censor(raw.data)
d<-dens.grid.excess(data,c(NA,1,NA,1.7),
seq(0.1,1,length=5),seq(1,2,length=5),
category="copula",
copulas=c(copClayton,copGumbel),
margins=c(marginLnorm,marginFrechet),
classes=c(rep(1,3),rep(2,3)))
plot3d.densgrid(d)
ml<-maxlik.excess(data,
params=c(NA,NA,NA,NA),start=c(0.5,1,1.5,1.7),
trace=TRUE,iterlim=20,
category="copula",
copulas=c(copClayton,copGumbel),
margins=c(marginLnorm,marginFrechet),
classes=c(rep(1,3),rep(2,3)))
# B) using block maxima with occurences
raw.data<-rCMS(copulas=c(copClayton,copGumbel),
margins=c(marginLnorm,marginFrechet),
classes=c(rep(1,3),rep(2,3)),
params=c(0.5,1,1.5,1.7),n=10)
data<-maxblocks(raw.data,n.blocks=2)
d<-dens.grid.simultoccur(data$normalized.max,occur=data$classes.max,
c(NA,1,NA,1.7),
seq(0.1,1,length=5),seq(1,2,length=5),
category="copula",
copulas=c(copClayton,copGumbel),
margins=c(marginLnorm,marginFrechet),
classes=c(rep(1,3),rep(2,3)))
plot3d.densgrid(d)
ml<-maxlik.simultoccur(data$normalized.max,
params=c(NA,NA,NA,NA),start=c(0.5,1,1.5,1.7),
trace=TRUE,iterlim=20,
occur=data$classes.max,
category="copula",
copulas=c(copClayton,copGumbel),
margins=c(marginLnorm,marginFrechet),
classes=c(rep(1,3),rep(2,3)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.