Difference between revisions of "EU-kalat"

From Testiwiki
Jump to: navigation, search
m (Calculations)
(Calculations: Bayes model moved from Benefit-risk assessment of Baltic herring and salmon intake)
Line 121: Line 121:
 
objects.store(eu,eut)
 
objects.store(eu,eut)
 
cat("Ovariable eu and data.frame eut stored.\n")
 
cat("Ovariable eu and data.frame eut stored.\n")
 +
</rcode>
 +
 +
==== Bayes model for dioxin concentrations ====
 +
 +
* Model run 28.2.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=KrjCTGZmB8JkCH75]
 +
* Model run 28.2.2017 with corrected survey model [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=ZeO0SdlshPgOjqdL]
 +
* Model run 28.2.2017 with Mu estimates [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=TwY2bAIiWr037zqb]
 +
* Model run 1.3.2017 [http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=3Xu19vkWK1lyWVg3]
 +
 +
<rcode name="bayes" label="Sample Bayes model (for developers only)">
 +
# This is code Op_en3014/bayes on page [[EU-kalat]]
 +
 +
library(OpasnetUtils)
 +
library(reshape2)
 +
library(rjags)
 +
 +
objects.latest("Op_en3104", code_name = "preprocess") # [[EU-kalat]]
 +
 +
# Hierarchical Bayes model.
 +
 +
# PCDD/F concentrations in fish.
 +
# It uses the sum of PCDD/F (Pcdsum) as the total concentration of dioxin in fish.
 +
# Cong_j is the fraction of a congener from pcdsum.
 +
# pcdsum is log-normally distributed. cong_j follows Dirichlet distribution.
 +
# pcdsum depends on age of fish, fish species and catchment area, but we only have species now so other variables are omitted.
 +
# cong_j depends on fish species.
 +
 +
conl <- as.character(unique(eu@output$Congener))
 +
fisl <- sort(as.character(unique(eu@output$Fish)))
 +
conl
 +
fisl
 +
fishsamples <- reshape(
 +
  eu@output,
 +
  v.names = "euResult",
 +
  idvar = "THLcode",
 +
  timevar = "Congener",
 +
  drop = c("Matrix", "euSource"),
 +
  direction = "wide"
 +
)
 +
 +
# Find the level of quantification for dinterval function
 +
LOQ <- unlist(lapply(fishsamples[3:ncol(fishsamples)], FUN = function(x) min(x[x!=0])))
 +
names(LOQ) <- conl
 +
cong <- data.matrix(fishsamples[3:ncol(fishsamples)])
 +
cong[cong == 0] <- 0.01 # NA # Needed for dinterval
 +
 +
