Menu Close

colin-daniel

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 87 total)
  • Author
    Posts
  • in reply to: Repeated Error in Visual Studio #5726
    colin-danielcolin-daniel
    Keymaster

    Hi Rachel – would really need to see your script in order to diagnose. That said it looks like the saveDatasheet function is expecting an SsimObject (for its first argument) and not getting it. An SsimObject is either a SsimLibrary, Project or Scenario. However if you are using the saveDatasheet fucntion to save a scenario-level datasheet (as you describe above), then this first argument must be a Scenario object. Perhaps check that this first argument is in fact a valid Scenario object before making the call to saveDatasheet function?

    So something like this:
    myScenario = scenario(myProject, scenario = “Test”)
    sheetName = “STSim_RunControl”
    mySheet = datasheet(myScenario,name=sheetName)
    myScenario # Add this line to check the scenario object is set correctly before calling saveDatasheet
    saveDatasheet(myScenario,mySheet,name=sheetName)

    colin-danielcolin-daniel
    Keymaster

    Hi Kori – it turns out this is an odd bug in rsyncrosim (version 1.0.3 or earlier) where nothing is returned if the Stratum Name is a number. We will fix this in the next rsyncrosim release. However in the interim you can get around the bug by prefixing your Stratum Name with a letter (e.g. “Bps-“).

    colin-danielcolin-daniel
    Keymaster

    Are you using dependencies in your scenarios? I’m just wondering if the initial conditions are perhaps in a dependent scenario with a different ID?

    If not, could you email/postyour zipped .ssim file and R script (can go to info@apexrms.com)? I would need to look at it to diagnose further – Colin

    colin-danielcolin-daniel
    Keymaster

    It seems most likely that you are opening a new empty scenario instead of the existing scenario you think you are opening. This is quite easy to do with the current version of rsyncrosim, as the library, project and scenario functions automatically create new objects if the one you specify does not exist.

    The best way to see what is going on is to check the summary contents of each object after you load it, to make sure it is in fact what you expect:
    project(Lib, summary=TRUE) will list all the projects in library Lib
    scenario(Prj, summary=TRUE) will list all the scenarios in the project Prj

    You can then confirm you are referencing the correct project and scenario before actually opening it.

    I hope this helps. Colin

    colin-danielcolin-daniel
    Keymaster

    The name of the datasheet is indeed “STSim_InitialConditionsNonSpatialDistribution”.

    There are several reasons why the datasheet may appear empty to you – without looking at your R code it would be tough to figure out the reason. However if you want to see an example of how to set the Non-Spatial Initial Conditions for ST-Sim, you can look at the rsyncrosim-demo.R example script.

    colin-danielcolin-daniel
    Keymaster

    The link provided above does not appear to work any longer. The following link worked for me instead:
    https://www.microsoft.com/en-ca/download/details.aspx?id=30679
    Then choose to download the file “VSU_4\vcredist_x64.exe”

    It seems to me this link is likely to change again. If the link above stops working, then I suggest simply google searching the following:
    “Download Visual C++ Redistributable for Visual Studio 2012 Update”

    in reply to: Temporal transition multipliers #4412
    colin-danielcolin-daniel
    Keymaster

    An MCM file is a very particular approach for setting up variability in transitions over time that was developed in the 1990s for use specifically with a software product called VDDT. With ST-Sim there are now unlimited possibilities for how to specify variability in transitions, including covariance between model inputs, so it no longer makes much sense to restrict oneself to something so specific as the old MCM approach. I occasionally hear of former VDDT users in Oregon still referring to the approach, but that’s about it. Everyone else seems to have moved on.

    There are many ways to specify spatial and temporal variability in transitions. How you do this depends on the processes you are trying to represent. Some of us have spent a large part of our careers trying to do this properly. There are also many examples of it being done naively and thus, I would argue, poorly. I suggest looking at the paper by Daniel et al (2016) to get a sense of some of the opportunities and challenges of characterizing variability in model inputs. I’m afraid it’s not something that can be really be covered in a forum post.

    We are planning to offer an advanced course in ST-Sim this fall, however, where this kind of question would be discussed. The final dates for the next training session have not yet been finalized, but if you check back regularly on our home page (or subscribe to our news feed) then you should see the announcement soon.

    in reply to: Timestep 0 in State Classes Report #4411
    colin-danielcolin-daniel
    Keymaster

    Because STSMs are stochastic, the state class of each cell is a random variable. As a result in ST-Sim the initial state of each cell is sampled from a distribution for each Monte Carlo realization. The distribution used to set this initial state will depend on your model settings – it can be configured to be anything you like. Often, however, the initial state class of each cell is specified as a multinomial distribution.

    in reply to: Model failure #4387
    colin-danielcolin-daniel
    Keymaster

    It could be a RAM issue. The amount of RAM required depends on the specifics of your model run, so we would need to look at the specifics of your run to determine the cause.

    in reply to: inbuilt tool to calculate transition probabilities #4374
    colin-danielcolin-daniel
    Keymaster

    Defining the transition probabilities is where all the work in developing state-and-transition simulation models occurs. Ultimately it is these probabilities that characterize your model. There are many different ways to estimate these probabilities, including analyzing experimental data, reviewing existing literature, and soliciting expert opinion.

    My suggestion would be to review some of the existing publications to get a sense for how others have estimated these probabilities. You can find a list of past publications at http://www.syncrosim.com/index.php?title=Publications. You can also look at proceedings from past STSM user conferences at http://www.syncrosim.com/index.php?title=User_Conferences

    colin-danielcolin-daniel
    Keymaster

    The information shown on the various pathway diagrams is provided in tabular format on the last 2 tabs (labelled “States” and “Transitions”) at the bottom of the Transition Pathways screen. The various diagrams simply provide a graphical way of viewing the data on these 2 tabs. All of the data, across all of the Pathway Diagrams, is in fact found on these 2 tabs. To export the pathway diagrams, you can open the States tab, right click and select Export All. This will allow you to export the information regarding your states (i.e. boxes) to Excel or CSV. Next you can open the Transitions tab and repeat these same steps to also export the information regarding your Transitions (i.e. arrows). In both cases this will export all of the pathway diagram information. The information pertaining to the “All Strata” diagram is found in the rows that have blank values for the Primary Stratum field (which by default is labelled as “Vegetation Type”) in these 2 tables.

    • This reply was modified 5 years, 2 months ago by Tom RoeAdminTom RoeAdmin.
    in reply to: Multipliers for transition pathways? #4331
    colin-danielcolin-daniel
    Keymaster

    Hi Sarah – there are several ways to vary transition probabilities over space and time – with increasing degree of specificity (and thus complexity):

    1. The simplest way to vary transition probabilities over time is to use the “Transition Multiplier” feature. This is a very popular way to get started with variability in transition probabilities. If you are using the Windows user interface you can access this feature using the “Transitions-Multipliers” screen (under the Advanced tab) from within your Scenario. We call this the “Transitions Multiplier” scenario datasheet. The trick with all ST-Sim datasheets is that by default only the required columns are displayed. If you right click on the empty grid in the user interface, however, a list of optional fields will be displayed for each datasheet. After right-clicking you can select the “Timestep” column for display. You can then enter a series of multipliers in this grid for each combination of Transition Group and Timestep. The values entered here for multipliers are then used to scale your base probabilities for each Transition Group up and down for each timestep. So for example a row with Transition Group=Fire, Timestep=1, Multiplier=0.5 would scale the base probability for Fire by 0.5 in Timestep 1. The simplest way to do this is to set your base transition probabilities all to 1 (in your Pathway Diagram), and then to enter the actual value of your probabilities as multipliers.

    2. Using the Transition-Multipliers scenario datasheet you can also vary your probabilities spatially by displaying a second optional “Stratum” column. If you’ve defined various Strata for your model (under Project Definitions), then you can use this screen to also varyyour base probabilities by these strata (in addition to varying them by timestep).

    3. If you want to vary your probabilities spatially at the level of a cell, you can also use the “Transition Spatial Multipliers” scenario datasheet. This datasheet allows you to specify a multiplier for your probabilities – similar to the way described above – except that here the multiplier is not specified as a single value by timestep (and strata), but rather as a raster by timestep. This allows you to then vary the probability of any transition, for any cell and any timestep. Note that you can also use the Transition Multiplier and Transition Spatial Multiplier datasheets together – the final probability is the combined multiplier from both.

    As for sampling probabilities from a distribution, there are several ways to do this also (with again increasing complexity):

    1. One of the optional columns on the Transition Multiplier scenario datasheet is “Multiplier Distribution”. If you display this then you can choose from one of the built-in ST-Sim distributions. For example if you select “Normal” for the distribution, the “Multiplier” column now represents the mean while the “Multiplier SD” column is used to specify the Standard Deviation. ST-Sim then samples from this distribution throughout the simulation. The column “Multiplier Sampling Frequency” tells ST-Sim how often to sample from the distribution. You can also vary the parameters of the distribution for every Stratum and/or Timestep if you like, using the Stratum and Timestep columns.

    2. If you would like to sample from a distribution that is not built-in to ST-Sim, then there are again a couple of ways to do this. The first is to enter your own custom distributions directly into ST-Sim. Basically you first provide a name for your distribution (under Project Definitions), and then use the “Distributions” scenario datasheet to specify the frequency distribution from which to sample. Any distributions defined this way get added to the list of built-in distributions and can thus be used as described above in the Transition Multiplier scenario datasheet.

    3. The most complicated (yet most flexible) way to sample transition probabilities from a distribution is to do sampling yourself before you start the simulation, and then feed to sampled values (e.g. for Stratum, Iteration and Timestep) into either the “Transition Multipliers” or “Transition Spatial Multipliers” scenario datasheets. This gives you full control over the sampling, but can generate quite large input datasets. Generally we use a script in either R or Python – or in simple cases even an Excel file – to generate the set of such multipliers, save them (e.g. as a CSV or XLSX), and then import them into the appropriate scenario datasheet. The one constraint with this approach is that it requires all the sampling to be done before the ST-Sim simulation begins. Very soon, however, we hope to add a feature that will also allow you to call scripts (e.g. in Python or R) to do the sampling within the simulation.

    A final note is that much of what is described above often relies on one or more scripts to generate the appropriate model inputs. Our language of choice at the moment for preparing such inputs is R (although other languages work equally well) – as such we have been working on an R package that will facilitate the movement of data back and forth between ST-Sim and R, which we hope to release in beta form in the next few weeks. If you are interested in a copy of the package in its early release form let us know and we can make sure you are notified when it comes out.

    Hope this helps – Colin

    colin-danielcolin-daniel
    Keymaster

    I can think of two basic ways in which a species distribution model (SDM) can be linked to a state-and-transition simulation model (STSM).

    The first approach fits a SDM to historical data, in order to predict species occurrence probabilities as a function of various predictor variables into the future, and then feeds these occurrence probabilities into the STSM in order modify the STSM transition probabilities over the course of a simulation. This is the approach used by Miller et al (2015). Here the output of the SDM is an input to the STSM. In this way the SDM can be used to predict future changes in plant species distributions in response to environmental variables, and then these projected changes in species distribution can in turn be used to modify future vegetation dynamics.

    The other approach would be the reverse of this. Here you would also fit a SDM to historical data; however at least one of the predictor variables in your SDM would need to also be predicted by the STSM (e.g. land use/cover). You could then use the STSM to simulate future values for this predictor variable, and then feed these future projections back into your SDM to estimate future species ranges.

    Which approach is most appropriate depends on your question. The former is well suited to incorporating the effects of climate change into models of vegetation dynamics. The later might be better suited to predicting the effects of changes in land cover on the future distribution of animal habitat.

    Hope this helps, Colin

    • This reply was modified 5 years, 2 months ago by Tom RoeAdminTom RoeAdmin.
    in reply to: Acres to Km? and Harvest of more than one transition #4295
    colin-danielcolin-daniel
    Keymaster

    Under the Projection Definitions for your project, you can set the units for both timesteps and area under the Terminology tab. For example you could change the areas from Acres to Km2 or Ha if you prefer metric units.

    in reply to: Export Figures #4109
    colin-danielcolin-daniel
    Keymaster

    Hi Andia – there are a number of options for generating figures from ST-Sim:
    1. When you have a chart displayed you can right click and select “Copy to Clipboard”, and then paste the chart image into whatever software you like (e.g. Powerpoint, Paint, Illustrator, etc.). You can also customize the display of the chart a bit by right-clicking and selecting “Options” before doing the copy/paste.
    2. You can right click on the chart and select “Export” or “Export All” to export the chart data to Excel or CSV; you can then import the data into whatever software you like to create custom plots
    3. Similar to #2, you can export detailed output using the “Export” tab (beside “Charts” and “Maps” when viewing output)
    4. Finally what we often do on larger projects is to write a script in R (or Python) that imports the run results from the ST-Sim library directly into a dataframe, and then replots the data using R plotting functions (such as ggplot2). The advantage here is that you can fully automate the plotting process so that it can be re-run repeatedly as you generate new output. This is the most customizable option, but requires a fair investment in time in order to setup the R script to do the plotting. We are currently working on an R package that will make this option much simpler, however the package is still in development at the moment. You can, of course, combine this with option 2 in order to simplify the setup process in R.

    Hope this helps! Colin.

Viewing 15 posts - 31 through 45 (of 87 total)