Showing posts with label bandung. Show all posts
Showing posts with label bandung. Show all posts

17 March 2015

hydrogeological analysis using open source tools: case Cikapundung River

Dear friends,

The following slides (in Rmd) or pdf format are from my recent talk on Sarasehan Geologi Populer, which was held by Geological Survey of Indonesia. It covers various open source tools, with more focus on R, for geological and hydrogeological analysis. This talk tells some bits of my research on finding out interaction between groundwater and surface water interaction by analysing water quality pattern. I used R in this research. The slides contains some R codes example. The objective of this talk is to raise awareness of open source apps and how its contribution to reproducibility in science.

You can view and download:
@dasaptaerwin


24 July 2014

Updated #R Code: GAM exercise using mgcv package

Dear friends,

The previous GAM post was based on only one year dataset. I have added another four year dataset in to the system and unfortunately it needed several adjustment, especially for the knot (k) value.

So the following is the updated R code. I am sure someone can come up with more efficient code.

Cheers,
Erwin

Note: 
We can use (x,y) coordinate as one of the predictor, as tensor function using "te()".
We can also include character-type column as the predictor.

  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
#---
# title : MGCV package tryout
# author: Dasapta Erwin Irawan^1 and Farzina Akter^2
# affiliation^1: Institut Teknologi Bandung (Indonesia)
# affiliation^2: University of Sydney (Australia)
# date  : 22 July 2014
#---

# This code is following http://www3.nd.edu/~mclark19/learn/GAMS.pdf

# Load library and data
require("mgcv")
data <- read.csv("alldata23.csv")


##########################
##### GAM ANALYSIS #######
##########################

# load library and data
require("mgcv")
data <- read.csv("alldata23.csv")
group1 <- data[,c("x","y","ec","elv","aq","ph","hard","tds","temp","eh","Q")]
group2 <- data[,c("x","y","ec","Ca","Mg","Fe","Mn","K","Na")]
group3 = data[,c("x","y","ec","CO3","HCO3","CO2","Cl","SO4","NO2",
                 "NO3","SiO2")]

# GAM models (check, all predictors must be numeric)

################## FAMILY = GAUSSIAN #####################

## ols (k=10 default changed to k=5, to avoid smoothing error)
k1<-3 
# change the knot (k) value  to avoid this error message
# ... basis dimension, k, increased to minimum possible ...
# k=10 (default)
gam11<-gam(ec ~ s(x,k=k1) + s(y,k=k1) + s(elv,k=k1) + 
             s(ph,k=k1) + s(hard,k=k1) + 
             s(tds,k=k1) + s(temp,k=k1) + s(eh,k=k1) + 
             s(Q,k=k1), data=group1)

# [dropping "Mg"] 
# I've tested each variables to avoid these error messages
# ... max not meaningful for factors ...
k2<-3 # (if you don't change it, then R will use previous k value)
gam12<-gam(ec ~ s(x,k=k2) + 
             s(y,k=k2) + 
             s(Ca,k=k2) + 
             s(Fe,k=k2) + 
             s(K,k=k2) + 
             s(Na,k=k2) + 
             s(Mn,k=k2), 
           data=group2)

k3<-3 # (if you don't change it, then R will use previous k value)
gam13<-gam(ec ~ s(x,k=k3) + s(y,k=k3) + s(CO3,k=k3) + 
             s(HCO3,k=k3) + s(CO2,k=k3) + s(Cl,k=k3) + 
             s(SO4,k=k3) + s(NO2,k=k3) + s(NO3,k=k3) +
             + s(SiO2,k=k3), data=group3)

## smoothing=thin plate smoothing
#k1<-3
gam21<-gam(ec ~ s(x,k=k1,bs="tp") + s(y,k=k1,bs="tp") + s(elv,k=k1,bs="tp") + 
             s(ph,k=k1,bs="tp") + s(hard,k=k1,bs="tp") + 
             s(tds,k=k1,bs="tp") + s(temp,k=k1,bs="tp") + s(eh,k=k1,bs="tp") + 
             s(Q,k=k1,bs="tp"), data=group1)

#k2<-3 xxxxxxxxxxxx
gam22<-gam(ec ~ s(x,k=k2,bs="tp") + s(y,k=k2,bs="tp") + s(Ca,k=k2,bs="tp") + 
             s(Fe,k=k2,bs="tp") + s(Mn,k=k2,bs="tp") + 
             s(K,k=k2,bs="tp") + s(Na,k=k2,bs="tp"), data=group2)

