11# This file was generated by Rcpp::compileAttributes
22# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
33
4+ # ' Compute a white noise environment with a shift
5+ # ' @param t the time point
6+ # ' @param env_args other args:
7+ # ' t.jump the location for the jump,
8+ # ' delta env change that takes place at t.jump
9+ # ' sd noise in env
10+ # ' sdc noise in cue
11+ # ' @details nada
12+ NULL
13+
414# ' Compute mean fitness under stabilizing selection
515# ' @param zbar mean trait prior to selection
616# ' @param theta enironmental optimum
7- # ' @param Oz2 strength of stabilizing selection
8- # ' @param gamma 1/(Oz2 + Vz2), with Vz2 phenotypic variance
9- # ' @details no details
17+ # ' @param oz2 strength of stabilizing selection
18+ # ' @param gamma 1/(oz2 + Vz2), with Vz2 phenotypic variance
19+ # ' @details IN USE
1020# ' @export
11- Log_W_bar <- function (zbar , theta , Oz2 , gamma ) {
12- .Call(' phenoecosim_Log_W_bar' , PACKAGE = ' phenoecosim' , zbar , theta , Oz2 , gamma )
21+ Log_W_bar <- function (zbar , theta , oz2 , gamma ) {
22+ .Call(' phenoecosim_Log_W_bar' , PACKAGE = ' phenoecosim' , zbar , theta , oz2 , gamma )
1323}
1424
1525# ' Compute mean fitness under stabilizing selection
1626# ' @inheritParams Log_W_bar
17- # ' @param LOG (=TRUE) whether to return the log of fitness
18- # ' @details no details
27+ # ' @param LOG (=TRUE) whether to return the log of fitness
28+ # ' @details IN USE
1929# ' @export
20- W_bar <- function (zbar , theta , Oz2 , gamma , LOG ) {
21- .Call(' phenoecosim_W_bar' , PACKAGE = ' phenoecosim' , zbar , theta , Oz2 , gamma , LOG )
30+ W_bar <- function (zbar , theta , oz2 , gamma , LOG ) {
31+ .Call(' phenoecosim_W_bar' , PACKAGE = ' phenoecosim' , zbar , theta , oz2 , gamma , LOG )
2232}
2333
24- # ' Compute population growth rate under stabilizing selection
34+ # ' Compute population growth rate under stabilizing selection and no regulation
2535# ' @param R0 basic reproductive number
2636# ' @param Wbar average fitness
27- # ' @details Assumes density-independent
28- # ' @export
29- R_bar <- function (R0 , Wbar ) {
30- .Call(' phenoecosim_R_bar' , PACKAGE = ' phenoecosim' , R0 , Wbar )
31- }
32-
33- # ' Compute LOG population growth rate under stabilizing selection
34- # ' @inheritParams R_bar
35- # ' @param logWbar log average fitness
36- # ' @details Assumes theta-logistic population regulation
37+ # ' @param N number of individuals in this generation
38+ # ' @param K carrying capacity
39+ # ' @details Assumes ceiling population regulation
3740# ' would be good to have separate DD function specified after
3841# ' chevin and lande 2010
3942# ' @export
40- Log_R_bar <- function (R0 , logWbar ) {
41- .Call(' phenoecosim_Log_R_bar ' , PACKAGE = ' phenoecosim' , R0 , logWbar )
43+ R_bar <- function (R0 , Wbar , N ) {
44+ .Call(' phenoecosim_R_bar ' , PACKAGE = ' phenoecosim' , R0 , Wbar , N )
4245}
4346
44- # ' Compute population growth rate under stabilizing selection
45- # ' @inheritParams R_bar
47+ # ' Compute population growth rate under stabilizing selection and ceiling regulation
48+ # ' @param R0 basic reproductive number
49+ # ' @param Wbar average fitness
4650# ' @param N number of individuals in this generation
4751# ' @param K carrying capacity
48- # ' @param thetaL theta-logistic parameter for density dependence
49- # ' @details Assumes theta-logistic population regulation
52+ # ' @details Assumes ceiling population regulation
5053# ' would be good to have separate DD function specified after
5154# ' chevin and lande 2010
5255# ' @export
53- R_bar_dd <- function (R0 , Wbar , N , K , thetaL ) {
54- .Call(' phenoecosim_R_bar_dd ' , PACKAGE = ' phenoecosim' , R0 , Wbar , N , K , thetaL )
56+ R_bar_ceiling <- function (R0 , Wbar , N , K ) {
57+ .Call(' phenoecosim_R_bar_ceiling ' , PACKAGE = ' phenoecosim' , R0 , Wbar , N , K )
5558}
5659
57- # ' Selection on plasticity as as function of environment assuming stabilizing selection
58- # ' @param gamma = 1/(Oz2 + Vz2), with Vz2 phenotypic variance
59- # ' @param A the environmental optimum RN int
60- # ' @param B the environmental optimum RN slope
61- # ' @param a current value of RN int
62- # ' @param b current value of RN slope
63- # ' @param e_t environment now
64- # ' @param e_plast env that cues plasticity
60+ # ' Compute population growth rate under stabilizing selection and theta-logistic regulation
61+ # ' @inheritParams R_bar_ceiling
62+ # ' @param thetaL theta-logistic parameter for density dependence
63+ # ' @details Assumes theta-logistic population regulation
64+ # ' would be good to have separate DD function specified after
65+ # ' chevin and lande 2010
6566# ' @export
66- Beta <- function (gamma , A , B , a , b , e_t , e_plast ) {
67- .Call(' phenoecosim_Beta ' , PACKAGE = ' phenoecosim' , gamma , A , B , a , b , e_t , e_plast )
67+ R_bar_thetalog <- function (R0 , Wbar , N , K , thetaL ) {
68+ .Call(' phenoecosim_R_bar_thetalog ' , PACKAGE = ' phenoecosim' , R0 , Wbar , N , K , thetaL )
6869}
6970
7071# ' Va additive genetic variance in the phenotype as a function of the environment
@@ -75,28 +76,25 @@ Va <- function(env, GG) {
7576 .Call(' phenoecosim_Va' , PACKAGE = ' phenoecosim' , env , GG )
7677}
7778
78- # ' Compute a white noise environment with a shift
79- # ' @param t the time point
80- # ' @param env_args other args:
81- # ' t.jump the location for the jump,
82- # ' delta env change that takes place at t.jump
83- # ' sd noise in env
84- # ' sdc noise in cue
85- # ' @details nada
79+ # ' Compute correctly-scaled environment of development and selection
80+ # ' @param env_args environment args
81+ # ' @param T how many gens
82+ # ' @details given a pre-generated vector of random environments
8683# ' @export
87- Env_shift_cpp <- function (t , env_args ) {
88- .Call(' phenoecosim_Env_shift_cpp ' , PACKAGE = ' phenoecosim' , t , env_args )
84+ make_env <- function (T , env_args ) {
85+ .Call(' phenoecosim_make_env ' , PACKAGE = ' phenoecosim' , T , env_args )
8986}
9087
91- # ' Compute phenotypic dynamic Time Series of trait + demographic change under stabilizing selection as
88+ # ' Compute phenotypic dynamic Time Series of trait + demographic change under stabilizing selection as
9289# ' function of environment (after Lande Chevin)
9390# ' @param T end time, assuming start time of 1
9491# ' @param X parameters (z, a, b, wbar, logN, theta)
95- # ' @param params a list with (gamma_sh, omegaz, A, B, R0, Va , Vb, delta, sigma_xi, rho_tau, fractgen)
92+ # ' @param params a list with (gamma_sh, omegaz, A, B, R0, var_a , Vb, delta, sigma_xi, rho_tau, fractgen)
9693# ' @param env_args extra args for env.fn
9794# ' @details NB - for now assume Tchange = 0 and demography after CL 2010
95+ # ' @value a long matrix
9896# ' @export
99- pdTS <- function (T , X , params , env_args ) {
100- .Call(' phenoecosim_pdTS ' , PACKAGE = ' phenoecosim' , T , X , params , env_args )
97+ simulate_pheno_ts <- function (T , X , params , env_args ) {
98+ .Call(' phenoecosim_simulate_pheno_ts ' , PACKAGE = ' phenoecosim' , T , X , params , env_args )
10199}
102100
0 commit comments