Simulates model parameters with user-defined copulas and marginals.

mvrcop(n, mvdc, ...)

# S4 method for numeric,FLModelSim
mvrcop(n, mvdc, copula, ...)

Arguments

n

the number of iterations

mvdc

an FLModelSim object

...

arguments to be passed to the copula methods

copula

the name of the copula to be used

Value

an FLModelSim object with n groups of parameters

Examples

mm <- matrix(NA, ncol=3, nrow=3)
diag(mm) <- c(100, 0.001,0.001)
mm[upper.tri(mm)] <- mm[lower.tri(mm)] <- c(0.1,0.1,0.0003)
md <- ~linf*(1-exp(-k*(t-t0)))
prs <- FLPar(linf=120, k=0.3, t0=0.1, units=c("cm","yr^-1","yr"))
vb <- FLModelSim(model=md, params=prs, vcov=mm, distr="norm")
pars <- list(list(a=90, b=125, c=120), list(a=0.2, b=0.4), list(a=0, b=0.4, c=0.1))
vbSim <- mvrcop(10000, vb, copula="archmCopula", family="clayton", param=2, 
   margins="triangle", paramMargins=pars)
#> Warning: margins correct? Currently, have no function(s) named: ptriangle
#> Warning: margins correct? Currently, have no function(s) named: dtriangle
#> Error in qtriangle(x, a = 90, b = 125, c = 120): could not find function "qtriangle"
boxplot(t(predict(vbSim, t=0:20+0.5)))
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'predict': object 'vbSim' not found
splom(data.frame(t(params(vbSim)@.Data)), pch=".")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'splom': error in evaluating the argument 'object' in selecting a method for function 'params': object 'vbSim' not found