Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tccDocument
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eduardo E. R. Junior
tccDocument
Commits
b2ca1cb3
Commit
b2ca1cb3
authored
8 years ago
by
Eduardo E. R. Junior
Browse files
Options
Downloads
Patches
Plain Diff
Cria chunk para geração de valores utilizados no texto
parent
d86d9930
No related branches found
No related tags found
1 merge request
!3
Correções e adequações do trabalho
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/cap04_resultados-e-discussao.Rnw
+38
-34
38 additions, 34 deletions
docs/cap04_resultados-e-discussao.Rnw
with
38 additions
and
34 deletions
docs/cap04_resultados-e-discussao.Rnw
+
38
−
34
View file @
b2ca1cb3
...
@@ -2307,6 +2307,44 @@ fonte("Fonte: Elaborado pelo autor.")
...
@@ -2307,6 +2307,44 @@ fonte("Fonte: Elaborado pelo autor.")
@
@
<<varspred-nematodes, include=FALSE>>=
##-------------------------------------------
## Obtendo os efeitos aleatórios
ranefP <- ranef(m2PM)$cult[, 1]
ranefC <- mixedcmp.ranef(m2CM)
ranef.all <- rbind(
data.frame(model = "PM", ranef = ranefP),
data.frame(model = "CM", ranef = ranefC))
##-------------------------------------------
## Valores preditos
pred <- with(
nematodes,
expand.grid(off = seq(min(off), max(off), length.out = 20),
cult = levels(cult))
)
X <- model.matrix(~log(off), data = pred)
## Pelo Poisson Mixed
aux <- predict(m2PM, newdata = pred, type = "link")
predPM <- data.frame(pred, y = exp(aux), model = "MP")
muPM <- data.frame(pred, mu = exp(X %*% fixef(m2PM)), model = "MP")
## Pelo COM-Poisson Mixed
aux <- predict(m2CM, newdata = pred, type = "link")
predCM <- data.frame(pred, y = calc_mean_cmp(aux, phi = m2CM@coef[1]),
model = "MC")
muCM <- data.frame(pred, mu = calc_mean_cmp(X %*% m2CM@coef[-(1:2)],
phi = m2CM@coef[1]),
model = "MC")
## Agrupa as predições
pred.all <- rbind(predPM, predCM)
mu.all <- rbind(muPM, muCM)
@
Conforme já observado anteriormente, no modelo COM-Poisson misto os
Conforme já observado anteriormente, no modelo COM-Poisson misto os
parâmetros $\phi$, da distribuição considerada para a variável de
parâmetros $\phi$, da distribuição considerada para a variável de
contagem condicional aos efeitos aleatórios e as covariáveis e $\sigma$,
contagem condicional aos efeitos aleatórios e as covariáveis e $\sigma$,
...
@@ -2338,14 +2376,6 @@ levam ao mesmo resultado.
...
@@ -2338,14 +2376,6 @@ levam ao mesmo resultado.
<<pred-nematodes, fig.height=4.2, fig.width=7.4, fig.cap="Perfis de verossimilhança dos parâmetros estimados no modelo COM-Poisson Misto.">>=
<<pred-nematodes, fig.height=4.2, fig.width=7.4, fig.cap="Perfis de verossimilhança dos parâmetros estimados no modelo COM-Poisson Misto.">>=
##-------------------------------------------
## Obtendo os efeitos aleatórios
ranefP <- ranef(m2PM)$cult[, 1]
ranefC <- mixedcmp.ranef(m2CM)
ranef.all <- rbind(
data.frame(model = "PM", ranef = ranefP),
data.frame(model = "CM", ranef = ranefC))
xy1 <- densityplot(
xy1 <- densityplot(
~ranef, groups = model,
~ranef, groups = model,
auto.key = list(
auto.key = list(
...
@@ -2358,32 +2388,6 @@ xy1 <- densityplot(
...
@@ -2358,32 +2388,6 @@ xy1 <- densityplot(
grid = TRUE,
grid = TRUE,
par.settings = ps.sub)
par.settings = ps.sub)
##-------------------------------------------
## Valores preditos
pred <- with(
nematodes,
expand.grid(off = seq(min(off), max(off), length.out = 20),
cult = levels(cult))
)
X <- model.matrix(~log(off), data = pred)
## Pelo Poisson Mixed
aux <- predict(m2PM, newdata = pred, type = "link")
predPM <- data.frame(pred, y = exp(aux), model = "MP")
muPM <- data.frame(pred, mu = exp(X %*% fixef(m2PM)), model = "MP")
## Pelo COM-Poisson Mixed
aux <- predict(m2CM, newdata = pred, type = "link")
predCM <- data.frame(pred, y = calc_mean_cmp(aux, phi = m2CM@coef[1]),
model = "MC")
muCM <- data.frame(pred, mu = calc_mean_cmp(X %*% m2CM@coef[-(1:2)],
phi = m2CM@coef[1]),
model = "MC")
## Agrupa as predições
pred.all <- rbind(predPM, predCM)
mu.all <- rbind(muPM, muCM)
key <- list(
key <- list(
column = 1,
column = 1,
lines = list(lty = c(1, 2), lwd = c(3, 1)),
lines = list(lty = c(1, 2), lwd = c(3, 1)),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment