I want to make a vector/data list of a new set of values derived from 3 different distributions, two are lnorm
and 1 is a mixed uniform distribution. I need to sum generated values of each of these distributions into one value (v1+v2+v3), in order to fit a distribution to the sum of the 3 distributions.
My code does not summarize the sum of distributions into one dataset (with function: list) and I am unsure whether the UnivarMixingDistribution function part of the code works? I want it to generate one value and save it into xv3 and add it to the two other values.
Error shown is:
In e[i] <- list(v1, v2, xv3) :
number of items to replace is not a multiple of replacement length
code:
e <- list(mode="vector",length=n)
for(i in 1:1000){
v1=rlnorm(n, mean, sd) #simulate values for lnorm distribution
v2=rlnorm(n, mean, sd)
v3=myMixv4<-UnivarMixingDistribution(Unif(Min=, Max=), #1st distribution
Unif(Min=, Max=), #2nd distribution
mixCoeff=c((ND/n),
(Detected/n)))
rmyMixv3<-r(myMixv3)
xv3 <- rmyMixv3(1)
e[i] <- list(v1,v2,xv3)
}