#k3<-5
gam23<-gam(ec ~ s(x,k=k3,bs="tp") + s(y,k=k3,bs="tp") + s(CO3,k=k3,bs="tp") + 
             s(HCO3,k=k3,bs="tp") + s(CO2,k=k3,bs="tp") + s(Cl,k=k3,bs="tp") + 
             s(SO4,k=k3,bs="tp") + s(NO2,k=k3,bs="tp") + s(NO3,k=k3,bs="tp") +
             + s(SiO2,k=k3,bs="tp"), data=group3)

## smoothing=thin shrinkage 
#k1<-5
bsm<-"ts"
gam31<-gam(ec ~ s(x,k=k1,bs=bsm) + s(y,k=k1,bs=bsm) + s(elv,k=k1,bs=bsm) + 
             s(ph,k=k1,bs=bsm) + s(hard,k=k1,bs=bsm) + 
             s(tds,k=k1,bs=bsm) + s(temp,k=k1,bs=bsm) + s(eh,k=k1,bs=bsm) + 
             s(Q,k=k1,bs=bsm), data=group1)

#k2<-3 xxxxxxxxxxxx
bsm<-"ts"
gam32<-gam(ec ~ s(x,k=k2,bs=bsm) + s(y,k=k2,bs=bsm) + s(Ca,k=k2,bs=bsm) + 
             s(Fe,k=k2,bs=bsm) + s(Mn,k=k2,bs=bsm) + 
             s(K,k=k2,bs=bsm) + s(Na,k=k2,bs=bsm), data=group2)

#k3<-5
bsm<-"ts"
gam33<-gam(ec ~ s(x,k=k3,bs=bsm) + s(y,k=k3,bs=bsm) + s(CO3,k=k3,bs=bsm) + 
             s(HCO3,k=k3,bs=bsm) + s(CO2,k=k3,bs=bsm) + s(Cl,k=k3,bs=bsm) + 
             s(SO4,k=k3,bs=bsm) + s(NO2,k=k3,bs=bsm) + s(NO3,k=k3,bs=bsm) +
             + s(SiO2,k=k3,bs=bsm), data=group3)

# smoothing=cubic regression spline
#k1<-5
bsm<-"cr"
gam41<-gam(ec ~ s(x,k=k1,bs=bsm) + s(y,k=k1,bs=bsm) + s(elv,k=k1,bs=bsm) + 
             s(ph,k=k1,bs=bsm) + s(hard,k=k1,bs=bsm) + 
             s(tds,k=k1,bs=bsm) + s(temp,k=k1,bs=bsm) + s(eh,k=k1,bs=bsm) + 
             s(Q,k=k1,bs=bsm), data=group1)

#k2<-3 xxxxxxxxxxxx
gam42<-gam(ec ~ s(x,k=k2,bs=bsm) + s(y,k=k2,bs=bsm) + s(Ca,k=k2,bs=bsm) + 
             s(Fe,k=k2,bs=bsm) + s(Mn,k=k2,bs=bsm) + 
             s(K,k=k2,bs=bsm) + s(Na,k=k2,bs=bsm), data=group2)

#k3<-5
gam43<-gam(ec ~ s(x,k=k3,bs=bsm) + s(y,k=k3,bs=bsm) + s(CO3,k=k3,bs=bsm) + 
             s(HCO3,k=k3,bs=bsm) + s(CO2,k=k3,bs=bsm) + s(Cl,k=k3,bs=bsm) + 
             s(SO4,k=k3,bs=bsm) + s(NO2,k=k3,bs=bsm) + s(NO3,k=k3,bs=bsm) +
             + s(SiO2,k=k3,bs=bsm), data=group3)

# smoothing=cubic shrinkage version
bsm<-"cs"
#k1<-5
gam51<-gam(ec ~ s(x,k=k1,bs=bsm) + s(y,k=k1,bs=bsm) + s(elv,k=k1,bs=bsm) + 
             s(ph,k=k1,bs=bsm) + s(hard,k=k1,bs=bsm) + 
             s(tds,k=k1,bs=bsm) + s(temp,k=k1,bs=bsm) + s(eh,k=k1,bs=bsm) + 
             s(Q,k=k1,bs=bsm), data=group1)

