I currently work with the mixture model package EMMIXskew
and I have fitted a skew-t Distribution on my data (some numerical vector).
The package has some density function ddmst
but I haven't seen a probability density function in this package and I need some!
What I thought I could do is
- use some other packages which provides a pdf for skew-t distribution,
like package
sn
withpst
, but the problem is that this distribution has a different definition of skew-t distribution, OR - I could use
integrate
onddmst
, but it doesn't work so far.
I tried something like
library(EMMIXskew)
dat <- rdmst(n=1000,p=1,mean=0,cov=1,del=1)
mu=0.01
sigma=0.9
nu=1.1
del=3
pdmst <- function(x){
ddmst(x,n=length(dat),p=1,mean=mu,cov=sigma,nu=nu,del=del)
}
x=0.6
F_x <- integrate(pdmst,lower=-Inf,upper=x)
and also if I assume 3-modality of my data with parameters
mu=c(0.01,2,-0.4)
sigma=c(0.9,2,2.3)
nu=c(1.1,1,0.8)
del=c(3,2,1.2)
pdmst <- function(x){
ddmst(x,n=length(dat),p=1,mean=mu,cov=sigma,nu=nu,del=del)
I get this error
Error in ddmix(dat, n, p, 1, "mst", mean, cov, nu, del) : dat does not match n and p.
I really don't know what I did wrong!