mod <- textConnection("
 +
  model{
 +
    for(i in 1:S) { # s = fish sample
 +
      for(j in 1:C) { # C = congener
 +
        #        below.LOQ[i,j] ~ dinterval(-cong[i,j], -LOQ[j])
 +
        cong[i,j] ~ dlnorm(mu[fis[i],j], tau[fis[i],j])
 +
      }
 +
    }
 +
    for(i in 1:F) { # F = fish species
 +
      for(j in 1:C) { # C = congener
 +
        mu[i,j] ~ dunif(-3,3) # Why does this not work with dnorm(0, 0.001)?
 +
        tau[i,j] <- pow(sigma[i,j], -2)
 +
        sigma[i,j] ~ dunif(0, 10)
 +
        pcd.pred[i,j] ~ dlnorm(mu[i,j], tau[i,j]) # Model prediction
 +
      }
 +
    }
 +
  }
 +
")
 +
 +
jags <- jags.model(
 +
  mod,
 +
  data = list(
 +
    S = nrow(fishsamples),
 +
    C = length(conl),
 +
    F = length(fisl),
 +
    cong = cong,
 +
    #    LOQ = LOQ,
 +
    #    below.LOQ = is.na(cong)*1,
 +
    fis = match(fishsamples$Fish, fisl)
 +
  ),
 +
  n.chains = 4,
 +
  n.adapt = 100
 +
)
 +
 +
update(jags, 100)
 +
samps <- jags.samples(jags, c('mu', 'pcd.pred'), 1000)
 +
#samps.coda <- coda.samples(jags, c('mu', 'pcd.pred', 'ans.pred'), 1000)
 +
#objects.store(samps)
 +
 +
#library(plyr)
 +
#temp <- adply(samps$mu, c(1,2,3,4))
 +
 +
pcd.pred <- array(
 +
  samps$pcd.pred,
 +
  dim = c(length(fisl), length(conl), 1000, 4),
 +
  dimnames = list(
 +
    Fish = fisl,
 +
    Congener = conl,
 +
    Iter = 1:1000,
 +
    Seed = c("S1","S2","S3","S4")
 +
  )
 +
)
 +
 +
mu.pred <- array(
 +
  samps$mu,
 +
  dim = c(length(fisl), length(conl), 1000, 4),
 +
  dimnames = list(
 +
    Fish = fisl,
 +
    Congener = conl,
 +
    Iter = 1:1000,
 +
    Seed = c("S1","S2","S3","S4")
 +
  )
 +
)
 +
 +
objects.store(pcd.pred, mu.pred)
 +
cat("Arrays pcd.pred, mu.pred stored.\n")
 
</rcode>
 
</rcode>
  

Revision as of 14:31, 13 April 2017


EU-kalat is a study, where concentrations of PCDD/Fs, PCBs, PBDEs and heavy metals have been measured from fish

Question

The scope of EU-kalat study was to measure concentrations of persistent organic pollutants (POPs) including dioxin (PCDD/F), PCB and BDE in fish from Baltic sea and Finnish inland lakes and rivers. [1] [2] [3].

Answer

The original sample results can be acquired from Opasnet base. The study showed that levels of PCDD/Fs and PCBs depends especially on the fish species. Highest levels were on salmon and large sized herring. Levels of PCDD/Fs exceeded maximum level of 4 pg TEQ/g fw multiple times. Levels of PCDD/Fs were correlated positively with age of the fish.

Mean congener concentrations as WHO2005-TEQ in Baltic herring can be printed out with the Run code below.

+ Show code

Rationale

Data

Data was collected between 2009-2010. The study contains years, tissue type, fish species, and fat content for each concentration measurement. Number of observations is 285.

There is a new study EU-kalat 3, which will produce results in 2016.

Calculations

+ Show code

Bayes model for dioxin concentrations

  • Model run 28.2.2017 [6]
  • Model run 28.2.2017 with corrected survey model [7]
  • Model run 28.2.2017 with Mu estimates [8]
  • Model run 1.3.2017 [9]

+ Show code

See also

References

  1. A. Hallikainen, H. Kiviranta, P. Isosaari, T. Vartiainen, R. Parmanne, P.J. Vuorinen: Kotimaisen järvi- ja merikalan dioksiinien, furaanien, dioksiinien kaltaisten PCB-yhdisteiden ja polybromattujen difenyylieettereiden pitoisuudet. Elintarvikeviraston julkaisuja 1/2004. [1]
  2. E-R.Venäläinen, A. Hallikainen, R. Parmanne, P.J. Vuorinen: Kotimaisen järvi- ja merikalan raskasmetallipitoisuudet. Elintarvikeviraston julkaisuja 3/2004. [2]
  3. Anja Hallikainen, Riikka Airaksinen, Panu Rantakokko, Jani Koponen, Jaakko Mannio, Pekka J. Vuorinen, Timo Jääskeläinen, Hannu Kiviranta. Itämeren kalan ja muun kotimaisen kalan ympäristömyrkyt: PCDD/F-, PCB-, PBDE-, PFC- ja OT-yhdisteet. Eviran tutkimuksia 2/2011. ISSN 1797-2981 ISBN 978-952-225-083-4 [3]