Enable weights in startfun (dist_modchol)
Trying to check modchol disttree family:
devtools::load_all()
data(simdata)
y <- simdata$y
d <- simdata$d
df <- dist_mvn_modchol(3)
fit_dist <- df$startfun(y)
library(bamlss)
bfam <- mvnchol_bamlss(3, "modified")
# check changes in mu
eta_to_par <- function(eta, y) {
par <- list()
for (i in seq_along(eta)) par[[i]] <- rep(eta[[i]], nrow(y))
names(par) <- names(fitted(b))
for (i in 4:6) par[[i]] <- rep(exp(eta[[i]]), nrow(y))
par
}
par <- eta_to_par(fit_dist, y)
xpar <- par
x <- runif(nrow(y), -1, 1)
xpar[["mu2"]] <- ifelse(x > 0, xpar[["mu2"]], xpar[["mu2"]] + .5)
yy <- bfam$r(xpar)
library(disttree)
dt <- disttree(yy ~ x, family = df)
But startfun()
needs weights
here: https://git.uibk.ac.at/c4031039/mvnchol/-/blob/master/R/dist_modchol.R#L134