#k2<-3 xxxxxxxxxxxx
gam52<-gam(ec ~ s(x,k=k2,bs=bsm) + s(y,k=k2,bs=bsm) + s(Ca,k=k2,bs=bsm) + 
             s(Fe,k=k2,bs=bsm) + s(Mn,k=k2,bs=bsm) + 
             s(K,k=k2,bs=bsm) + s(Na,k=k2,bs=bsm), data=group2)

#k3<-5
gam53<-gam(ec ~ s(x,k=k3,bs=bsm) + s(y,k=k3,bs=bsm) + s(CO3,k=k3,bs=bsm) + 
             s(HCO3,k=k3,bs=bsm) + s(CO2,k=k3,bs=bsm) + s(Cl,k=k3,bs=bsm) + 
             s(SO4,k=k3,bs=bsm) + s(NO2,k=k3,bs=bsm) + s(NO3,k=k3,bs=bsm) +
             + s(SiO2,k=k3,bs=bsm), data=group3)

# smoothing=cyclic cubic regression spline
k1<-5 [changed from 3 to 5]
bsm<-"cc"
gam61<-gam(ec ~ s(x,k=k1,bs=bsm) + s(y,k=k1,bs=bsm) + s(elv,k=k1,bs=bsm) + 
             s(ph,k=k1,bs=bsm) + s(hard,k=k1,bs=bsm) + 
             s(tds,k=k1,bs=bsm) + s(temp,k=k1,bs=bsm) + s(eh,k=k1,bs=bsm) + 
             s(Q,k=k1,bs=bsm), data=group1)

k2<-8 xxxxxxxxxxxxx
gam62<-gam(ec ~ s(x,k=k2,bs=bsm) + s(y,k=k2,bs=bsm) + s(Ca,k=k2,bs=bsm) + 
             s(Fe,k=k2,bs=bsm) + s(Mn,k=k2,bs=bsm) + 
             s(K,k=k2,bs=bsm) + s(Na,k=k2,bs=bsm), data=group2)

k3<-5
gam63<-gam(ec ~ s(x,k=k3,bs=bsm) + s(y,k=k3,bs=bsm) + s(CO3,k=k3,bs=bsm) + 
             s(HCO3,k=k3,bs=bsm) + s(CO2,k=k3,bs=bsm) + s(Cl,k=k3,bs=bsm) + 
             s(SO4,k=k3,bs=bsm) + s(NO2,k=k3,bs=bsm) + s(NO3,k=k3,bs=bsm) +
             + s(SiO2,k=k3,bs=bsm), data=group3)

# Dropping "cc" model, causing error, don't have cyclic pattern


################## FAMILY = GAMMA #####################
## link=log, default smoothing
#k1<-5 # k=10 (default)
gam71<-gam(ec ~ s(x,k=k1) + s(y,k=k1) + s(elv,k=k1) + 
             s(ph,k=k1) + s(hard,k=k1) + 
             s(tds,k=k1) + s(temp,k=k1) + s(eh,k=k1) + 
             s(Q,k=k1), Gamma (link="log"), data=group1)

#k2<-3 xxxxxxxxxxxxx
gam72<-gam(ec ~ s(x,k=k2) + s(y,k=k2) + s(Ca,k=k2) + 
             s(Fe,k=k2) + s(Mn,k=k2) + 
             s(K,k=k2) + s(Na,k=k2), Gamma (link="log"), data=group2)

#k3<-5
gam73<-gam(ec ~ s(x,k=k3) + s(y,k=k3) + s(CO3,k=k3) + 
             s(HCO3,k=k3) + s(CO2,k=k3) + s(Cl,k=k3) + 
             s(SO4,k=k3) + s(NO2,k=k3) + s(NO3,k=k3) +
             + s(SiO2,k=k3), Gamma (link="log"), data=group3)

## smoothing=thin plate smoothing
#k1<-5
gam81<-gam(ec ~ s(x,k=k1,bs="tp") + s(y,k=k1,bs="tp") + s(elv,k=k1,bs="tp") + 
             s(ph,k=k1,bs="tp") + s(hard,k=k1,bs="tp") + 
             s(tds,k=k1,bs="tp") + s(temp,k=k1,bs="tp") + s(eh,k=k1,bs="tp") + 
             s(Q,k=k1,bs="tp"), 
             Gamma (link="log"), data=group1)

