@@ -141,23 +141,24 @@ descdist <- function(data, discrete = FALSE, boot = NULL, method = "unbiased",
141
141
y <- kurtmax - (es2 ^ 4 + 2 * es2 ^ 3 + 3 * es2 ^ 2 - 3 )
142
142
lines(s2 ,y ,lty = 3 )
143
143
144
- legend(xmax * 0.2 ,ymax * 1.03 ,pch = obs.pch ,legend = " Observation" ,bty = " n" ,cex = 0.8 ,pt.cex = 1.2 ,col = obs.col )
144
+
145
+ legend(xmax * 0.55 , ymax * 1.03 ,legend = " Theoretical" ,bty = " n" ,cex = 0.8 )
146
+ legend(xmax * 0.6 , ymax * 0.98 ,pch = 8 ,legend = " normal" ,bty = " n" ,cex = 0.8 )
147
+ legend(xmax * 0.6 , ymax * 0.94 ,pch = 2 ,legend = " uniform" ,bty = " n" ,cex = 0.8 )
148
+ legend(xmax * 0.6 , ymax * 0.90 ,pch = 7 ,legend = " exponential" ,bty = " n" ,cex = 0.8 )
149
+ legend(xmax * 0.6 , ymax * 0.86 ,pch = 3 ,legend = " logistic" ,bty = " n" ,cex = 0.8 )
150
+ legend(xmax * 0.6 , ymax * 0.82 ,fill = " grey80" ,legend = " beta" ,bty = " n" ,cex = 0.8 )
151
+ legend(xmax * 0.6 , ymax * 0.78 ,lty = 3 ,legend = " lognormal" ,bty = " n" ,cex = 0.8 )
152
+ legend(xmax * 0.6 , ymax * 0.74 ,lty = 2 ,legend = " gamma" ,bty = " n" ,cex = 0.8 )
153
+ legend(xmax * 0.6 , ymax * 0.69 ,legend = c(" (Weibull is close to gamma and lognormal)" ), bty = " n" ,cex = 0.6 )
154
+
155
+ legend(xmax * 0.55 , ymax * 0.64 ,legend = " Empirical" ,bty = " n" ,cex = 0.8 )
156
+ legend(xmax * 0.6 , ymax * 0.60 ,pch = obs.pch ,legend = " data" ,bty = " n" ,cex = 0.8 ,pt.cex = 1.2 ,col = obs.col )
145
157
if (! is.null(boot )) {
146
- legend(xmax * 0.2 ,ymax * 0.98 ,pch = 1 ,legend = " bootstrapped values" ,
147
- bty = " n" ,cex = 0.8 ,col = boot.col )
158
+ legend(xmax * 0.6 , ymax * 0.56 ,pch = 1 ,legend = " bootstrap" , bty = " n" ,cex = 0.8 ,col = boot.col )
148
159
}
149
- legend(xmax * 0.55 ,ymax * 1.03 ,legend = " Theoretical distributions" ,bty = " n" ,cex = 0.8 )
150
- legend(xmax * 0.6 ,0.98 * ymax ,pch = 8 ,legend = " normal" ,bty = " n" ,cex = 0.8 )
151
- legend(xmax * 0.6 ,0.94 * ymax ,pch = 2 ,legend = " uniform" ,bty = " n" ,cex = 0.8 )
152
- legend(xmax * 0.6 ,0.90 * ymax ,pch = 7 ,legend = " exponential" ,bty = " n" ,cex = 0.8 )
153
- legend(xmax * 0.6 ,0.86 * ymax ,pch = 3 ,legend = " logistic" ,bty = " n" ,cex = 0.8 )
154
- legend(xmax * 0.6 ,0.82 * ymax ,fill = " grey80" ,legend = " beta" ,bty = " n" ,cex = 0.8 )
155
- legend(xmax * 0.6 ,0.78 * ymax ,lty = 3 ,legend = " lognormal" ,bty = " n" ,cex = 0.8 )
156
- legend(xmax * 0.6 ,0.74 * ymax ,lty = 2 ,legend = " gamma" ,bty = " n" ,cex = 0.8 )
157
- legend(xmax * 0.58 ,0.69 * ymax ,legend = c(" (Weibull is close to gamma and lognormal)" ),
158
- bty = " n" ,cex = 0.6 )
159
160
}
160
- else {
161
+ else {
161
162
# negbin dist
162
163
p <- exp(- 10 )
163
164
lr <- seq(- 100 ,100 ,0.1 )
@@ -172,16 +173,18 @@ descdist <- function(data, discrete = FALSE, boot = NULL, method = "unbiased",
172
173
s2 <- c(s2a ,s2b )
173
174
y <- c(ya ,yb )
174
175
polygon(s2 ,y ,col = " grey80" ,border = " grey80" )
175
- legend(xmax * 0.2 ,ymax * 1.03 ,pch = obs.pch ,legend = " Observation" ,bty = " n" ,cex = 0.8 ,pt.cex = 1.2 , col = obs.col )
176
+
177
+ legend(xmax * 0.55 ,ymax * 1.03 ,legend = " Theoretical" ,bty = " n" ,cex = 0.8 )
178
+ legend(xmax * 0.6 , ymax * 0.98 ,pch = 8 ,legend = " normal" ,bty = " n" ,cex = 0.8 )
179
+ legend(xmax * 0.6 , ymax * 0.94 ,fill = " grey80" ,legend = " negative binomial" ,bty = " n" ,cex = 0.8 )
180
+ legend(xmax * 0.6 , ymax * 0.90 ,lty = 2 ,legend = " Poisson" ,bty = " n" ,cex = 0.8 )
181
+
182
+ legend(xmax * 0.55 ,ymax * 0.85 ,legend = " Empirical" ,bty = " n" ,cex = 0.8 )
183
+ legend(xmax * 0.6 , ymax * 0.81 ,pch = obs.pch ,legend = " data" ,bty = " n" ,cex = 0.8 ,pt.cex = 1.2 , col = obs.col )
176
184
if (! is.null(boot )) {
177
- legend(xmax * 0.2 ,ymax * 0.98 ,pch = 1 ,legend = " bootstrapped values" ,
178
- bty = " n" ,cex = 0.8 ,col = boot.col )
185
+ legend(xmax * 0.6 , ymax * 0.77 ,pch = 1 ,legend = " bootstrap" ,bty = " n" ,cex = 0.8 ,col = boot.col )
179
186
}
180
- legend(xmax * 0.55 ,ymax * 1.03 ,legend = " Theoretical distributions" ,bty = " n" ,cex = 0.8 )
181
- legend(xmax * 0.6 ,0.98 * ymax ,pch = 8 ,legend = " normal" ,bty = " n" ,cex = 0.8 )
182
- legend(xmax * 0.6 ,0.94 * ymax ,fill = " grey80" ,legend = " negative binomial" ,
183
- bty = " n" ,cex = 0.8 )
184
- legend(xmax * 0.6 ,0.90 * ymax ,lty = 2 ,legend = " Poisson" ,bty = " n" ,cex = 0.8 )
187
+
185
188
# poisson dist
186
189
llambda <- seq(- 100 ,100 ,0.1 )
187
190
lambda <- exp(llambda )
0 commit comments