Integrating continuous stocks and flows into state‐and‐transition simulation models of landscape change

State‐and‐transition simulation models (STSMs) provide a general framework for forecasting landscape dynamics, including projections of both vegetation and land‐use/land‐cover (LULC) change. The STSM method divides a landscape into spatially referenced cells and then simulates the state of each cell forward in time, as a discrete‐time stochastic process using a Monte Carlo approach, in response to any number of possible transitions. A current limitation of the STSM method, however, is that all of the state variables must be discrete. Here we present a new approach for extending a STSM, in order to account for continuous state variables, called a STSM with stocks and flows (STSM‐SF). The STSM–SF method allows for any number of continuous stocks to be defined for every spatial cell in the STSM, along with a suite of continuous flows specifying the rates at which stock levels change over time. The change in the level of each stock is then simulated forward in time, for each spatial cell, as a discrete‐time stochastic process. The method differs from the traditional systems dynamics approach to stock‐flow modelling in that the stocks and flows can be spatially explicit, and the flows can be expressed as a function of the STSM states and transitions. We demonstrate the STSM‐SF method by integrating a spatially explicit carbon (C) budget model with a STSM of LULC change for the state of Hawai'i, USA. In this example, continuous stocks are pools of terrestrial C, whereas the flows are the possible fluxes of C between these pools. Importantly, several of these C fluxes are triggered by corresponding LULC transitions in the STSM. Model outputs include changes in the spatial and temporal distribution of C pools and fluxes across the landscape in response to projected future changes in LULC over the next 50 years. The new STSM‐SF method allows both discrete and continuous state variables to be integrated into a STSM, including interactions between them. With the addition of stocks and flows, STSMs provide a conceptually simple yet powerful approach for characterizing uncertainties in projections of a wide range of questions regarding landscape change.

A major limitation of most landscape simulation models is that they have been developed for specific questions or regions, resulting in a proliferation of landscape modelling approaches (Keane et al., 2004;National Research Council, 2014). Hence, most existing models are not suitable for use as a general landscape modelling framework (Wimberly, Sohl, Liu, & Lamsal, 2015). There are a few exceptions, including SELES (Fall & Fall, 2001) and the state-and-transition simulation model (STSM) approach for forecasting landscape change (Daniel, Frid, Sleeter, & Fortin, 2016). The STSM method is a general, stochastic, spatially explicit approach for projecting landscape dynamics. Unlike most other approaches to landscape simulation modelling, the STSM method can be applied to a wide range of questions, including both vegetation dynamics and land-use change (Kerns, Shlisky, & Daniel, 2012;Wilson, Costanza, Smith, & Morisette, 2014). In the STSM approach, space is represented as a set of discrete spatial units, time is represented in discrete steps and the change in discrete state of each spatial unit over time is modelled as a stochastic process.
A current limitation of STSMs, however, is that all of the state variables must be discrete, making it challenging to model processes that do not lend themselves well to discretization (Daniel et al., 2016).
Examples of situations in which spatially explicit continuous state variables are often required include landscape projections of ecosystem carbon (Boisvenue, Smiley, White, Kurz, & Wulder, 2016), tracking of continuous tree attributes such as density or biomass across forested systems (Scheller et al., 2007;Wang et al., 2014), and spatially explicit population models (Turner et al., 1995). While it is already possible to track certain continuous variables in a STSM, this approach will only work when the continuous variables can be expressed as a direct function (i.e. as a "lookup") of the STSM discrete state variables. There are other continuous variables, however, for which a lookup approach is not appropriate-these are typically variables for which there are spatial or temporal lags between changes in the STSM discrete state of each spatial unit and the corresponding change in the continuous variable (e.g. forest soil carbon).
To overcome this limitation, we present here a new approach for incorporating continuous state variables into STSMs. Our extension to the STSM method is based on the "systems dynamics" approach to modelling, as first articulated by Forrester (1961), and popularized since through software products such as Vensim and STELLA (Richmond, 2001;Sterman, 2000). This method extends a STSM as follows: (1) any number of continuous stocks are defined as additional state variables for each spatial unit in a landscape; (2) flows are also specified, for each spatial unit, that update the levels of stocks every timestep; and (3) the change in the levels of each stock over time, for each spatial unit, is represented as a discrete-time stochastic process.
There are a number of other modelling approaches that share some features with our STSM-SF approach. For example coupled map lattices (Kaneko, 1992), the continuous variable equivalent of cellular automata (Fonstad, 2006), are also able to model a continuous random variable in discrete space and time; however, unlike the STSM-SF approach, they only track one state variable at a time.
Matrix population models (Caswell, 2001) are a widely used approach for modelling the dynamics of structured continuous variables (e.g. population cohorts). Like STSM-SFs, these models operate in discrete time, allow for multiple continuous state variables (i.e. as cohorts), and can be run stochastically. Their limitation in landscape simulation modelling applications, however, is that they are not readily spatially referenced. Finally, both differential and difference equations have been used to represent continuous state variables in discrete space (e.g. Canham et al., 2004;Gravel, Mouquet, Loreau, & Guichard, 2010); unlike the approach outlined here, however, these approaches are generally designed to work with a relatively small number of spatial units (i.e. patches).
In this paper we present the details of our stock-flow extension to the STSM method, including a case-study example demonstrating some of the key features of the new stock-flow approach. Specifically, the case study will show how terrestrial carbon dynamics can be integrated into a STSM of LULC change for the state of Hawai'i, USA. We conclude with a brief discussion of the strengths and limitations of the STSM-SF method.