#k2<-3 xxxxxxxxxxxxx
gam82<-gam(ec ~ s(x,k=k2,bs="tp") + s(y,k=k2,bs="tp") + s(Ca,k=k2,bs="tp") + 
             s(Fe,k=k2,bs="tp") + s(Mn,k=k2,bs="tp") + 
             s(K,k=k2,bs="tp") + s(Na,k=k2,bs="tp"), 
             Gamma (link="log"), data=group2)

#k3<-5
gam83<-gam(ec ~ s(x,k=k3,bs="tp") + s(y,k=k3,bs="tp") + s(CO3,k=k3,bs="tp") + 
             s(HCO3,k=k3,bs="tp") + s(CO2,k=k3,bs="tp") + s(Cl,k=k3,bs="tp") + 
             s(SO4,k=k3,bs="tp") + s(NO2,k=k3,bs="tp") + s(NO3,k=k3,bs="tp") +
             + s(SiO2,k=k3,bs="tp"), 
             Gamma (link="log"), data=group3)

## smoothing=thin shrinkage 
#k1<-5
bsm<-"ts"
gam91<-gam(ec ~ s(x,k=k1,bs=bsm) + s(y,k=k1,bs=bsm) + s(elv,k=k1,bs=bsm) + 
             s(ph,k=k1,bs=bsm) + s(hard,k=k1,bs=bsm) + 
             s(tds,k=k1,bs=bsm) + s(temp,k=k1,bs=bsm) + s(eh,k=k1,bs=bsm) + 
             s(Q,k=k1,bs=bsm), 
             Gamma (link="log"), data=group1)

#k2<-3 xxxxxxxxxxxxx
bsm<-"ts"
gam92<-gam(ec ~ s(x,k=k2,bs=bsm) + s(y,k=k2,bs=bsm) + s(Ca,k=k2,bs=bsm) + 
             s(Fe,k=k2,bs=bsm) + s(Mn,k=k2,bs=bsm) + 
             s(K,k=k2,bs=bsm) + s(Na,k=k2,bs=bsm),
             Gamma (link="log"), data=group2)

#k3<-5
bsm<-"ts"
gam93<-gam(ec ~ s(x,k=k3,bs=bsm) + s(y,k=k3,bs=bsm) + s(CO3,k=k3,bs=bsm) + 
             s(HCO3,k=k3,bs=bsm) + s(CO2,k=k3,bs=bsm) + s(Cl,k=k3,bs=bsm) + 
             s(SO4,k=k3,bs=bsm) + s(NO2,k=k3,bs=bsm) + s(NO3,k=k3,bs=bsm) +
             + s(SiO2,k=k3,bs=bsm), 
             Gamma (link="log"), data=group3)

# Family=gaussian, smoothing=cubic regression spline
#k1<-5
bsm<-"cr"
gam101<-gam(ec ~ s(x,k=k1,bs=bsm) + s(y,k=k1,bs=bsm) + s(elv,k=k1,bs=bsm) + 
             s(ph,k=k1,bs=bsm) + s(hard,k=k1,bs=bsm) + 
             s(tds,k=k1,bs=bsm) + s(temp,k=k1,bs=bsm) + s(eh,k=k1,bs=bsm) + 
             s(Q,k=k1,bs=bsm), 
             Gamma (link="log"), data=group1)

#k2<-3 xxxxxxxxxxxxx
gam102<-gam(ec ~ s(x,k=k2,bs=bsm) + s(y,k=k2,bs=bsm) + s(Ca,k=k2,bs=bsm) + 
             s(Fe,k=k2,bs=bsm) + s(Mn,k=k2,bs=bsm) + 
             s(K,k=k2,bs=bsm) + s(Na,k=k2,bs=bsm), 
             Gamma (link="log"), data=group2)

#k3<-5
gam103<-gam(ec ~ s(x,k=k3,bs=bsm) + s(y,k=k3,bs=bsm) + s(CO3,k=k3,bs=bsm) + 
             s(HCO3,k=k3,bs=bsm) + s(CO2,k=k3,bs=bsm) + s(Cl,k=k3,bs=bsm) + 
             s(SO4,k=k3,bs=bsm) + s(NO2,k=k3,bs=bsm) + s(NO3,k=k3,bs=bsm) +
             + s(SiO2,k=k3,bs=bsm), 
             Gamma (link="log"), data=group3)

