sim_luc | R Documentation |
This function can be used to generate land use change data from a data generating process
sim_luc(
n,
J = 3,
tt = 2,
k = 1,
areas = matrix(runif(n * J), n, J),
alphas = replicate(J, cbind(matrix(stats::runif(tt * (J - 1)), tt, J - 1), 0), simplify
= FALSE),
xmat = matrix(stats::rnorm(n * k), n, k),
betas = replicate(J, cbind(matrix(stats::rnorm(k * (J - 1)), k, J - 1), 0), simplify =
FALSE)
)
n |
Number of spatial observations |
J |
Number of land use classes |
tt |
Number of time steps to simulate |
k |
Number of covariates to simulate |
areas |
A matrix of dimensions |
alphas |
A list of length |
xmat |
Matrix of dimensions |
betas |
A list of length |
The function simulates a set of J
different multinomial logit land use models over J
distinct land uses
(with j',j = 1,...,J
). Each of the models takes the form:
y_{iljt} = \frac{\exp(\alpha_{ljt} + X_i \beta_{lj})}{ \sum^{J}_{j' = 1} \exp(\alpha_{ljt} + X_i \beta_{lj'})}
where l
denotes the individual multinomial logit models. X_i
is the i
-th
row of the n \times k
matrix X
. \beta_j
is the
k \times J
matrix of land use class specific slope parameters. \alpha_{jt}
are class
specific intercepts, which are typically optimised using the bias correction method. These are assumed
to vary over time.
For the purpose of identification the slope parameters \beta_J
and intercepts
\alpha_J
associated with the J
-th class have to be zero.
Each of the J
different models captures land use being converted from the l
-th land use class
to J
other land uses.
The function generate J
different NT \ times J
matrices Y_l
. Based on these, the function
generates a set of targets T_{ljt}
for downscaling. These are calculated by:
T_{ljt} = \sum^n_{i=1} y_{iljt} a_{ilt}.
The initial values for a_il1
are randomly generated. After this the values of a_{ilt}
are dynamicall
updated through:
a_{ilt+1} = \sum^n_{j=1} y_{iljt} a_{ilt}
The output of this function can be directly used in downscale
.
A list with the generated \alpha
(alphas
), X
(xmat
),
\beta
(betas
), Y
(Y
),
and T
(targets
). The returned values are in long format as required by
downscale
.
dgp1 = sim_luc(n = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.