| APPROACH
With the STSM method, a landscape is divided spatially into a set of simulation cells, typically as a regular raster grid. A number of discrete state variables are then tracked for each cell, each of which is represented as a discrete-time stochastic process. The first of these state variables is the state type, X t , of the cell at time t, such that {X t : t ≥ 0}.
For example, in a simple model of forest vegetation the state type might represent the cell's dominant vegetation community, such as coniferous, deciduous and mixed (Figure 1). A set of u matrices of onestep transition probabilities between states, P u,t = (p (u,t) ij ), is defined for each cell, the elements of which specify the probability that the cell will transition from state type i to state type j due to transition type u (u ∈ U, where U is the set of all possible transition types) in timestep t. For example continuing our forest model example of Figure 1, the transition types could include processes such as succession, fire and timber harvest. Because STSMs are space and time heterogeneous, the entries for P u,t are themselves random variables that are allowed to vary by cell and timestep, and which can be expressed as a function of the current state of all cells in the landscape. A simulated realization of a STSM begins by setting initial values for X 0 for each cell and then sequentially applying the u transition probability matrices for the first timestep, P u,1, in order to generate d (u,1) for all u ∈ U in the first timestep, where d (u,t) represents a random variate of the Bernoulli distribution D u,t , such that D u,t takes on a value of 1 if transition u occurs in timestep t and 0 otherwise. Based on the realized transitions, d (u,1) , that occur in the first timestep, a random variate for the resulting state type, x 1 , is then updated at the end of the first timestep. This update process is repeated for each subsequent timestep in order to generate random variates d (u,t) and x t for all u ∈ U and t > 0. In addition to the state type, a STSM can also include two optional forms of "counters" Because the STSM method only tracks discrete state variables, it can be challenging to model processes that do not lend themselves well to discretization. For example in a simple model of forest vegetation such as that shown in Figure 1, discrete state types may be well suited for characterizing the vegetation composition of each cell over time; on the other hand, a variable such as terrestrial carbon might be better represented as a continuous quantity. To overcome this limitation, we have developed an approach for adding continuous random variables-which we refer to as stocks-as state variables to a STSM, and, in turn, continuous flows to update the level of these stocks over variates for the stock types (z v,1 for all v ∈ V) for the first timestep. This one-step update process is then repeated for each subsequent timestep of a simulated realization in order to generate random variates, z v,t , for all v ∈ V and t > 0. As multiple types of flows can occur within each timestep, the order in which the flow matrices are applied within each timestep can be specified, as this order can be important.

