1 | llik_st(pars, setoftrees, impsam = F)
|
pars |
parameters the set of trees |
setoftrees |
list with a set of trees |
impsam |
if impsam=TRUE, then the likelihood will be adjusted by importance scalings weights, included on the list of trees |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (pars, setoftrees, impsam = F)
{
m = length(setoftrees)
l = NULL
for (i in 1:m) {
s = setoftrees[[i]]
if (impsam) {
weight = s$weight
if (weight == 0) {
l[i] = 0
}
else {
l[i] = llik(b = pars, n = s$n, E = s$E, t = s$wt) *
weight
}
}
else {
l[i] = llik(b = pars, n = s$n, E = s$E, t = s$wt)
}
}
L = sum(l)
return(L)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.