-
Notifications
You must be signed in to change notification settings - Fork 2
/
.Rhistory
349 lines (349 loc) · 11.5 KB
/
.Rhistory
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
install.packages(c("curl", "flexmix", "formatR", "htmltools", "Matrix", "nimble", "radiant.basics", "radiant.design", "radiant.model", "rmarkdown", "shiny"))
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
filt <- read.table("/home/oscar/Oscar/Rfiles/VES/schlumcoeff.dat", h = F)
filt
?devtools::use_data
devtools::use_data(filt, pkg = rves)
devtools::use_data(filt)
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
devtools::document()
filt
devtools::document()
?switch
source('~/Oscar/Rfiles/rves/R/calibration.R')
devtools::document()
devtools::document()
devtools::document()
devtools::document()
library(rves)
library(rves)
devtools::document()
library(rves)
library(rves)
devtools::document()
library(rves)
library(rves)
apparent_resistivities(c(10,100,500,100),c(20,10,30,100),rves::filt)
library(rves)
nlayers <- 4
thick <- vector("numeric", length = nlayers) #layer thicknesses
rho <- vector("numeric", length = nlayers) #layer resistivities
thick <- c(10, 50, 200, 10000)
rho <- c(250, 100, 500, 200)
D <- read.table('/home/oscar/Oscar/Rfiles/VES/sev1.csv',h=T)
D <- read.csv('/home/oscar/Oscar/Rfiles/VES/sev1.csv',h=T)
D
sev1<-ves('S1',ab2=D$ab.2,apprho = D$rhoapp)
plot(sev1)
summary(sev1)
calibrate
devtools::document()
library(rves)
?convolution
?calibrate
calibrate
calibrate()
calibrate(sev1)
rvess::calibrate(sev1)
rves::calibrate(sev1)
devtools::document()
library(rves)
sev1
sev1.fit <- calibrate(sev1)
sev1.fit <- calibrate(sev1,opt.method = 'GA')
par0 <- c(10,100,20,30,10,10,10,100)
sev1.fit <- calibrate(sev1,opt.method = 'GA',obj.fn = 'rss',par0 = par0,lower=1e-3,upper=1e4)
library(rves)
sev1.fit <- calibrate(sev1,opt.method = 'GA',obj.fn = 'rss',par0 = par0,lower=1e-3,upper=1e4)
sev1.fit <- calibrate(sev1,opt.method = 'L-BFGS-B',obj.fn = 'rss',par0 = par0,lower=1e-3,upper=1e4)
se1.fit
sev1.fit
par0
par0 <- c(100,100,20,20,10,1000)
sev1.fit <- calibrate(sev1,opt.method = 'L-BFGS-B',obj.fn = 'rss',par0 = par0,lower=1e-3,upper=1e4)
warnings()
sev1.fit
?optim
par0 <- c(100,10,200,50,30,1000)
sev1.fit <- calibrate(sev1,opt.method = 'L-BFGS-B',obj.fn = 'rss',par0 = par0,lower=1e-3,upper=1e4)
sev1.fit
par0 <- c(100,13,255,67,30,10000)
sev1.fit <- calibrate(sev1,opt.method = 'L-BFGS-B',obj.fn = 'rss',par0 = par0,lower=1e-3,upper=1e4)
sev1.fit
warnings()
library(rves)
sev1.fit <- calibrate(sev1,opt.method = 'L-BFGS-B',obj.fn = 'rss',par0 = par0,lower=1e-3,upper=1e4)
apparent_resistivities(rho, thick, filter)
apparent_resistivities(par0[1:3], par0[4:6], filt$V1)
library(rves)
library(rves)
apparent_resistivities(par0[1:3], par0[4:6], filt$V1)
sev1.fit <- calibrate(sev1,opt.method = 'L-BFGS-B',obj.fn = 'rss',par0 = par0,lower=1e-3,upper=1e4)
library(rves)
sev1.fit <- calibrate(sev1,opt.method = 'L-BFGS-B',obj.fn = 'rss',par0 = par0,lower=1e-3,upper=1e4)
sev1
apparent_resistivities(par0[1:3], par0[4:6], filt$V1)
sev1$ab2
devtools::document()
devtools::document()
devtools::document()
library(rves)
library(rves)
?rves
library(rves)
SEV2 <- read.table('/home/oscar/Downloads/SEV.dat', h = F)
spacing2 <- SEV2[2:22,2]
apprho2 <- SEV2[2:22,12]
plot(spacing2, apprho2, type = "p", col = "red", log="xy")
par2 <- c(56,242,4,354,6,5,20,500)
ressev2 <- apparent_resistivities(par2[1:4], par2[5:8], as.matrix(filt$V1), spacing2)
lines(ressev2$ab2, ressev2$appres, col="blue")
#
res.sev2 <- optim(par2, rss_resistivity, filter = as.matrix(filt$V1),
apprho_measured = apprho2,
spacing = spacing2, method = 'L-BFGS-B', lower = 1e-1,
upper = 1e3)
library(rves)
SEV2 <- read.table('/home/oscar/Downloads/SEV.dat', h = F)
spacing2 <- SEV2[2:22,2]
apprho2 <- SEV2[2:22,12]
plot(spacing2, apprho2, type = "p", col = "red", log="xy")
par2 <- c(56,242,4,354,6,5,20,500)
ressev2 <- apparent_resistivities(par2[1:4], par2[5:8], as.matrix(filt$V1), spacing2)
lines(ressev2$ab2, ressev2$appres, col="blue")
#
res.sev2 <- optim(par2, rss_resistivity, filter = as.matrix(filt$V1),
apprho_measured = apprho2,
spacing = spacing2, method = 'L-BFGS-B', lower = 1e-1,
upper = 1e3)
s2<-ves("SEV2",ab2 = spacing2,apprho = apprho2)
s2$interpreted<-T
s2$rhopar[1:4]<-res.sev2$par[1:4]
s2$thickpar[1:4]<-res.sev2$par[5:8]
plot(s2)
s2$rhopar
library(rves)
plot(s2)
cumsum(s2$thickpar)
min(s2$appres,s2$rhopar)
max(s2$appres,s2$rhopar)
library(rves)
plot(s2)
library(rves)
plot(s2)
library(rves)
plot(s2)
library(rves)
plot(s2)
library(rves)
plot(s2)
s2$appres
apparent_resistivities(s2$rhopar,s2$thickpar,as.matrix(filt$V1),spacing2)
tmp<-apparent_resistivities(s2$rhopar,s2$thickpar,as.matrix(filt$V1),spacing2)
tmp$appres
tmp$appres-s2$appres
(tmp$appres-s2$appres)/s2$appres
abs(tmp$appres-s2$appres)/s2$appres
mean(abs(tmp$appres-s2$appres)/s2$appres)
library(rves)
100*library(rves)
100*mean(abs(tmp$appres-s2$appres)/s2$appres)
100*mean(abs(log(tmp$appres)-log(s2$appres))/log(s2$appres))
SEV2 <- read.table('/home/oscar/Downloads/SEV.dat', h = F)
spacing2 <- SEV2[2:22,2]
apprho2 <- SEV2[2:22,12]
plot(spacing2, apprho2, type = "p", col = "red", log="xy")
par2 <- c(56,242,4,354,6,5,20,500)
ressev2 <- apparent_resistivities(par2[1:4], par2[5:8], as.matrix(filt$V1), spacing2)
lines(ressev2$ab2, ressev2$appres, col="blue")
#
res.sev2 <- optim(par2, rss_resistivity, filter = as.matrix(filt$V1),
apprho_measured = apprho2,
spacing = spacing2, method = 'L-BFGS-B', lower = 1e-1,
upper = 6e2)
res.sev2$par
par2
SEV2 <- read.table('/home/oscar/Downloads/SEV.dat', h = F)
spacing2 <- SEV2[2:22,2]
apprho2 <- SEV2[2:22,12]
plot(spacing2, apprho2, type = "p", col = "red", log="xy")
par2 <- c(56,242,4,354,6,5,20,500)
ressev2 <- apparent_resistivities(par2[1:4], par2[5:8], as.matrix(filt$V1), spacing2)
lines(ressev2$ab2, ressev2$appres, col="blue")
#
res.sev2 <- optim(par2, rss_resistivity, filter = as.matrix(filt$V1),
apprho_measured = apprho2,
spacing = spacing2, method = 'L-BFGS-B', lower = 1e-1,
upper = 5e2)
res.sev2$par
par2
SEV2 <- read.table('/home/oscar/Downloads/SEV.dat', h = F)
spacing2 <- SEV2[2:22,2]
apprho2 <- SEV2[2:22,12]
plot(spacing2, apprho2, type = "p", col = "red", log="xy")
par2 <- c(56,242,4,354,6,5,20,500)
ressev2 <- apparent_resistivities(par2[1:4], par2[5:8], as.matrix(filt$V1), spacing2)
lines(ressev2$ab2, ressev2$appres, col="blue")
#
res.sev2 <- optim(par2, rss_resistivity, filter = as.matrix(filt$V1),
apprho_measured = apprho2,
spacing = spacing2, method = 'L-BFGS-B', lower = 1,
upper = 5e2)
res.sev2$par
par2
SEV2 <- read.table('/home/oscar/Downloads/SEV.dat', h = F)
spacing2 <- SEV2[2:22,2]
apprho2 <- SEV2[2:22,12]
plot(spacing2, apprho2, type = "p", col = "red", log="xy")
par2 <- c(56,242,4,354,6,5,20,500)
ressev2 <- apparent_resistivities(par2[1:4], par2[5:8], as.matrix(filt$V1), spacing2)
lines(ressev2$ab2, ressev2$appres, col="blue")
#
res.sev2 <- optim(par2, rss_resistivity, filter = as.matrix(filt$V1),
apprho_measured = apprho2,
spacing = spacing2, method = 'L-BFGS-B', lower = 5,
upper = 5e2)
res.sev2$par
SEV2 <- read.table('/home/oscar/Downloads/SEV.dat', h = F)
spacing2 <- SEV2[2:22,2]
apprho2 <- SEV2[2:22,12]
plot(spacing2, apprho2, type = "p", col = "red", log="xy")
par2 <- c(56,242,4,354,6,5,20,500)
ressev2 <- apparent_resistivities(par2[1:4], par2[5:8], as.matrix(filt$V1), spacing2)
lines(ressev2$ab2, ressev2$appres, col="blue")
#
res.sev2 <- optim(par2, rss_resistivity, filter = as.matrix(filt$V1),
apprho_measured = apprho2,
spacing = spacing2, method = 'L-BFGS-B', lower = 5,
upper = 1e3)
res.sev2$par
par2
tmp<-apparent_resistivities(res.sev2$par[1:4],res.sev2$par[5:8],as.matrix(filt$V1),spacing2)
tmp$appres
100*mean(abs(tmp$appres-s2$appres)/s2$appres)
100*mean(abs(log(tmp$appres)-log(s2$appres))/log(s2$appres))
SEV2 <- read.table('/home/oscar/Downloads/SEV.dat', h = F)
spacing2 <- SEV2[2:22,2]
apprho2 <- SEV2[2:22,12]
plot(spacing2, apprho2, type = "p", col = "red", log="xy")
par2 <- c(56,242,4,354,6,5,20,500)
ressev2 <- apparent_resistivities(par2[1:4], par2[5:8], as.matrix(filt$V1), spacing2)
lines(ressev2$ab2, ressev2$appres, col="blue")
#
res.sev2 <- optim(par2, log_rss_resistivity, filter = as.matrix(filt$V1),
apprho_measured = apprho2,
spacing = spacing2, method = 'L-BFGS-B', lower = 5,
upper = 1e3)
res.sev2$value
tmp<-apparent_resistivities(res.sev2$par[1:4],res.sev2$par[5:8],as.matrix(filt$V1),spacing2)
100*mean(abs(log(tmp$appres)-log(s2$appres))/log(s2$appres))
res.sev2$par
par2
SEV2 <- read.table('/home/oscar/Downloads/SEV.dat', h = F)
spacing2 <- SEV2[2:22,2]
apprho2 <- SEV2[2:22,12]
plot(spacing2, apprho2, type = "p", col = "red", log="xy")
par2 <- c(56,242,4,354,6,5,20,500)
ressev2 <- apparent_resistivities(par2[1:4], par2[5:8], as.matrix(filt$V1), spacing2)
lines(ressev2$ab2, ressev2$appres, col="blue")
#
res.sev2 <- optim(par2, log_rss_resistivity, filter = as.matrix(filt$V1),
apprho_measured = apprho2,
spacing = spacing2, method = 'L-BFGS-B', lower = 1,
upper = 1e3)
tmp<-apparent_resistivities(res.sev2$par[1:4],res.sev2$par[5:8],as.matrix(filt$V1),spacing2)
100*mean(abs(log(tmp$appres)-log(s2$appres))/log(s2$appres))
res.sev2$par
par2
library(rves)
library(rves)
?log_rss_resistivity
?optim
?GenSA
library(rves)
library(rves)
#
SEV2 <- read.table('/home/oscar/Downloads/SEV.dat', h = F)
spacing2 <- SEV2[2:22,2]
apprho2 <- SEV2[2:22,12]
sev2s <- ves("SEV2", ab2=spacing2, apprho = apprho2)
plot(sev2s)
par2 <- c(56,242,4,354,6,5,20,500)
res.sev2s <- calibrate(sev2s, opt.method = "L-BFGS-B", obj.fn = "log_rss", par0 = par2,
lower = 1e-1, upper = 1e3)
library(rves)
res.sev2s <- calibrate(sev2s, opt.method = "L-BFGS-B", obj.fn = "log_rss", par0 = par2,
lower = 1e-1, upper = 1e3)
?log_rss_resistivity
?rss_resistivity
library(rves)
res.sev2s <- calibrate(sev2s, opt.method = "L-BFGS-B", obj.fn = "log_rss", par0 = par2,
lower = 1e-1, upper = 1e3)
res.sev2s$par
res.sev2s$value
res.sev2s <- calibrate(sev2s, opt.method = "L-BFGS-B", obj.fn = "rss", par0 = par2,
lower = 1e-1, upper = 1e3)
res.sev2s$value
res.sev2s$par
res.sev2s <- calibrate(sev2s, opt.method = "L-BFGS-B", obj.fn = "mnad", par0 = par2,
lower = 1e-1, upper = 1e3)
res.sev2s$par
?ga
library(rves)
res.sev2s <- calibrate(sev2s, opt.method = "ga", obj.fn = "mnad", par0 = par2,
lower = 1e-1, upper = 1e3)
res.sev2s <- calibrate(sev2s, opt.method = "GA", obj.fn = "mnad", par0 = par2,
lower = 1e-1, upper = 1e3)
res.sev2s <- calibrate(sev2s, opt.method = "SA", obj.fn = "mnad", par0 = par2,
lower = 1e-1, upper = 1e3)
res.sev2s <- calibrate(sev2s, opt.method = "SA", obj.fn = "mnad", par0 = par2,
lower = rep(1e-1,8), upper = rep(1e3,8))
res.sev2s <- calibrate(sev2s, opt.method = "SA", obj.fn = "log_mnad", par0 = par2,
lower = rep(1e-1,8), upper = rep(1e3,8))
res.sev2s
library(rves)
res.sev2s <- calibrate(sev2s, opt.method = "SA", obj.fn = "rss", par0 = par2,
lower = rep(1e-1,8), upper = rep(1e3,8))
library(rves)
res.sev2s <- calibrate(sev2s, opt.method = "L-BFGS-L", obj.fn = "rss", par0 = par2,
lower = rep(1e-1,8), upper = rep(1e3,8))
res.sev2s
res.sev2s <- calibrate(sev2s, opt.method = "L-BFGS-B", obj.fn = "rss", par0 = par2,
lower = rep(1e-1,8), upper = rep(1e3,8))
res.sev2s$par
res.sev2s$value
res.sev2s <- calibrate(sev2s, opt.method = "GA", obj.fn = "rss", par0 = par2,
lower = rep(1e-1,8), upper = rep(1e3,8))
res.sev2s$par
res.sev2s$value
library(rves)
res.sev2s <- calibrate(sev2s, opt.method = "GA", obj.fn = "rss", par0 = par2,
lower = rep(1e-1,8), upper = rep(1e3,8))
library(rves)