-
Notifications
You must be signed in to change notification settings - Fork 0
/
stages_pva.R
104 lines (69 loc) · 3.67 KB
/
stages_pva.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
## ----message=FALSE, warning=FALSE--------------------------------------------------------------
library(diagram)
library (popbio)
## ----------------------------------------------------------------------------------------------
lotus_stages <- c ("plántula", "repro1", "repro2", "repro3")
## ----------------------------------------------------------------------------------------------
lotus_n0 <- c (100,100,100,100)
lotus_n0_alt <- c(10,10,10,370)
## ----------------------------------------------------------------------------------------------
lotus_trans <- c(
0.000, 0.165, 0.711, 2.215,
0.000, 0.000, 0.000, 0.000,
0.000, 0.013, 0.013, 0.002,
0.182, 0.286, 0.436, 0.624
)
## ----------------------------------------------------------------------------------------------
lotus_matrix <- matrix2(lotus_trans, lotus_stages)
## ---- fig.asp=0.8------------------------------------------------------------------------------
plotmat(lotus_matrix, relsize =0.80, self.cex = 0.6, self.shifty=0.08, self.shiftx = c(0,0,-0.05,0),
box.prop = 0.3, box.type = "round" , box.size = 0.1, lwd = 1, pos =,
arr.col = "yellow", arr.lcol = "black", arr.type = "triangle", txt.col = "blue",
main = "Esquema del ciclo de L. arinagensis")
## ----------------------------------------------------------------------------------------------
lambda (lotus_matrix)
## ----------------------------------------------------------------------------------------------
lotus_20022003 <- matrix(c(
0.000, 0.496, 0.972, 1.743,
0.000, 0.000, 0.000, 0.000,
0.000, 0.006, 0.000, 0.000,
0.379, 0.480, 0.540, 0.602
), nrow = 4, byrow = TRUE, dimnames = list(lotus_stages, lotus_stages))
lotus_20032004 <- matrix(c(
0.000, 0.000, 0.076, 1.002,
0.000, 0.000, 0.000, 0.000,
0.000, 0.000, 0.023, 0.006,
0.167, 0.120, 0.349, 0.569
), nrow = 4, byrow = TRUE, dimnames = list(lotus_stages, lotus_stages))
lotus_20042005 <- matrix(c(
0.000, 0.000, 1.086, 3.900,
0.000, 0.000, 0.000, 0.000,
0.000, 0.032, 0.016, 0.000,
0.000, 0.258, 0.419, 0.701
), nrow = 4, byrow = TRUE, dimnames = list(lotus_stages, lotus_stages))
## ----------------------------------------------------------------------------------------------
lotus_lista <- list(lotus_20022003, lotus_20032004, lotus_20042005)
## ----echo=FALSE--------------------------------------------------------------------------------
`lotus_lista`
## ----------------------------------------------------------------------------------------------
set.seed(12345)
lotus_stoch_proj <- stoch.projection (lotus_lista, lotus_n0, tmax=25, nreps=1000)
tail (lotus_stoch_proj)
## ----------------------------------------------------------------------------------------------
set.seed(12345)
(lotus_stoch_r <- stoch.growth.rate (lotus_lista, prob = NULL, maxt = 50 ))
## ----------------------------------------------------------------------------------------------
(lotus_lambda_sim <- exp(lotus_stoch_r$sim))
(lotus_lambda_anal <- exp(lotus_stoch_r$approx))
## ----------------------------------------------------------------------------------------------
set.seed(12345)
stoch.sens(lotus_lista)
## ----------------------------------------------------------------------------------------------
set.seed(12345)
lotus_sqe <- stoch.quasi.ext (lotus_lista, lotus_n0, tmax=25, Nx=50, maxruns = 10, nreps=1000)
tail(lotus_sqe)
## ----------------------------------------------------------------------------------------------
mean(lotus_sqe[25,]); sd(lotus_sqe[25,])
## ---- fig.asp=0.8, fig.align='center'----------------------------------------------------------
matplot (lotus_sqe, xlab="Años", ylab=expression(P[cuasi-extinción]),
type='l', lty=1, las=1)