| Title: | Presence-Only for Marked Point Process |
| Version: | 0.1.3 |
| Date: | 2022-12-12 |
| Description: | Inspired by Moreira and Gamerman (2022) <doi:10.1214/21-AOAS1569>, this methodology expands the idea by including Marks in the point process. Using efficient 'C++' code, the estimation is possible and made faster with 'OpenMP'https://www.openmp.org/ enabled computers. This package was developed under the project PTDC/MAT-STA/28243/2017, supported by Portuguese funds through the Portuguese Foundation for Science and Technology (FCT). |
| License: | GPL (≥ 3) |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.2.0 |
| Depends: | R (≥ 2.14.0) |
| LinkingTo: | Rcpp, RcppEigen, RcppProgress |
| Imports: | Rcpp, coda, geoR, parallel, methods, graphics, stats, tools |
| Suggests: | bayesplot, ggplot2, MASS |
| Collate: | 'RcppExports.R' 'covariance_importance.R' 'prior-class.R''initial-class.R' 'model-class.R' 'fit-class.R''pompp-package.R' 'pompp.R' |
| NeedsCompilation: | yes |
| Packaged: | 2022-12-12 17:11:54 UTC; anthorg |
| Author: | Guido Alberti Moreira |
| Maintainer: | Guido Alberti Moreira <guidoalber@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2022-12-12 23:50:05 UTC |
Generic class for the beta and delta parameters.
Description
Generic class for the beta and delta parameters.
Usage
## S4 method for signature 'BetaDeltaPrior'show(object)## S4 method for signature 'BetaDeltaPrior'print(x, ...)## S3 method for class 'BetaDeltaPrior'print(x, ...)Arguments
object | The BetaDeltaPrior object. |
x | The BetaDeltaPrior object. |
... | Ignored. |
Value
show andprint: The invisible object.
Fields
familyThe family of distributions of the prior.
Create a Gamma prior object for model specification.
Description
Constructor forGammaPrior-class objects
Usage
GammaPrior(shape, rate)Arguments
shape | A positive number. |
rate | A positive number. |
Value
AGammaPrior object with adequate slots.
Gamma prior class for the LambdaStar parameter.
Description
This is used to represent the prior for lambdaStar individually. Itstill needs to be joined with the prior for Beta and Delta to be usedin a model.
Usage
## S4 method for signature 'GammaPrior'names(x)## S4 method for signature 'GammaPrior'x$name## S4 replacement method for signature 'GammaPrior'x$name <- value## S4 method for signature 'GammaPrior'show(object)## S4 method for signature 'GammaPrior'print(x, ...)## S3 method for class 'GammaPrior'print(x, ...)Arguments
x | The GammaPrior object. |
name | The requested slot. |
value | New value. |
object | The GammaPrior object. |
... | Ignored. |
Value
names: A character vector with the prior parameters.
`$` The requested slot's value.
`$<-`: The new object with the updated slot.
show andprint: The invisible object.
Fields
shapeThe shape parameter of the Gamma distribution.
rateThe rate parameter of the Gamma distribution.
See Also
Examples
GammaPrior(0.0001, 0.0001)Generic class for the LambdaStar parameters.
Description
Generic class for the LambdaStar parameters.
Usage
## S4 method for signature 'LambdaStarPrior'show(object)Arguments
object | The LambdaStarPrior object. |
Value
show andprint: The invisible object.
Fields
familyThe family of distributions of the prior.
Create a Normal prior object for model specification.
Description
Constructor forNormalPrior-class objects
Usage
NormalPrior(mu, Sigma)Arguments
mu | The mean vector for the Normal distribution. |
Sigma | The covariance matrix for the Normal distribution. |
Details
Matrix Sigma must be square and positive definite. Its dimensionsmust match mu's length.
Value
ANormalPrior object with adequate slots.
See Also
Examples
NormalPrior(rep(0, 10), diag(10) * 10)Normal prior class for Beta and Delta parameters.
Description
This is used to represent the prior for Beta and Delta individually. Theystill need to be joined to be used in a model.
Usage
## S4 method for signature 'NormalPrior'names(x)## S4 method for signature 'NormalPrior'x$name## S4 replacement method for signature 'NormalPrior'x$name <- value## S4 method for signature 'NormalPrior'show(object)## S4 method for signature 'NormalPrior'print(x, ...)## S3 method for class 'NormalPrior'print(x, ...)Arguments
x | The NormalPrior object. |
name | The requested slot. |
value | New value. |
object | The NormalPrior object. |
... | Ignored. |
Value
names: A character vector with the prior parameters.
`$`: The requested slot's value.
`$<-`: The new object with the updated slot.
show andprint: The invisible object.
Fields
muThe mean vector for the prior.
SigmaThe covariance matrix for the prior.
Class for covariates importance matrices
Description
Objects of this class is the output of the "covariates_importance" objectfrom thepompp_fit-class. It can be plotted which usesthegraphics package. Theprint methodgives a point-wise estimation, the same seen in thebacplot method.Bothplot andboxplot methods use the posterior distributionof the importance.
Usage
## S3 method for class 'covariates_importance'print(x, component = "intensity", ...)## S3 method for class 'covariates_importance'plot( x, component = "intensity", y = "importance", quantiles = c(0.025, 0.5, 0.975), ...)## S3 method for class 'covariates_importance'barplot(height, component = "intensity", y, ...)## S3 method for class 'covariates_importance'boxplot(x, component = "intensity", ...)Arguments
x | The |
component | Either |
... | Other parameters passed to |
y | Either |
quantiles | A 2- or 3-simensional vector with the desired quantilesspecified. If 3-dimensiona, the middle point is drawn as a dot when the |
height | The |
Details
Objects of this class have two matrices where the Monte Carlo samples on therows and parameters on the columns. One matrix is for the intensityimportance and the other for the observability importance.
Value
The invisible object.
Nothing is returned. Plot is called and drawn on the configureddevice.
A barplot. Seebarplot for details. If component is selectedas"both", only the second barplot is returned.
A boxplot. Seeboxplot for details. If component is selectedas"both", only the second boxplot is returned.
See Also
Fit presence-only data using the Presence-Only for Marked Point Process model
Description
The model uses a data augmentation scheme to avoid performing approximationson the likelihood function.
Usage
fit_pompp( object, background, mcmc_setup = list(iter = 5000), verbose = TRUE, ...)## S4 method for signature 'pompp_model,matrix'fit_pompp( object, background, neighborhoodSize = 20, mcmc_setup, verbose = TRUE, area = 1, cores = parallel::detectCores(), ...)checkFormatBackground(object, background)Arguments
object | Either a |
background | A matrix where the rows are the grid cells for the studiedregion and the columns are the covariates. |
mcmc_setup | A list containing |
verbose | Set to |
... | Parameters passed on to specific methods. |
neighborhoodSize | Number of neighbors to use in the NNGP method. |
area | A positive number with the studied region's area. |
cores | Number of cores to pass to OpenMP. |
Details
The background is kept outside of the
Value
An object of class"pompp_fit".
See Also
pompp_model andpompp_fit-class.
Examples
beta <- c(-1, 2) # Intercept = -1. Only one covariatedelta <- c(3, 4) # Intercept = 3. Only one covariatelambdaStar <- 1000gamma <- 2mu <- 5total_points <- rpois(1, lambdaStar)random_points <- cbind(runif(total_points), runif(total_points))grid_size <- 50# Find covariate values to explain the species occurrence.# We give them a Gaussian spatial structure.reg_grid <- as.matrix(expand.grid(seq(0, 1, len = grid_size), seq(0, 1, len = grid_size)))Z <- MASS::mvrnorm(1, rep(0, total_points + grid_size * grid_size), 3 * exp(-as.matrix(dist(rbind(random_points, reg_grid))) / 0.2))Z1 <- Z[1:total_points]; Z2 <- Z[-(1:total_points)]# Thin the points by comparing the retaining probabilities with uniforms# in the log scale to find the occurrencesoccurrences <- log(runif(total_points)) <= -log1p(exp(-beta[1] - beta[2] * Z1))n_occurrences <- sum(occurrences)occurrences_points <- random_points[occurrences,]occurrences_Z <- Z1[occurrences]# Find covariate values to explain the observation bias.# Additionally create a regular grid to plot the covariate later.W <- MASS::mvrnorm(1, rep(0, n_occurrences + grid_size * grid_size), 2 * exp(-as.matrix(dist(rbind(occurrences_points, reg_grid))) / 0.3))W1 <- W[1:n_occurrences]; W2 <- W[-(1:n_occurrences)]S <- MASS::mvrnorm(1, rep(0, n_occurrences), 2 * exp(-as.matrix(dist(occurrences_points)) / 0.3))# Find the presence-only observations.marks <- exp(mu + S + rnorm(n_occurrences, 0, 0.3))po_sightings <- log(runif(n_occurrences)) <= -log1p(exp(-delta[1] - delta[2] * W1 - gamma * S))n_po <- sum(po_sightings)po_points <- occurrences_points[po_sightings, ]po_Z <- occurrences_Z[po_sightings]po_W <- W1[po_sightings]po_marks <- marks[po_sightings]jointPrior <- prior( NormalPrior(rep(0, 2), 10 * diag(2)), # BetaNormalPrior(rep(0, 3), 10 * diag(3)), # DeltaGammaPrior(0.00001, 0.00001), # LambdaStarNormalPrior(0, 100), GammaPrior(0.001, 0.001) # Marks)model <- pompp_model(po = cbind(po_Z, po_W, po_points, po_marks),intensitySelection = 1, observabilitySelection = 2, marksSelection = 5, coordinates = 3:4, intensityLink = "logit", observabilityLink = "logit", initial_values = 2, joint_prior = jointPrior)bkg <- cbind(Z2, W2, reg_grid) # Create background# Be prepared to wait a long time for thisfit <- fit_pompp(model, bkg, neighborhoodSize = 20, area = 1, mcmc_setup = list(burnin = 1000, iter = 2000), cores = 1)summary(fit)# Rhat upper CI values are above 1.1. More iterations are needed...Initial values constructor for pompp modeling
Description
Helper function to create a valid set of initial values to be used with thefit_pompp function.
Usage
initial( beta = numeric(), delta = numeric(), lambdaStar = numeric(), marksMean = numeric(), marksPrecision = numeric(), random = FALSE)Arguments
beta | Either a vector or a single integer. The vector is used if theinitial values are provided and the integer is used as the vector size tobe randomly generated. |
delta | Either a vector or a single integer. The vector is used if theinitial values are provided and the integer is used as the vector size tobe randomly generated. |
lambdaStar | A positive number. |
marksMean | Any real number. If random, defines the mean of the randomvalue. |
marksPrecision | A positive number. If random, defines the mean of therandom value. |
random | A logical value. If |
Value
Apompp_initial object. It can be used in thefit_pompp function by itself, but must be in a list if multipleinitial values are supplied. Initial values can be combined by adding them(with the use of+).
See Also
Examples
# Let us create initial values for a model with, say, 3 intensity covariates# and 4 observability covariates. We add an initial values for both these# cases due to the intercepts.# This first one isin1 <- initial(rep(0, 4), c(0, 2, -1, -2, 3), 100, 0, 1)# Then we initalize some randomly.in2 <- initial(4, 5, 100, 0, 1, random = TRUE)# We can even multiply the random one to generate more. Let us join them all# to include in a model.initial_values <- in1 + in2 * 3# 4 chains are initialized.Class for the result of the MCMC procedure.
Description
Objects of this class are the main objects of this package. They containmuch information about the fitted model.
Usage
## S4 method for signature 'pompp_fit'show(object)## S4 method for signature 'pompp_fit'print(x, ...)## S3 method for class 'pompp_fit'print(x, ...)## S4 method for signature 'pompp_fit'summary(object, ...)## S3 method for class 'pompp_fit'summary(object, ...)## S4 method for signature 'pompp_fit'names(x)## S3 method for class 'pompp_fit'names(x)## S4 method for signature 'pompp_fit,ANY,ANY'x[[i]]## S4 method for signature 'pompp_fit'x$name## S4 method for signature 'pompp_fit'as.array(x, ...)## S3 method for class 'pompp_fit'as.array(x, ...)## S4 method for signature 'pompp_fit'as.matrix(x, ...)## S3 method for class 'pompp_fit'as.matrix(x, ...)## S4 method for signature 'pompp_fit'as.data.frame(x, row.names = NULL, optional = FALSE, ...)## S3 method for class 'pompp_fit'as.data.frame(x, row.names = NULL, optional = FALSE, ...)## S4 method for signature 'pompp_fit,pompp_fit'e1 + e2## S4 method for signature 'pompp_fit'c(x, ...)Arguments
object | A pompp_fit object. |
x | A pompp_fit object. |
... | Ignored in this version. |
i | The requested slot. |
name | The requested slot. |
row.names | NULL or a character vector giving the row names for thedata frame. Missing values are not allowed. |
optional | logical. If TRUE, setting row names and converting columnnames to syntactic names is optional. See help('as.data.frame') for more.Leaving as |
e1 | A pompp_fit object. |
e2 | A pompp_fit object with the same slots (except for initialvalues) as |
Value
show andprint: The invisible object.
summary: A matrix with the summary statistics of thefit. It is also printed in theprint method. The summary can betreated as a matrix, such as retrieving rows/columns and creating tableswith thextable package.
names: A character vector with the available optionsfor the`$` and`[[` methods.
`$` and`[[`: The requested slot.Available options are not necessarily the class slots, and can be checkedwith thenames method.
as.array: Anarray with dimensions I x C x P,where I stands for number of iterations, C for number of chains and P fortotal number of parameters. P is actually larger than the number ofparameters in the model, as the the generated sizes of the latent processesand the log-posterior are also included. This is organized so that is readyfor thebayesplot package functions.
as.matrix: The dimension of the output isI * C x (P + 2), where I stands for number of iterations, C for number ofchains and P for total number of parameters. P is actually larger than thenumber of parameters in the model, as the generated sizes of the latentprocesses and the log-posterior are also included.
Two extra columns are included to indicate to which chain and to whichiteration that draw belongs.
as.data.frame: The dimension of the output isI*C x P + 2, where I stands for number of iterations, C for number of chainsand P for total number of parameters. P is actually larger than the numberof parameters in the model, as the generated sizes of the latent processesand the log-posterior are also included.
Two extra columns are included to indicate to which chain and to whichiteration that draw belongs. This is to facilitate the use of plottingresults via theggplot2 package if desired.
Ifrow.names is left atNULL then row names are created asCcIi where c is the chain and i is the iteration of that row.
+: A newpompp_fit object where the chainsare combined into a new multi-chain object. This can be used if chains arerun in separate occasions or computers to combine them into a single objectfor analysis.
c: A newpompp_fit object where the chainsare combined into a new multi-chain object. The+ method isused for that, with the same arguments restrictions and results.
Fields
fitThe actual fit from the model. It is an object of class
mcmc.list, as generated from thecodapackage.originalThe model used to generate the chains, an object with class
pompp_model.backgroundSummaryA small summary of the original backgroundcovariates. This is to ensure that continuing the chains will use theidentical background matrix. Only the summary is kept for storage efficiency.
areaA positive number indicating the area measure of the region beingstudied.
parnamesThe names of the parameters. If the model used selects thecovariates with column names, they are replicated here. If they are thecolumn indexes, names are generated for identification.
mcmc_setupThe original mcmc setup used.
See Also
Class for the initial values for the MCMC for the pompp package
Description
Class for the initial values for the MCMC for the pompp package
Usage
## S4 method for signature 'pompp_initial'names(x)## S4 method for signature 'pompp_initial'x$name## S4 method for signature 'pompp_initial,ANY'e1 + e2## S4 method for signature 'list,pompp_initial'e1 + e2## S4 method for signature 'pompp_initial,list'e1 + e2## S4 method for signature 'pompp_initial,numeric'e1 * e2## S4 method for signature 'numeric,pompp_initial'e1 * e2## S4 method for signature 'pompp_initial'show(object)## S4 method for signature 'pompp_initial'print(x, ...)## S3 method for class 'pompp_initial'print(x, ...)Arguments
x | The pompp_initial object. |
name | The requested slot. |
e1 | A pompp_initial object. |
e2 | Another pompp_initial object or a list with pompp_initialobjects for+ and a positive integer for*. e1 and e2can be switched (+ and * are commutative). |
object | A pompp_initial object. |
... | Currently unused. |
Value
names: A character vector with the initializedparameter names.
`$`: The requested initial value (in case ofLambdaStar) or values (in case of Beta or Delta).
+: A list with the objects. Useful to start thefit_pompp function, as it requires a list of initial values.
*: A list withe2 random initial values.
show andprint: The invisible object.
Fields
betaInitial values for beta.
deltaInitial values for delta.
lambdaStarInitial values for lambdaStar.
tagIndicates the source of the initial values.
Build a model to be used in thepompp fitting function
Description
Constructor forpompp_model-class objects, built to facilitatethe use of the fitting function. The output of this function has thenecessary signature for the fit_pompp function to start the model fit.
Usage
pompp_model( po, intensitySelection, observabilitySelection, marksSelection, coordinates, intensityLink = "logit", observabilityLink = "logit", initial_values = 1, joint_prior = prior(beta = NormalPrior(rep(0, length(intensitySelection) + 1), 10 * diag(length(intensitySelection) + 1)), delta = NormalPrior(rep(0, length(observabilitySelection) + 1), 10 * diag(length(observabilitySelection) + 1)), lambdaStar = GammaPrior(1e-10, 1e-10), marksMean = NormalPrior(1, 100), marksPrecision = GammaPrior(0.001, 0.001)), verbose = TRUE)Arguments
po | A matrix whose rows represent the presence-only data and thecolumns the covariates observed at each position. |
intensitySelection | Either a numeric or character vector andrepresents the selection of covariates used for the intensity set. Ifnumeric it is the positions of the columns and if character, the names ofthe columns. |
observabilitySelection | Either a numeric or character vector andrepresents the selection of covariates used for the observability set. Ifnumeric it is the positions of the columns and if character, the names ofthe columns. |
marksSelection | Either a numeric or character vector andrepresents the selection of column used for the marks. Ifnumeric it is the position of the column and if character, the name ofthe column. |
coordinates | Either a numeric or character vector andrepresents the columns to be used for the coordinates. Ifnumeric it is the positions of the columns and if character, the names ofthe columns. They must be in longitude, latitude order. |
intensityLink | A string to inform what link function the model haswith respect to the intensity covariates. Current version accepts 'logit'. |
observabilityLink | A string to inform what link function the model haswith respect to the observabilitycovariates. Current version accepts 'logit'. |
initial_values | Either a single integer, a single |
joint_prior | A |
verbose | Set to |
Value
Apompp_model object with the requested slots. It is readyto be used in thefit_pompp function.
See Also
Examples
# Let us simulate some data to showcase the creation of the model.beta <- c(-1, 2)delta <- c(3, 4)lambdaStar <- 1000gamma <- 2mu <- 5total_points <- rpois(1, lambdaStar)random_points <- cbind(runif(total_points), runif(total_points))# Find covariate values to explain the species occurrence.# We give them a Gaussian spatial structure.Z <- MASS::mvrnorm(1, rep(0, total_points), 3 * exp(-as.matrix(dist(random_points)) / 0.2))# Thin the points by comparing the retaining probabilities with uniforms# in the log scale to find the occurrencesoccurrences <- log(runif(total_points)) <= -log1p(exp(-beta[1] - beta[2] * Z))n_occurrences <- sum(occurrences)occurrences_points <- random_points[occurrences,]occurrences_Z <- Z[occurrences]# Find covariate values to explain the observation bias.# Additionally create a regular grid to plot the covariate later.W <- MASS::mvrnorm(1, rep(0, n_occurrences), 2 * exp(-as.matrix(dist(occurrences_points)) / 0.3))S <- MASS::mvrnorm(1, rep(0, n_occurrences), 2 * exp(-as.matrix(dist(occurrences_points)) / 0.3))# Find the presence-only observations.marks <- exp(mu + S + rnorm(n_occurrences, 0, 0.3))po_sightings <- log(runif(n_occurrences)) <= -log1p(exp(-delta[1] - delta[2] * W - gamma * S))n_po <- sum(po_sightings)po_points <- occurrences_points[po_sightings, ]po_Z <- occurrences_Z[po_sightings]po_W <- W[po_sightings]po_marks <- marks[po_sightings]# Now we create the modelmodel <- pompp_model(po = cbind(po_Z, po_W, po_points, po_marks), intensitySelection = 1, observabilitySelection = 2, marksSelection = 5, coordinates = 3:4, intensityLink = "logit", observabilityLink = "logit", initial_values = 2, joint_prior = prior( NormalPrior(rep(0, 2), 10 * diag(2)), NormalPrior(rep(0, 3), 10 * diag(3)), GammaPrior(1e-4, 1e-4), NormalPrior(0, 100), GammaPrior(0.001, 0.001)))# Check how it is.modelClass that defines a model for the pompp package.
Description
The model includes the presence-only data, all selected variables, the linkfunctions forq andp, the initial values and the priordistribution.
Usage
## S4 method for signature 'pompp_model'names(x)## S4 method for signature 'pompp_model'x$name## S4 replacement method for signature 'pompp_model'x$name <- value## S4 method for signature 'pompp_model'show(object)## S4 method for signature 'pompp_model'print(x, ...)## S3 method for class 'pompp_model'print(x, ...)Arguments
x | The pompp_model object. |
name | The requested slot. |
value | New value. |
object | The pompp_model object. |
... | Currently unused. |
Value
names: A character vector with possible optionsfor the`$` and`$<-` methods.
`$`: The requested slot's value.
`$<-`: The new object with the updated slot.
show andprint: The invisible object.
Fields
poThe matrix containing the covariates values for the data.
intensityLinkA string informing about the chosen link for theintensity covariates. Current acceptable choice is only
"logit".intensitySelectionA vector containing the indexes of the selectedintensity columns in the
pomatrix.observabilityLinkA string informing about the chosen link for theobservability covariates. Current acceptable choice is only
"logit".observabilitySelectionA vector containing the indexes of the selectedobservability columns in the
pomatrix.marksSelectionA single value containing the index of the selectedmarks column in the
pomatrix.coordinatesA vector of two values containing the column positionsof the longitude and latitude in the
pomatrix.initA list with objects of class
pompp_initialindicatingthe initial values for each chain. The length of this list tells the programhow many chains are requested to be run.priorAn object of class
pompp_priorwhich indicates thejoint prior distribution for the model parameters.iSelectedColumnsIf the intensity covariates selection was made withthe name of the columns, they are stored in this slot.
oSelectedColumnsIf the observability covariates selection was madewith the name of the columns, they are stored in this slot.
mSelectedColumnsIf the marks selection was madewith the name of the column, it is stored in this slot.
See Also
pompp_initial-class andpompp_prior-class andpompp_model
Joint prior class for the pompp package parameters
Description
Objects of this class are the joining of independent priors for Beta, Deltaand LambdaStar. They can be used in thefit_pompp function.
Usage
## S4 method for signature 'pompp_prior'names(x)## S4 method for signature 'pompp_prior'x$name## S4 method for signature 'pompp_prior'show(object)## S4 method for signature 'pompp_prior'print(x, ...)## S3 method for class 'pompp_prior'print(x, ...)## S4 method for signature 'pompp_prior'x$name## S4 replacement method for signature 'pompp_prior'x$name <- valueArguments
x | The pompp_prior object. |
name | The requested slot. |
object | The pompp_prior object. |
... | Ignored. |
value | New value. |
Value
names: A character vector with the model parametersnames.
`$`: The requested slot's value.
`$<-`: The new object with the updated slot.
Fields
betaAn object of a class which inherits the
BetaDeltaPriorS4class with the appropriate Beta prior.deltaAn object of a class which inherits the
BetaDeltaPriorS4class with the appropriate Delta prior.lambdaStarAn object of a class which inherits the
LambdaStarPriorS4 class with the appropriate LambdaStar prior.marksMeanAn object of S4 class
NormalPriorwith the chosenprior for the marks meanmarksPrecisionAn object of S4 class
GammaPriorwith the chosenprior for the marks precision
Build a joint prior for pompp model parameters
Description
Constructor forpompp_prior objects, which is used in thepompp_fit function. The generated prior is so that Beta, Deltaand LambdaStar are indepdendent a priori.
Usage
prior(beta, delta, lambdaStar, marksMean, marksPrecision)Arguments
beta | An S4 object whose class inherits from |
delta | An S4 object whose class inherits from |
lambdaStar | An S4 object whose class inherits from |
marksMean | An S4 object of class |
marksPrecision | An S4 object of class |
Value
Apompp_prior object with the adequate slots. It is ready tobe included in a model via thepompp_model function.
See Also
fit_pompp,NormalPrior,GammaPrior andpompp_model.
Examples
# Let us say there are 3 intensity covariates and 4 observability covariates.# One more element is included in both sets due to the intercepts.new_prior <- prior( NormalPrior(rep(0, 4), 10 * diag(4)), NormalPrior(rep(0, 5), 10 * diag(5)), GammaPrior(0.0001, 0.0001), NormalPrior(0, 100), GammaPrior(0.001, 0.001))