-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror_function_tests.R
More file actions
executable file
·34 lines (27 loc) · 1.1 KB
/
error_function_tests.R
File metadata and controls
executable file
·34 lines (27 loc) · 1.1 KB
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
# error_function_tests.R - Bill White - 3/11/19
# Parameters:
# x_s - vector of numerics x-axis values x = [0, inf)
# n_s - vector of numerics - selects generalized error function E_n(x)
library(ggplot2)
source("error_function.R")
# other attempts:
# Abramowitz and Stegun
#raw_results <- amstat_error_as(z_s = x_s)
# x_s <- seq(from = -3, to = 3, by = 0.1)
#n_s <- 1:4
#
#raw_results <- amstat_error_en_x(x_s = x_s, n_s = n_s)
#raw_results <- amstat_error_erf_x(x_s = x_s)
# https://ipfs.io/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki/Error_function.html
x_s <- seq(from = -3, to = 3, by = 0.05)
raw_results <- amstat_error_generalized(x_s = x_s, n_s = c(1:4, 4.25))
head(raw_results)
plot_obj <- ggplot(raw_results, aes(x = x, y = y, colour = Parameters)) +
geom_line() +
xlab("x") + ylab("E_n(x)") + ylim(-3, 3) +
ggtitle(label = "Generalized Error E_n(x) functions",
subtitle = "1 = straight line, 2 = erf(x),... other not characterized") +
scale_fill_discrete(name = "Parameters")
print(plot_obj)
# y_s <- amstat_error_stackexchange(0.2, 0.25, x_s)
# plot(x_s, y_s, type = 'l')