# smoothing=cubic shrinkage version
bsm<-"cs"
#k1<-5
gam111<-gam(ec ~ s(x,k=k1,bs=bsm) + s(y,k=k1,bs=bsm) + s(elv,k=k1,bs=bsm) + 
             s(ph,k=k1,bs=bsm) + s(hard,k=k1,bs=bsm) + 
             s(tds,k=k1,bs=bsm) + s(temp,k=k1,bs=bsm) + s(eh,k=k1,bs=bsm) + 
             s(Q,k=k1,bs=bsm), 
             Gamma (link="log"), data=group1)

#k2<-3 xxxxxxxxxxxxx
gam112<-gam(ec ~ s(x,k=k2,bs=bsm) + s(y,k=k2,bs=bsm) + s(Ca,k=k2,bs=bsm) + 
             s(Fe,k=k2,bs=bsm) + s(Mn,k=k2,bs=bsm) + 
             s(K,k=k2,bs=bsm) + s(Na,k=k2,bs=bsm), 
             Gamma (link="log"), data=group2)

#k3<-5
gam113<-gam(ec ~ s(x,k=k3,bs=bsm) + s(y,k=k3,bs=bsm) + s(CO3,k=k3,bs=bsm) + 
             s(HCO3,k=k3,bs=bsm) + s(CO2,k=k3,bs=bsm) + s(Cl,k=k3,bs=bsm) + 
             s(SO4,k=k3,bs=bsm) + s(NO2,k=k3,bs=bsm) + s(NO3,k=k3,bs=bsm) +
             + s(SiO2,k=k3,bs=bsm), 
             Gamma (link="log"), data=group3)

# smoothing=cyclic cubic regression spline
# k1<-5
bsm<-"cc"
gam121<-gam(ec ~ s(x,k=k1,bs=bsm) + s(y,k=k1,bs=bsm) + s(elv,k=k1,bs=bsm) + 
             s(ph,k=k1,bs=bsm) + s(hard,k=k1,bs=bsm) + 
             s(tds,k=k1,bs=bsm) + s(temp,k=k1,bs=bsm) + s(eh,k=k1,bs=bsm) + 
             s(Q,k=k1,bs=bsm), 
             Gamma (link="log"), data=group1)

#k2<-3 xxxxxxxxxxxxx
gam122<-gam(ec ~ s(x,k=k2,bs=bsm) + s(y,k=k2,bs=bsm) + s(Ca,k=k2,bs=bsm) + 
             s(Fe,k=k2,bs=bsm) + s(Mn,k=k2,bs=bsm) + 
             s(K,k=k2,bs=bsm) + s(Na,k=k2,bs=bsm), 
             Gamma (link="log"), data=group2)

#k3<-5
gam123<-gam(ec ~ s(x,k=k3,bs=bsm) + s(y,k=k3,bs=bsm) + s(CO3,k=k3,bs=bsm) + 
             s(HCO3,k=k3,bs=bsm) + s(CO2,k=k3,bs=bsm) + s(Cl,k=k3,bs=bsm) + 
             s(SO4,k=k3,bs=bsm) + s(NO2,k=k3,bs=bsm) + s(NO3,k=k3,bs=bsm) +
             + s(SiO2,k=k3,bs=bsm), 
             Gamma (link="log"), data=group3)

######### GAM EVALUATION ################
# Gaussian
AIC.gsdef<-AIC(gam11,gam12,gam13)
AIC.gstp<-AIC(gam21,gam22,gam23)
AIC.gsts<-AIC(gam31,gam32,gam33)
AIC.gscr<-AIC(gam41,gam42,gam43)
AIC.gscs<-AIC(gam51,gam52,gam53)
AIC.gscc<-AIC(gam61,gam62,gam63) 

print(AIC.gsdef) ; print(AIC.gstp) # lowestAIC=gam13(3300.728) and gam23(3300.728)
print(AIC.gsts) ; print(AIC.gscr) # lowestAIC=gam33(3296.121) and gam43(3295.407)
print(AIC.gscs) ; print(AIC.gscc) # lowest AIC=gam53(3290.296) and gam63(3307.973)

summary(gam13) 
# R-sq=0.359, GCV=24394, scale=22925, Dev=39.5% 
# signif pars=CO3, HCO3, CO2, Cl, NO2
gam.check(gam13)

summary(gam23)
# R-sq=0.359, GCV=24394, scale=22925, Dev=39.5% 
# sigpar=CO3, HCO3, CO2, Cl, NO2
gam.check(gam23)

