sim_ays_covar function

Simulate age-year-space covariance

Simulate age-year-space covariance

These functions return a function to use inside sim_distribution.

sim_ays_covar( sd = 2.8, range = 300, lambda = 1, model = "matern", phi_age = 0.5, phi_year = 0.9, group_ages = 5:20, group_years = NULL )

Arguments

  • sd: Variance (can be age specific).
  • range: Decorrelation range
  • lambda: Controls the degree of smoothness of Matern covariance process
  • model: String indicating either "exponential" or "matern" as the correlation function
  • phi_age: Defines autocorrelation through ages. Can be one value or a vector of the same length as ages
  • phi_year: Defines autocorrelation through years. Can be one value or a vector of the same length as years
  • group_ages: Make space-age-year noise equal across these ages
  • group_years: Make space-age-year noise equal across these years

Returns

Returns a function for use inside sim_distribution.