| Calculating flows
The flow amounts in a stock-flow model, as defined by the elements b (w,t) gh in the flow matrix B w,t , are random variables that can vary by cell and timestep in a STSM-SF. While these flow amounts can be calculated, for each cell and timestep, as a function of the current state (i.e. from the Atmosphere to Living Biomass-could be modelled as a function of the size of the target stock (i.e. Living Biomass). Alternatively, flow amounts could also be modelled to be independent of any of the stocks. Note, however, that while the flow amounts might be independent of current stock levels, they are often still a function of one or more of the other discrete STSM state variables. Returning to the example model of Figure 1, instead of modelling the Growth flow as a function of the Living Biomass stock, it could alternatively be modelled as a function of the current state type (i.e. vegetation community) and age of each cell. This linkage between the flow rates and the state variables of a STSM is an important feature of the STSM-SF approach. Finally, another key feature of the STSM-SF approach is that any flows can be made a function of the realized transitions, d (u,t) , that occur on the STSM side of the simulation (i.e. b (w,t) gh = f(d (u,t) )). For example in the model of Figure 1, emissions of C to the atmosphere could be defined to occur only in response to a fire; in other words, a

| CASE-STUDY EXAMPLE
To illustrate the STSM-SF method, we present a model of the interaction between LULC change and terrestrial carbon for the state of Hawai'i, USA. The intent of this model is to demonstrate how potential future changes in LULC, including shifts in vegetation communities due to climate change, might alter the spatial and temporal terrestrial carbon balance for Hawai'i. Note that this model is an extension of the STSM presented in Daniel et al. (2016); readers are thus referred to this paper for additional details regarding the LULC change portion of the model.
As the purpose of the case study is to demonstrate the STSM-SF method, we consider here only two future scenarios: (1) a "LULC change" scenario, in which we assume that historical patterns of LULC change and disturbances (including wildfire), combined with projections of future shifts in moisture zones, continue into the future; and (2) a "fire only" scenario, in which the only disturbance we allow is wildfire, and no other LULC change or moisture zone shifts occur. All of the STSM parameters for both scenarios are the same as those in case-study model of Daniel et al. (2016), with the "fire only" scenario including only the Wildfire transitions shown in Figure 2. All the simulations were generated using the ST-Sim software version 3.0.44 (ApexRMS, 2017), with model inputs and outputs prepared using the R software version 3.2.4 (R Core Team, 2017).

| State variables and scales
As with the case-study model of Daniel et al. (2016), the spatial extent of our model was 16,416 km 2 , representing the terrestrial portion of the state of Hawai'i, which we divided into a grid of 1 × 1 km simulation cells. Our simulations were run for two time periods: (1) a "spinup" period, in which we ran simulations for 500 annual timesteps, in order to estimate the equilibrium distributions of ages and carbon stock sizes for each cell as of the year 2011; and (2) a "future" period, in which we ran the model forward at an annual timestep for 50 years, starting in 2011, and using the final conditions from the spin-up period as our new initial conditions. All simulations, for both the spin-up and future periods, were repeated for 100 Monte Carlo realizations.
A number of state variables were tracked for each cell and timestep. Firstly, we used all three of the traditional discrete state variables available for STSMs-that is the state type, age (from 0 to 250) and time-since-transition (TST). As in Daniel et al. (2016)

| Model structure
Our STSM-SF model is structured around two pathway diagrams: one for the transitions between states (as in all STSMs), and a second for the flows between stocks (Figure 2). In the stock-flow portion of our model, the flows represent fluxes of C between our C stocks, including: (1)  We represented this baseline flow amount as being independent of any of the stocks in the model-that is we assumed that the Growth flow type represented a fixed amount of C each year, and that the size of this flux, for each cell in our model, is a function only of the cell's current state type and age.
In addition to the these baseline flow amounts, we also estimated the rates at which C moves between stocks in response to each of the possible transition types shown in Figure 1

| Spatial and temporal variability in flows
A key feature of the STSM-SF approach is the ability to vary stocks and flows across cells and over time. We used two data sources to characterize the spatial variability in C flows in our simulations. The first of these was a state-wide map for Hawai'i, at a resolution of 1 × 1 km, estimating the average annual NPP (in kg C m −2 year −1 ) of each simulation cell in our landscape based on MODIS satellite imagery . The second was a map estimating the soil C (in kg C m −2 ), at 1 × 1 km resolution, using data from the Soil Survey Geographic Database (SSURGO) for the state of Hawai'i (Natural Resources Conservation Service, 2016). We used these two spatial data sources to scale the baseline flow amounts for each cell in our landscape according to the following constraints: (1) each cell's growth flow amount, relative to all other cells on the landscape with the same state type and age (and thus the same baseline flow amount), is proportional to the estimated NPP from the MODIS-generated map; (2) each cell's soil stock size, relative to all other cells on the landscape with the same state type and age, is proportional to the estimated soil C from the SSURGO map and (3)

| Initialization
For the future period simulations, the initial state type and TST values for each cell were set using the same approach as in Daniel et al.

| RESULTS
In addition to the two traditional forms of model output associated with STSMs-that is transition output and state output-a STSM-SF provides two additional forms output: (1) flow output, which records the amount of each flow type; and (2) stock output, which records the level of each stock type. As with the transition and state output, the flow and stock output is provided for every cell, timestep and realization of a simulation, which in turn can be summarized in various ways.
Our case-study provides a sample of the type of flow and stock output that can be generated using a STSM-SF. Figure 4, for example, shows a time-series summary of the flow output for two of the model's C fluxes-growth of living biomass, and total emissions-along with projections for the two largest C stocks in our case-study example-living biomass and soil organic matter. These results show firstly that, as we would expect given our spin-up procedure, the growth and emission fluxes appear to be in equilibrium for the "fire only" scenario, as do the living biomass and soil organic matter stocks. Second, we see   year; this is what we would expect for a system in equilibrium. On the other hand, for the "LULC change" scenario we see that the system is projected to have a negative mean NBP over the entire simulation period; as a result, the landscape is projected to be a net source of C to the atmosphere, although because of the steady flux of C into harvest products, the net flux of C to the atmosphere is projected to eventually decline.

| DISCUSSION
While the STSM method has been shown to be a general approach for representing a wide range of models of landscape dynamics (Daniel be integrated into a STSM. As evidenced by the widespread use of the stock-flow approach in the field of systems dynamics (Ford, 1999;Sterman, 2000), we believe that the stock-flow paradigm will prove to be an equally general and intuitive extension to the STSM method for conceptualizing and modelling continuous variables in a stochastic, spatially explicit context.
The case-study model for Hawai'i presented here demonstrates some of the key features of the STSM-SF approach. In this example, which follows the general approach recommended by the IPCC for preparing terrestrial national greenhouse gas inventories (Eggleston et al., 2006) Our case-study highlights one of the benefits of developing landscape simulation models within a general modelling framework, namely the ability to explore the effects of not only parameter uncertainties, as we have demonstrated in our case-study example, but also to explore questions of structural uncertainty-that is uncertainty in the structure of the models themselves (Morgan & Henrion, 1992;Walker et al., 2003). Unlike many existing landscape simulation models, in which the model structure is pre-defined, with the STSM-SF framework one is able to include any number and configuration of states, transitions, stocks and flows, and to subsequently alter the structure of the model as part of a scenario-based sensitivity analysis.
For example in our case study we developed specific forms for our LULC and C budget models, with a particular set of LULC classes/transitions and C pools/fluxes. However, we could quite easily generate new scenarios in the future, in which we added or removed certain LULC classes/transitions and C pools/fluxes, in order to further assess the sensitivity of our projections to our assumptions regarding the model's structure.
While adding stocks and flows overcomes a key limitation of STSMs, this new approach still has a few limitations. First, at present stocks are always defined as state variables at the level of a cell; there are applications for which it might be more appropriate for some stocks to be defined and tracked at a coarser resolution than the cellfor example the Atmosphere and Harvest Products stocks in our casestudy example might be better tracked at the resolution of the entire landscape. Extending our framework to allow state variables to be defined at varying, hierarchical spatial resolutions would accomplish this. Second, as outlined in Daniel et al. (2016), there is still no capability for STSMs to integrate agent/individual-based models (Grimm & Railsback, 2005;Matthews, Gilbert, Roach, Polhill, & Gotts, 2007); this, however, is an area of research we are actively pursuing. Finally, like all models of landscape dynamics, it can be challenging to parameterize a STSM-SF. An important feature of the STSM-SF method, however, is its ability to use the output of other models-such as the biogeochemical model used here in the case-study example-to assist with its parameterization. Due to the empirical nature of the STSM-SF method, whereby dynamics are expressed through probabilities (for transitions) and rates (for flows), the method offers a common language through which various models, operating at different scales, can be readily integrated.
To summarize, the addition of continuous stocks and flows to state-and-transition simulation models further extends the generality of the STSM method. When combined with the ST-Sim software, STSM-SFs provide a flexible new framework for developing a wide range of stochastic, spatially explicit models of landscape dynamics.