data-raw/mri_parameters.R

bvecs <- rbind(
  c(0.00000000, 0.000000000, 0.000000000),
  c(-0.20676051, 0.261832982, -0.942705452),
  c(0.19476026, 0.270448774, -0.942828715),
  c(0.40667778, -0.084184632, -0.909684658),
  c(-0.41382581, 0.540293396, -0.732687771),
  c(-0.21794535, 0.825119197, -0.521227658),
  c(-0.86314929, 0.463061661, -0.201363176),
  c(-0.73897338, 0.359928161, -0.569535017),
  c(-0.40364370, -0.100163668, -0.909416914),
  c(-0.73159349, -0.040165026, -0.680557013),
  c(-0.66490889, 0.746903896, 0.005557164),
  c(-0.34173709, 0.927276969, -0.152883336),
  c(-0.34082511, 0.714567363, 0.610926986),
  c(-0.66366220, 0.641997814, 0.383915782),
  c(-0.98224133, 0.180850267, 0.049952574),
  c(-0.86120379, 0.290480703, 0.417071968),
  c(-0.01839861, 0.893575668, 0.448535502),
  c(-0.01790230, 0.998130620, 0.058436066),
  c(0.63860774, 0.667538762, 0.382847458),
  c(0.31248039, 0.728143990, 0.610051215),
  c(0.20974995, -0.437327147, -0.874499798),
  c(0.19221315, 0.445282280, 0.874515772),
  c(0.63398081, 0.773329794, -0.005421411),
  c(0.30540758, 0.939098299, -0.157545581),
  c(0.18422991, 0.831315875, -0.524378955),
  c(0.39441016, 0.557223439, -0.730713785),
  c(0.73528749, -0.009627191, -0.677686989),
  c(0.72329563, 0.388292819, -0.571027279),
  c(0.84327614, 0.498015910, -0.202152655),
  c(0.84928846, 0.324444354, 0.416467190),
  c(0.97430742, 0.219871461, 0.048802000)
)
n <- dim(bvecs)[1]
S0 <- 1
neutral_element <- diag(3e-3, 3L)
bval <- 1000
design_matrix <- -bval * cbind(
  rep(-1 / 1000, n), bvecs[, 1] * bvecs[, 1], 2 * bvecs[, 1] * bvecs[, 2],
  bvecs[, 2] * bvecs[, 2], 2 * bvecs[, 1] * bvecs[, 3],
  2 * bvecs[, 2] * bvecs[, 3], bvecs[, 3] * bvecs[, 3]
  )
estimation_matrix <- solve(t(design_matrix) %*% design_matrix) %*% t(design_matrix)
devtools::use_data(bvecs, S0, neutral_element, bval, design_matrix,
                   estimation_matrix, internal = TRUE, overwrite = TRUE)
astamm/bayesr documentation built on May 10, 2019, 2:05 p.m.