## 3 data streams, each with one distribution
# normal data with mean 0 and sd 1
x1 = rnorm(100, mean = 0, sd = 1)
# gamma data with mean 5 and sd 3
x2 = rgamma2(100, mean = 5, sd = 3)
# circular data
x3 = rvm(100, mu = 0, kappa = 2)
data = data.frame(x1 = x1, x2 = x2, x3 = x3)
par = list(x1 = list(mean = 0, sd = 1),
x2 = list(mean = 5, sd = 3),
x3 = list(mean = 0, concentration = 2))
SmoothDens = buildSmoothDens(data,
type = c("real", "positive", "circular"),
par)
# extracting objects for x1
Z1 = SmoothDens$Z$x1
S1 = SmoothDens$S$x1
coefs1 = SmoothDens$coef$x1
## one data stream, but mixture of two distributions
# normal data with mean 0 and sd 1
x = rnorm(100, mean = 0, sd = 1)
data = data.frame(x = x)
# now parameters for mixture of two normals
par = list(x = list(mean = c(0, 5), sd = c(1,1)))
SmoothDens = buildSmoothDens(data, par = par)
# extracting objects
Z = SmoothDens$Z$x
S = SmoothDens$S$x
coefs = SmoothDens$coef$x
Run the code above in your browser using DataLab