summary(gam33)
# R-sq=0.358, GCV=23906, scale=22956, Dev=38.1%  
# sigpar=CO3, HCO3, CO2, Cl, NO2
gam.check(gam33)

summary(gam43)
# R-sq=0.372, GCV=23888, scale=22465, Dev=40.7% 
# sigpar=CO3, HCO3, CO2, Cl, NO2, SiO2
gam.check(gam43)

summary(gam53)
# R-sq=0.374, GCV=23369, scale=22403, Dev=39.7% 
# sigpar=CO3, HCO3, CO2, Cl, NO2
gam.check(gam53)

# Gamma
# using AIC
AIC.gmdef<-AIC(gam71,gam72,gam73)
AIC.gmtp<-AIC(gam81,gam82,gam83)
AIC.gmts<-AIC(gam91,gam92,gam93)
AIC.gmcr<-AIC(gam101,gam102,gam103)
AIC.gmcs<-AIC(gam111,gam112,gam113)
AIC.gmcc<-AIC(gam121,gam122,gam123)
print(AIC.gmdef) ; print(AIC.gmtp) # lowestAIC=gam71(3137.232) and gam81(3137.232)
print(AIC.gmts) ; print(AIC.gmcr) # lowestAIC=gam91(3133.663) and gam101(3138.866)
print(AIC.gmcs) ; print(AIC.gmcc) # lowestAIC=gam111(3135.529) and gam121(3163.347)

07 April 2014

[sci writing] literature review: the one with the search

Continuing my previous post, the following table is the result of reference searching on my hydrological case. I'll add more description later.

- no title specified

No

Keyword

Browser

Database

Iteration

Filter

Results

Book_eb

Book_ch

Book_rev

Conf

Thesis

Journal

Magazine

Newsletter

Newspaper

Other_ref

Oldest

Newest

 

1

Cikapundung

Chrome

http://sydney.edu.au/library

1

any

43

15

0

0

0

0

9

0

0

19

0

1975

2013

 

2

Cikapundung

Chrome

http://sydney.edu.au/library

2

in title

0

0

0

0

0

0

0

0

0

0

0

0

0

 

3

Cikapundung

Chrome

http://sydney.edu.au/library

3

in title, online

0

0

0

0

0

0

0

0

0

0

0

0

0

 

4

Citarum

Chrome

http://sydney.edu.au/library

1

any

1033

597

2

1

2

14

137

8

5

266

1

1502

2014

 

5

Citarum

Chrome

http://sydney.edu.au/library

2

in title

70

5

5

0

9

5

25

0

0

21

0

1980

2014

 

6

Citarum

Chrome

http://sydney.edu.au/library

3

in title, online

36

0

0

0

1

0

14

0

0

21

0

1993

2014

 

7

Bandung

Chrome

http://sydney.edu.au/library

1

any

39639

8708

0

488

519

828

7403

0

0

21693

0

1693

2014

 

8

Ciliwung

Chrome

http://sydney.edu.au/library

2

in title

53

1

0

0

2

1

3

1

0

45

0

1974

2014

 

9

Ciliwung

Chrome

http://sydney.edu.au/library

3

in title, online

46

0

0

0

0

0

1

0

0

45

0

1996

2014

 

10

Ciliwung

Chrome

http://sydney.edu.au/library

1

any

1024

138

3

0

0

8

69

5

0

801

0

1973

2014

 

11

Bandung

Chrome

http://sydney.edu.au/library

2

in title

1391

111

0

45

68

35

364

0

0

768

0

1900

2014

 

12

Bandung

Chrome

http://sydney.edu.au/library

3

in title, online

1111

15

0

43

0

0

259

11

19

764

0

1950

2014

 
                    
                    
                    
        

 

          
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    
                    

06 April 2014

[sci writing] literature review

Start to write about river water-groundwater relation

1. Introduction

All kinds of research, researcher must have a strong understanding of preceeding research on the same or similar subject. Master and PhD student, as a kind of researcher, must compose a literature review before they hold permit to start their research. Usually we use the term literature review as a form of formal written document that summarises all previous related researches.

Generally the steps are:

  • searching articles with certain criteria.
    • published article on reputable journals.
    • presented abstract on reputable conferences.
  • extract the results from each article, what data is used in it, and how the author analyse it.
  • summarise and compile the result to mark a baseline for your research.

