[R] Skewed t distribution

Adelchi Azzalini azzalini at stat.unipd.it
Tue Mar 28 13:56:04 CEST 2006


On Tue, 28 Mar 2006 13:11:02 +0200, Konrad Banachewicz wrote:

KB> P is an identity matrix 240X240, mu and alpha are vectors of zeros
KB> 240X1, nu equals 10, so alltogether You need:
KB> P <- matrix(0,244,244)
KB> diag(P) <- 1
KB> nu <- 10
KB> alpha <- rep(0,244)
KB> mu <- rep(0,244)
KB> require(sn)
KB> t1 <- rmst(1,mu,P, alpha, nu)
KB> t2 <- dmst(t1,mu,P,alpha,nu)
KB> 
KB> 

With such a large dimension, numerical problems are obiquitous.
At the very least, I suggest that you work on the log scale:

R> t2 <- dmst(t1,mu,P,alpha,nu, log=TRUE)
R> t2
[1] -250.3
R> exp(t2)
[1] 2.002e-109


The next release of the 'sn' package will handle this sort of things
in a more consisent way (the R code is largely updated, but the
documentation is far behind..)



-- 
Adelchi Azzalini  <azzalini at stat.unipd.it>
Dipart.Scienze Statistiche, Università di Padova, Italia
tel. +39 049 8274147,  http://azzalini.stat.unipd.it/


KB> 
KB> >
KB> > please supply the ingredients needed to reproduce the problem
KB> > that you have faced (including the values of the parameters
KB> > mu,P,alpha,nu, among the rest)
KB> >
KB> > best wishes,
KB> >
KB> > Adelchi Azzalini
KB> >
KB> >
KB>




More information about the R-help mailing list