rn_vp_env | R Documentation |
V_{\text{Tot}}
This function calculates the total phenotypic variance V_{\text{Tot}}
arising along and beyond the reaction norm, i.e. including the residual variance.
rn_vp_env(theta, V_theta, var_res, env = NULL, shape = NULL, X = NULL,
fixed = NULL, wt_env = NULL, width = 10)
theta |
Average parameters of the shape function. It must be a named vector, with the names corresponding to the parameters in the |
V_theta |
Full variance-covariance matrix of the parameters. It can be of lesser dimensions than |
var_res |
Residual variance beyond the reaction norm. It could be a scalar if this residual variance is assumed homogeneous or a vector the same length as |
env |
Vector of environmental values (numeric). |
shape |
Expression providing the shape of the reaction where |
X |
If the model used was linear in the parameters, the design matrix X of the model (numeric, incompatible with the arguments |
fixed |
If some parameters of |
wt_env |
Weights to apply to the |
width |
Parameter for the integral computation. The integral is evaluated from |
The phenotypic variance at a given environment depends on the variation in the \theta
parameters and the residual variance. It thus account for everything but the variance due to the average shape of the reaction norm (i.e. V_{\text{Plas}}
).
This function yields the phenotypic variance in each environment (numerical vector).
Pierre de Villemereuil
rn_vplas
, rn_vgen
# Some environment vector
vec_env <- seq(-2, 2)
# Shape function
expr <- expression(
cmax * exp(
- exp(rho * (x - xopt) - 6) -
sigmagaus * (x - xopt)^2
))
# Theta
theta <- c(cmax = 1, xopt = 0.9, rho = 8, sigmagaus = 0.4)
# G, only for cmax and xopt
G <- matrix(c(0.1, 0.01,
0.01, 0.05),
ncol = 2)
# Another covariance matrix for cmax and xopt (e.g. permanent environment, or maternal effet)
M <- matrix(c(0.05, 0,
0, 0.01),
ncol = 2)
# Full variance-covariance matrix
P <- G + M
# Residual variance
vr <- 0.1
# Computing V_tot
rn_vp_env(theta = theta,
V_theta = P,
var_res = vr,
env = vec_env,
shape = expr,
fixed = c(3, 4))
# Note that fixed is set for the third and forth parameters than are not in P
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.