Giter Club home page Giter Club logo

squidsim's People

Contributors

alrutten avatar hallegue avatar joelpick avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

squidsim's Issues

covariance structures

Need to work out how best to allow a user to simulate phylogenetic effects or breeding values, and perhaps more broadly give a correlation matrix, to allow for spatial effects for example.

named factors in data_structure

potential bug - if something is input as a fixed factor (fixed =TRUE in parameter list), the user can give names. If these were the same names as in the data_structure, there is no reference back to them in the code, so it would be easy for a user to put them in the wrong way round and the function wouldn't detect this, so the effects would be the wrong way in the generated data.

Also the default naming should be better. At the moment, it comes out as e.g. sex_effect1, sex_effect2. It would be much better if it linked back the names in the data_structure, so was sex_male and sex_female for example

sampling ideas

  1. sampling to create survival data - binomial data, remove records after the first 1 (or 0) within a certain group
  2. sampling to create structure that realistically creates number of observations per individual if you measure them across lifespan (geometric distribution)

":" in make_structure

Good for specifying, but shouldn't be in the names in the resulting data.frame - year:month should end up as something like year_month

Concistency in parameter naming

Here some thoughts on naming parameters:

The population id in the output dataset is named squid_pop. None of the other parameters is preceded by squid_. May be have it just pop or population.

All parameter names are in lower case except N and N_pop. What about n and n_pop?

wrapper functions

is there an easy way to to generate code for common model types. E.g random regression is a little complex, but maybe could have a function taht would generate random regression code structure?

Sampling from population

I'm trying to sample 25 individuals from simulated data of 100 individuals. However, the number of individuals sampled is different in each simulation.

library(squidSim)

sim_res <- simulate_population(
  
  data_structure = make_structure("individual(100)", repeat_obs=1),
  response_name = "Female",
  
  parameters = list(
    
    intercept = 0.19360,
    
    observation = list(
        names = c("Elo_score"),
        beta  = c(-0.11368)
      ),
    
    residual = list(
            vcov = 6.95e-10
          )
  ),
  
  family = "binomial", 
  link   = "logit",
  
  n_pop = 1,
  
  sample_type  = "nested",
  sample_param = cbind(individual=25, observation=1)
)

sample_data <- get_sample_data(sim_res, sample_set=1)

different sampling regimes for different predictors/responses

Think the best way to do this would be to specify different sampling regimes, and then have a way of combining them, by specifying which variables have which sampling regime.

Could do this in get_sample_data(), something along the lines of giving a list
list(1=c("rain"), 2=c("y"))
which would indicate that the first sampling regime was used for "rain" and the second for "y". This would then enable different response variables to be sampled differently, for example
list(1=c("y1"), 2=c("y2"))

It would also be a good idea to allow the sampled data to be returned with NAs in it, for example, have an argument include_NA=TRUE (with FALSE as default)

Covariance between know predictors and simulated predictors

When simulating predictors, squidSim allows to specify the covariance matrix between all these predictors. squidSim also allows to input the user data. However, the covariance between simulated and know predictors is not possible. This could be a very useful feature.

Function to estimate the expected (co)variances

I think it will be nice to have a function that summarizes the expected patterns of variance and covariance at the different levels due to known and unknown sources. As well as the proportion of (co)variance explained by each process. This is something that is implemented in the squidApp

update function

would be useful to have a function that allows minor updates to parameter list, rather than complete respecification, e.g.
update(group, parameter, values)

covariate bug

naming something in the parameter list with covariate=TRUE doesn't seem to lead affect what it is called in predictor matrix

missing indices in 3)

Below the first equation, but also in the second chunk, Z and E are missing their indices so that the current documentation says that two matrices both follow multivariate normal distributions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.