However if we dig deeper, we can find that there are at least two kinds of literature review:

  • Annotated bibliography
  • Systematic review

2. Annotated bibliography

What is an annotated bibliography? These are several good definitions on the term:

An annotated bibliography provides a brief account of the available research on a given topic. It is a list of research sources that includes concise descriptions and evaluations of each source.[UNSW] (https://student.unsw.edu.au/annotated-bibliography)

Another definition even gives an average sum of words:

An annotated bibliography is a list of citations to books, articles, and documents. Each citation is followed by a brief (usually about 150 words) descriptive and evaluative paragraph, the annotation. The purpose of the annotation is to inform the reader of the relevance, accuracy, and quality of the sources cited. [Cornell Univ] (http://guides.library.cornell.edu/annotatedbibliography).

another references to be added

According to the two references, it’s clear now that the steps previously mentioned in the introduction is for composing annotated bibliography.

Now we get to the real part. Searching for references. There’s so many ways to get related readings and references:

  • The old-fashioned way is to go to your university library. Tempting huh :-) If I’d suggest this as the best way. Not only you’ll get the one document that you’ve been looking for, but also you’ll feel the atmosphere in there. Although there are more online documents nowadays, but still I’d sit still in the library (if I have time). You might by any chance get the oldest record on whatever you’re looking for.
  • Then there’s always be internet as the backbone of researcher around the globe. The problem is, where to find it.

    • Google: the most obvious next man’s best friend. Off course there’re others, like: bing, and our old mate Yahoo. You might want to visit list of search engine. But be careful with using Google, because it crawls on any documents that matched with our keyword. So it could be a real scientific paper on a scientific journal, or a newsletter or simply an email in a miling list. But starting from November 2004, Google has make improvement on the matter by launching Google Scholar. Now you can get more refined result with this tools. Five years later, in December 2009, Microsoft launched Microsoft Academic.
    • Citation database or scientific database: we’re already familiar with Scopus, Science direct, Proquest, or Web of Science. You can start with both links, since different company would likely have different database and searching algorithm. If you are working or affiliating to a university that has subscription to any of the database, then you have eliminated half of your problem :-).
    • Or your university has a cross-referencing system that access multiple databases in the internet. You are the lucky one :-). Just type in the keyword in it then you get more results from multiple resources. I’ll continue later on with my own case of reference searching.

27 March 2014

[R] Hydromad Cikapundung (1)

(the output: P=precipitation (mm), Q=river discharge (L/sec), E=Max daily temp (oC) from 2007-2010)


This will be the first post on the Hydromad Package Practice
The analysis used Cikapundung dataset and R code from Willem Vervoort's Class (http://sydney.edu.au/agriculture/staff/vervoort/index.shtml)

-------------------------------------

# Hydromad practical (based on Cikapundung data and Willem's code)

setwd("C:/Users/dira0651/Downloads/week3lwsc3007")

# load the hydromad package
library(hydromad)

# read flow data
Flow <- read.csv("flowlembang.csv")
head(Flow)

# Convert the date column
Flow$Date <- as.Date(Flow[,1], "%m/%d/%Y")

# Choose my flow (use only st1 dataset)
My.Flow <- dat
a.frame(Date=Flow$Date,
                      Flow=Flow$st1)
head(My.Flow)

# convert flow in ML/day to mm using
# Hydromad tool
# My.Flow$Flow <- convertFlow(My.Flow$Flow,
                            from="ML",area.km2=0.147)
# head(My.Flow)

# load in the rainfall (with no missing data)
Rain <- read.csv("rainlembang.csv")
head(Rain)

# force colnames
colnames(Rain) <- c("Date", "Rain")
Rain$Date <- as.Date(Rain[,1],"%m/%d/%Y")
head(Rain)

# same thing with temperature
Temp <- read.csv("templembang.csv")
Temp$Date <- as.Date(Temp[,1],"%m/%d/%Y")
head(Temp)

# use package zoo
library(zoo)
tsQ <- zoo(My.Flow$Flow,
           order.by=My.Flow$Date,frequency=1)
tsP <- zoo(Rain$Rain,
           order.by=Rain$Date,frequency=1)
tsT <- zoo(Temp$MaxT,
           order.by=Temp$Date,frequency=1)

# merge
Cikapundung <- merge(P=tsP, Q=tsQ, E=tsT, all=F)

# make a quick plot
xyplot(Cikapundung)
---------------------------

@dasaptaerwin