1 | lintest <- function(x, k) { x } |
---|
2 | exptest <- function(x, k) { (exp(x^k) - 1) / (exp(1) - 1) } |
---|
3 | logtest <- function(x, k) { log((x * (exp(k) - 1)) + 1) / k } |
---|
4 | #logtest <- function(x, k) { - log(exp(x) -x + 1)^(1/k) } |
---|
5 | polytest <- function(x, k) { x^k } |
---|
6 | gammatest <- function(x, k) { x^k } |
---|
7 | logistic <- function(x, k) { 1 / (1 + exp(-((x-0.5)*k))) } |
---|
8 | logistictest <- function(x, k) { ((logistic(x, k) - 0.5) / (1 - (logistic(0, k) *2))) + 0.5 } |
---|
9 | invlogistic <- function(x, k) { (log ( - (x) / ((x)-1))/k) + 0.5 } |
---|
10 | invlogistictest <- function(x, k) { invlogistic(((x-0.5) * (1 - (logistic(0, k) *2))) + 0.5, k) } |
---|
11 | |
---|
12 | fulllogistic <- function(x, k) { (((1 / (1 + exp(-((x-0.5)*k)))) - 0.5) / (1 - ((1 / (1 + exp(-((-0.5)*k)))) *2))) + 0.5 } |
---|
13 | fullinvlogistic <- function(x, k) { (log ( - (((x-0.5) * (1 - ((1 / (1 + exp(-(-0.5*k)))) *2))) + 0.5) / ((((x-0.5) * (1 - ((1 / (1 + exp(-(-0.5*k)))) *2))) + 0.5)-1))/k) + 0.5 } |
---|
14 | |
---|
15 | # Simplified. |
---|
16 | logistictest <- function(x, k) { (exp(k*x) - 1) / ((exp(0.5*k) - 1) * (1 + exp(k*(x-0.5)))) } |
---|
17 | invlogistictest <- function(x, k) { (log(-(((exp(0.5*k)-1)*x)+1)/((exp(0.5*k)*(x-1))-x))/k)+0.5 } |
---|
18 | |
---|
19 | link1 <- function(x) { lintest(x, 1) } |
---|
20 | |
---|
21 | logk01 <- function(x) { logtest(x, 0.1) } |
---|
22 | logk05 <- function(x) { logtest(x, 0.5) } |
---|
23 | logk1 <- function(x) { logtest(x, 1) } |
---|
24 | logk2 <- function(x) { logtest(x, 2) } |
---|
25 | logk3 <- function(x) { logtest(x, 3) } |
---|
26 | logk4 <- function(x) { logtest(x, 4) } |
---|
27 | logk5 <- function(x) { logtest(x, 5) } |
---|
28 | logk6 <- function(x) { logtest(x, 6) } |
---|
29 | logk7 <- function(x) { logtest(x, 7) } |
---|
30 | logk8 <- function(x) { logtest(x, 8) } |
---|
31 | |
---|
32 | expk01 <- function(x) { exptest(x, 0.1) } |
---|
33 | expk05 <- function(x) { exptest(x, 0.5) } |
---|
34 | expk1 <- function(x) { exptest(x, 1) } |
---|
35 | expk2 <- function(x) { exptest(x, 2) } |
---|
36 | expk3 <- function(x) { exptest(x, 3) } |
---|
37 | expk4 <- function(x) { exptest(x, 4) } |
---|
38 | expk5 <- function(x) { exptest(x, 5) } |
---|
39 | expk6 <- function(x) { exptest(x, 6) } |
---|
40 | expk7 <- function(x) { exptest(x, 7) } |
---|
41 | expk8 <- function(x) { exptest(x, 8) } |
---|
42 | |
---|
43 | polyk1 <- function(x) { polytest(x, 1) } |
---|
44 | polyk2 <- function(x) { polytest(x, 2) } |
---|
45 | polyk3 <- function(x) { polytest(x, 3) } |
---|
46 | polyk4 <- function(x) { polytest(x, 4) } |
---|
47 | polyk5 <- function(x) { polytest(x, 5) } |
---|
48 | polyk6 <- function(x) { polytest(x, 6) } |
---|
49 | polyk7 <- function(x) { polytest(x, 7) } |
---|
50 | polyk8 <- function(x) { polytest(x, 8) } |
---|
51 | polyk_2 <- function(x) { polytest(x, 1/2) } |
---|
52 | polyk_3 <- function(x) { polytest(x, 1/3) } |
---|
53 | polyk_4 <- function(x) { polytest(x, 1/4) } |
---|
54 | polyk_5 <- function(x) { polytest(x, 1/5) } |
---|
55 | polyk_6 <- function(x) { polytest(x, 1/6) } |
---|
56 | polyk_7 <- function(x) { polytest(x, 1/7) } |
---|
57 | polyk_8 <- function(x) { polytest(x, 1/8) } |
---|
58 | |
---|
59 | logisticunormk1 <- function(x) { logistic(x, 1) } |
---|
60 | logisticunormk2 <- function(x) { logistic(x, 2) } |
---|
61 | logisticunormk3 <- function(x) { logistic(x, 3) } |
---|
62 | logisticunormk4 <- function(x) { logistic(x, 4) } |
---|
63 | logisticunormk5 <- function(x) { logistic(x, 5) } |
---|
64 | logisticunormk6 <- function(x) { logistic(x, 6) } |
---|
65 | logisticunormk7 <- function(x) { logistic(x, 7) } |
---|
66 | logisticunormk8 <- function(x) { logistic(x, 8) } |
---|
67 | logisticunormk9 <- function(x) { logistic(x, 9) } |
---|
68 | logisticunormk10 <- function(x) { logistic(x, 10) } |
---|
69 | logisticunormk11 <- function(x) { logistic(x, 11) } |
---|
70 | logisticunormk12 <- function(x) { logistic(x, 12) } |
---|
71 | |
---|
72 | logistick1 <- function(x) { logistictest(x, 1) } |
---|
73 | logistick2 <- function(x) { logistictest(x, 2) } |
---|
74 | logistick3 <- function(x) { logistictest(x, 3) } |
---|
75 | logistick4 <- function(x) { logistictest(x, 4) } |
---|
76 | logistick5 <- function(x) { logistictest(x, 5) } |
---|
77 | logistick6 <- function(x) { logistictest(x, 6) } |
---|
78 | logistick7 <- function(x) { logistictest(x, 7) } |
---|
79 | logistick8 <- function(x) { logistictest(x, 8) } |
---|
80 | logistick9 <- function(x) { logistictest(x, 9) } |
---|
81 | logistick10 <- function(x) { logistictest(x, 10) } |
---|
82 | logistick11 <- function(x) { logistictest(x, 11) } |
---|
83 | logistick12 <- function(x) { logistictest(x, 12) } |
---|
84 | |
---|
85 | invlogisticunormk1 <- function(x) { invlogistic(x, 1) } |
---|
86 | invlogisticunormk2 <- function(x) { invlogistic(x, 2) } |
---|
87 | invlogisticunormk3 <- function(x) { invlogistic(x, 3) } |
---|
88 | invlogisticunormk4 <- function(x) { invlogistic(x, 4) } |
---|
89 | invlogisticunormk5 <- function(x) { invlogistic(x, 5) } |
---|
90 | invlogisticunormk6 <- function(x) { invlogistic(x, 6) } |
---|
91 | invlogisticunormk7 <- function(x) { invlogistic(x, 7) } |
---|
92 | invlogisticunormk8 <- function(x) { invlogistic(x, 8) } |
---|
93 | invlogisticunormk9 <- function(x) { invlogistic(x, 9) } |
---|
94 | invlogisticunormk10 <- function(x) { invlogistic(x, 10) } |
---|
95 | invlogisticunormk11 <- function(x) { invlogistic(x, 11) } |
---|
96 | invlogisticunormk12 <- function(x) { invlogistic(x, 12) } |
---|
97 | |
---|
98 | invlogistick1 <- function(x) { invlogistictest(x, 1) } |
---|
99 | invlogistick2 <- function(x) { invlogistictest(x, 2) } |
---|
100 | invlogistick3 <- function(x) { invlogistictest(x, 3) } |
---|
101 | invlogistick4 <- function(x) { invlogistictest(x, 4) } |
---|
102 | invlogistick5 <- function(x) { invlogistictest(x, 5) } |
---|
103 | invlogistick6 <- function(x) { invlogistictest(x, 6) } |
---|
104 | invlogistick7 <- function(x) { invlogistictest(x, 7) } |
---|
105 | invlogistick8 <- function(x) { invlogistictest(x, 8) } |
---|
106 | invlogistick9 <- function(x) { invlogistictest(x, 9) } |
---|
107 | invlogistick10 <- function(x) { invlogistictest(x, 10) } |
---|
108 | invlogistick11 <- function(x) { invlogistictest(x, 11) } |
---|
109 | invlogistick12 <- function(x) { invlogistictest(x, 12) } |
---|
110 | |
---|
111 | pdf("render.pdf", width=8, height=12) |
---|
112 | par(mfrow=c(3,2)) |
---|
113 | |
---|
114 | plot(link1, n=500, xlim=c(0,1), ylim=c(0,1), xlab="", ylab="", sub=expression(y == x), main="Linear mapping") |
---|
115 | |
---|
116 | plot(expk1, xlim=c(0,1), ylim=c(0,1), xlab="", ylab="", sub=expression(y == frac(e^x^k - 1, e - 1)), main="Exponential mapping") |
---|
117 | plot(expk2, n=500, add=TRUE) |
---|
118 | plot(expk3, n=500, add=TRUE) |
---|
119 | plot(expk4, n=500, add=TRUE) |
---|
120 | plot(expk5, n=500, add=TRUE) |
---|
121 | plot(expk6, n=500, add=TRUE) |
---|
122 | plot(expk7, n=500, add=TRUE) |
---|
123 | plot(expk8, n=500, add=TRUE) |
---|
124 | plot(expk01, n=500, add=TRUE) |
---|
125 | plot(expk05, n=500, add=TRUE) |
---|
126 | |
---|
127 | |
---|
128 | plot(logk1, n=500, xlim=c(0,1), ylim=c(0,1), xlab="", ylab="", sub=expression(y == frac(log((x * e^k) - 1) + 1, k)), main="Logarithmic mapping") |
---|
129 | plot(logk2, n=500, add=TRUE) |
---|
130 | plot(logk3, n=500, add=TRUE) |
---|
131 | plot(logk4, n=500, add=TRUE) |
---|
132 | plot(logk5, n=500, add=TRUE) |
---|
133 | plot(logk6, n=500, add=TRUE) |
---|
134 | plot(logk7, n=500, add=TRUE) |
---|
135 | plot(logk8, n=500, add=TRUE) |
---|
136 | plot(logk01, n=500, add=TRUE) |
---|
137 | plot(logk05, n=500, add=TRUE) |
---|
138 | |
---|
139 | |
---|
140 | plot(polyk1, n=500, xlim=c(0,1), ylim=c(0,1), xlab="", ylab="", sub=expression(y == x^k), main="Gamma (\"polynomial\") mapping") |
---|
141 | plot(polyk2, n=500, add=TRUE) |
---|
142 | plot(polyk3, n=500, add=TRUE) |
---|
143 | plot(polyk4, n=500, add=TRUE) |
---|
144 | plot(polyk5, n=500, add=TRUE) |
---|
145 | plot(polyk6, n=500, add=TRUE) |
---|
146 | plot(polyk7, n=500, add=TRUE) |
---|
147 | plot(polyk8, n=500, add=TRUE) |
---|
148 | plot(polyk_2, n=500, add=TRUE) |
---|
149 | plot(polyk_3, n=500, add=TRUE) |
---|
150 | plot(polyk_4, n=500, add=TRUE) |
---|
151 | plot(polyk_5, n=500, add=TRUE) |
---|
152 | plot(polyk_6, n=500, add=TRUE) |
---|
153 | plot(polyk_7, n=500, add=TRUE) |
---|
154 | plot(polyk_8, n=500, add=TRUE) |
---|
155 | |
---|
156 | # plot(logisticunormk1, n=500, xlim=c(0,1), ylim=c(0,1), xlab="", ylab="", sub="Logistic mapping (non-normal)") |
---|
157 | # plot(logisticunormk2, n=500, add=TRUE) |
---|
158 | # plot(logisticunormk3, n=500, add=TRUE) |
---|
159 | # plot(logisticunormk4, n=500, add=TRUE) |
---|
160 | # plot(logisticunormk5, n=500, add=TRUE) |
---|
161 | # plot(logisticunormk6, n=500, add=TRUE) |
---|
162 | # plot(logisticunormk7, n=500, add=TRUE) |
---|
163 | # plot(logisticunormk8, n=500, add=TRUE) |
---|
164 | # plot(logisticunormk9, n=500, add=TRUE) |
---|
165 | # plot(logisticunormk10, n=500, add=TRUE) |
---|
166 | # plot(logisticunormk11, n=500, add=TRUE) |
---|
167 | # plot(logisticunormk12, n=500, add=TRUE) |
---|
168 | |
---|
169 | plot(logistick1, n=500, xlim=c(0,1), ylim=c(0,1), xlab="", ylab="", sub=expression(y == frac(e^{k*x} - 1, (e^{0.5*k} - 1) * (1 + e^{k*(x-0.5)}))), main="Logistic mapping") |
---|
170 | plot(logistick2, n=500, add=TRUE) |
---|
171 | plot(logistick3, n=500, add=TRUE) |
---|
172 | plot(logistick4, n=500, add=TRUE) |
---|
173 | plot(logistick5, n=500, add=TRUE) |
---|
174 | plot(logistick6, n=500, add=TRUE) |
---|
175 | plot(logistick7, n=500, add=TRUE) |
---|
176 | plot(logistick8, n=500, add=TRUE) |
---|
177 | plot(logistick9, n=500, add=TRUE) |
---|
178 | plot(logistick10, n=500, add=TRUE) |
---|
179 | plot(logistick11, n=500, add=TRUE) |
---|
180 | plot(logistick12, n=500, add=TRUE) |
---|
181 | |
---|
182 | # plot(invlogisticunormk1, n=500, xlim=c(0,1), ylim=c(0,1), xlab="", ylab="", sub="Inverse logistic mapping (non-normal)") |
---|
183 | # plot(invlogisticunormk2, n=500, xlim=c(0,1), add=TRUE) |
---|
184 | # plot(invlogisticunormk3, n=500, xlim=c(0,1), add=TRUE) |
---|
185 | # plot(invlogisticunormk4, n=500, xlim=c(0,1), add=TRUE) |
---|
186 | # plot(invlogisticunormk5, n=500, xlim=c(0,1), add=TRUE) |
---|
187 | # plot(invlogisticunormk6, n=500, xlim=c(0,1), add=TRUE) |
---|
188 | # plot(invlogisticunormk7, n=500, xlim=c(0,1), add=TRUE) |
---|
189 | # plot(invlogisticunormk8, n=500, xlim=c(0,1), add=TRUE) |
---|
190 | # plot(invlogisticunormk9, n=500, xlim=c(0,1), add=TRUE) |
---|
191 | # plot(invlogisticunormk10, n=500, xlim=c(0,1), add=TRUE) |
---|
192 | # plot(invlogisticunormk11, n=500, xlim=c(0,1), add=TRUE) |
---|
193 | # plot(invlogisticunormk12, n=500, xlim=c(0,1), add=TRUE) |
---|
194 | |
---|
195 | plot(invlogistick1, n=500, xlim=c(0,1), ylim=c(0,1), xlab="", ylab="", sub=expression(y == frac(log(-frac(((e^{0.5*k}-1)*x)+1, (e^{0.5*k}*(x-1))-x)), k)+0.5), main="Inverse logistic mapping") |
---|
196 | plot(invlogistick2, n=500, xlim=c(0,1), add=TRUE) |
---|
197 | plot(invlogistick3, n=500, xlim=c(0,1), add=TRUE) |
---|
198 | plot(invlogistick4, n=500, xlim=c(0,1), add=TRUE) |
---|
199 | plot(invlogistick5, n=500, xlim=c(0,1), add=TRUE) |
---|
200 | plot(invlogistick6, n=500, xlim=c(0,1), add=TRUE) |
---|
201 | plot(invlogistick7, n=500, xlim=c(0,1), add=TRUE) |
---|
202 | plot(invlogistick8, n=500, xlim=c(0,1), add=TRUE) |
---|
203 | plot(invlogistick9, n=500, xlim=c(0,1), add=TRUE) |
---|
204 | plot(invlogistick10, n=500, xlim=c(0,1), add=TRUE) |
---|
205 | plot(invlogistick11, n=500, xlim=c(0,1), add=TRUE) |
---|
206 | plot(invlogistick12, n=500, xlim=c(0,1), add=TRUE) |
---|
207 | |
---|
208 | dev.off() |
---|