Description Usage Arguments Value Examples
The function simulates multivariate data with Poisson and normal components with a pre-specified correlation matrix and marginal distributions.
1 | genPoisNor(n, no.norm, no.pois, cmat.star, lamvec, sd.vec, mean.vec)
|
n |
Number of rows |
no.pois |
Number of Poisson variables. |
no.norm |
Number of normal variables. |
cmat.star |
The intermediate correlation matrix obtained from |
lamvec |
A vector of marginal rates for Poisson variables. |
mean.vec |
A vector of means for the normal variables. |
sd.vec |
A vector of standard deviations for the normal variables. |
A matrix of size n \times (no.pois + no.norm), of which first no.pois
are Poisson variables.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
lamvec= c(0.05,0.07,0.09)
M=c(0.352, 0.265, 0.342, 0.09, 0.141, 0.121, 0.297,
-0.022, 0.177, 0.294, -0.044, 0.129, 0.1, 0.354, 0.386)
N=diag(6)
N[lower.tri(N)]=M
TV=N+t(N)
diag(TV)<-1
cstar = cmat.star(no.pois=3, no.norm=3, TV, lamvec)
mydata=genPoisNor(n=200, no.norm=3, no.pois=3, cmat.star=cstar,
lamvec, sd.vec=c(1,1,1), mean.vec=c(0,0,0))
## End(Not run)
|
Loading required package: mvtnorm
Loading required package: corpcor
Loading required package: Matrix
....................................
....................................
.....................
..................
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.