1114+ 316
3* 27* 10^5+ 5* 27* 6* 10^4
93-5
0.02* 24000
help(read.table)
help(plot)
6/8*113
+113
6/8*113+ 113
53/60
57/60
help.start()
”Hello sir/madam.”
"Hello sir/madam."
Hello sir/madam.
Hellosir/madam.
Hellosirmadam.
Hellosirmadam
persp(volcano, expand=0.2)
help(pch)
list.files
list.files()
help.search('lognormal')
help.search('exponential')
help.search('poisson')
4/ 1.517
help.search('gamma distribution')
hist(rgamma(1000))
hist(rgamma(1000), shape = 1)
hist(rgamma(1000, shape = 1))
hist(rgamma(1000, shape = 0.2))
hist(rgamma(1000, rate = 0.2))
help.search('Distributions')
hist(rgamma(1000, shape = 1.5))
hist(rgamma(1000, shape = 5))
hist(rgamma(1000, shape = 10))
hist(rgamma(1000, shape = 100))
plot.ecdf(rgamma(1000, shape = 100))
plot.ecdf(rgamma(1000, shape = 20))
0.3* 1/ 4
0.05/ 3
0.05/ .3
3.25* 1.5
help(plot)
x = seq(0: 2: 0.01)
x = seq(0, 2, 0.01)
y = 5* x^ 2
plot(x, y, type = "l")
x = seq(10, 12, 0.01)
y = 5* x^ 2
plot(x, y, type = "l")
x = seq(0, 10, 0.01)
y = 5* x^ 2
plot(x, y, type = "l")
2645.90-2574.84
(2645.90-2574.84)* 12
help(sample)
set.seed(1)
sample(c(0, 1), 10)
sample(c(0, 1), 10, replace = TRUE)
sample(c(0, 1), 10, replace = TRUE)
sample(c(0, 1), 10, replace = TRUE)
sample(c(0, 1), 10, replace = TRUE)
n_students = 300
n_questions = 10
r_correct = 0.75
grade = rep(NA, n_students)
for (i in 1: n_students) {
grade = mean(sample(c(0, 1), n_questions, replace = TRUE, prob = c(1- r_correct, r_correct)))
}
hist(grade)
grade = rep(NA, n_students)
for (i in 1: n_students) {
grade[i] = mean(sample(c(0, 1), n_questions, replace = TRUE, prob = c(1- r_correct, r_correct)))
}
hist(grade)
hist(grade, 20)
plot.ecdf(grade)
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
help(normplot)
help.search("normal probability plot")
qqnorm(runif(100))
qqplot(runif(100))
qqline(runif(100))
qqline(rexp(100))
qqline(rexp(100))
qqnorm(rexp(100))
airmiles
crimtab
faithful
qqnorm(faithful[, 2])
qqline
qqline()
qqline(faithful[, 2])
hist(faithful)
hist(faithful[, 2])
hist(JohnsonJohnson)
qqnorm(JohnsonJohnson)
qqline(JohnsonJohnson)
qqnorm(rnorm(100))
x = rnorm(100)
qqnorm(x
)
qqline(x)
mean(JohnsonJohnson)
mean(faithful[, 2])
help(faithful)
help(JohnsonJohnson)
plot(JohnsonJohnson, type = "l")
n_rows = 10
sum(sample(c(-1, 1), size = n_rows, replace = TRUE)
)
sum(sample(c(-1, 1), size = n_rows, replace = TRUE))
sum(sample(c(-1, 1), size = n_rows, replace = TRUE))
sample(c(-1, 1), size = n_rows, replace = TRUE)
iris3[1, 1, 1]
iris3[1, 1, 1] = 3
iris3
iris3[1, 1, 1]
nrows = 10
sum(sample(c(-1, 1), size = n_rows, replace = TRUE))
n_rows = 10
sum(sample(c(-1, 1), size = n_rows, replace = TRUE))
c(-1, 1)
help(c)
sample(c(-1, 1), size = n_rows, replace = TRUE)
sample(c(-1, 1), size = n_rows, replace = TRUE)
17/5
19/5
18/5
40/6
40/7.5
source('~/Documents/Work/risk_analysis_2/lab_exercises/lab_4/patrick_lab4_script.R')
max(output)
source('~/Documents/Work/risk_analysis_2/lab_exercises/lab_4/patrick_lab4_script.R')
max(output)
output
source('~/Documents/Work/risk_analysis_2/lab_exercises/lab_4/patrick_lab4_script.R')
max(output)
bin_edges
source('~/Documents/Work/risk_analysis_2/lab_exercises/lab_4/patrick_lab4_script.R')
source('~/Documents/Work/risk_analysis_2/lab_exercises/lab_4/patrick_lab4_script.R')
max(output)
unique(output)
sort(unique(output))
source('~/.active-rstudio-document')
plot(qunif(x, 2, 4, log =FALSE), main="Uniform", ylab="X", col.axis="blue",
col.main="blue")
help(qunif)
hist(dgamma(x, scale=4, shape = 2),xlab="X Value",
main="Histogram", col.axis="blue", col.main="blue")
x
12/25
12/5
source('~/.active-rstudio-document')
11/5
14/5
help(rnorm)
21/5
help(hist)
source('~/Documents/Work/risk_analysis_2/student_papers/lab_3/sunny/Sunny_Lab3.R')
source('~/Documents/Work/risk_analysis_2/student_papers/lab_3/vince/Lab__3.R')
x
help(curve)
dweibull(x, scale=2.5, shape = 1.5)
x2 = rweibull(x, scale=2.5, shape = 1.5)
hist(x2)
par(mfrow=c(2,2))
x1 = rnorm(20,10,15)
hist(dweibull(x1, scale=2.5, shape = 1.5),xlab="random values (x)", main="Weibull Histogram")
plot.ecdf(dweibull(x1, scale=2.5, shape = 1.5))
x2 = rweibull(20, scale=2.5, shape = 1.5)
hist(x2)
plot.ecdf(x2)
par(mfrow=c(2,2))
x1 = rnorm(20,10,15)
hist(dweibull(x1, scale=2.5, shape = 1.5),xlab="random values (x)", main="Weibull Histogram")
plot.ecdf(dweibull(x1, scale=2.5, shape = 1.5))
x2 = rweibull(20, scale=2.5, shape = 1.5)
hist(x2)
plot.ecdf(x2)
13/5
help(sin)
30* pi/180
sin(30* pi/ 180)
cos(30* pi/ 180)
help(sample)
help(hist)
coin = c(0, 0, 1, 0, 1, 1, 1, 1, 0, 0)
sample(coin, length(coin), replace = TRUE)
mean(sample(coin, length(coin), replace = TRUE))
mean(sample(coin, length(coin), replace = TRUE))
mean(sample(coin, length(coin), replace = TRUE))
mean(sample(coin, length(coin), replace = TRUE))
mean(coin)
output = runif(1000)
hist(output, breaks = c(0.45, 0.55), plot = FALSE)
hist(output, breaks = c(0, 0.45, 0.55, 1), plot = FALSE)
n_bins = hist(output, breaks = c(0, 0.45, 0.55, 1), plot = FALSE)
n_bins$counts
sum(n_bins$counts)
111/1000
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
21000/0.5
help(plot)
Orange
plot(1, 1, type = "p")
plot(5, 5, type = "p", new = FALSE)
plot(1, 1, type = "p")
plot(5, 5, type = "p", new = TRUE)
plot(1, 1, type = "p")
par(new = FALSE)
plot(5, 5, type = "p")
plot(1, 1, type = "p")
par(new = TRUE)
plot(5, 5, type = "p")
0.4/ 1.5* 30.48* 5280
3/0.75* 30.48* 5280
5/0.75* 30.48* 5280
(3/0.75* 30.48* 5280)/ (10^5)
40* 0.16
50* 0.16
(210/28 + 580/33 + 630/28)/ (1/28 + 1/33 + 1/28)
(500/1+ 480/1.5+ 600/3+ 580/2)/ (1/1+ 1/ 1.5+ 1/3+ 1/ 2)
27* 3* 10^5+ 27* 5* 6* 10^4
(1181+593)/263265
100* (1181+593)/263265
7.9*10^6*63
(7.9*10^6*63)/10^9
65* 7.9
mean(86, 90, 0)
mean(c(86, 90, 0)
)
help(lines)
7/15
7/12.25
7/10
1059+395
27*(3* (125+ 60)+ 5* (125+ 100))
(27*(3* (125+ 60)+ 5* (125+ 100))* 10^3)/ 10^ 6
27* 8
1-exp(-1)
require(MASS)
help(fitdistr)
2645/2574
2645-2574
670.86-27* 3
27* 3
2735/ 1300+ 3* 0.5
41125*0.0225
14860/130
3760/45
(14860/130)/(3760/45)
24008/54808
54808*10^2
54808* 10^2* 10.7639* 1/ 43560
54808*10^2* 0.4380382
54808* 10^2* 10.7639* 1/ 43560* 2400800
54808* 10^2* 10.7639* 1/ 43560* 0.4380382
593/1354
sqrt(24387146)
source('~/.active-rstudio-document')
require(lhs)
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
help(maximinLHS)
source('~/.active-rstudio-document')
install.packages("raster")
110805+ 49470
111613+ 41387
114561+ 11907
49470* 50^2
49470* 50^2/ 10^6
49470* 50^2/ (10^3)^2
123.675/2880
41387* 50^2/ (10^3)^2
103.4675/ 2880
11907* 50^2/ (10^3)^2
29.7675/ 2880
40/30
48/36
100/5
thin_rate = c(0.01, 10, by = 0.01)
inv_rate = thin_rate^-1
plot(thin_rate, inv_rate, type = 'l')
thin_rate
thin_rate = seq(0.01, 10, by = 0.01)
inv_rate = thin_rate^-1
plot(thin_rate, inv_rate, type = 'l')
plot(thin_rate, inv_rate, type = 'l', xlim = c(1, 10))
plot(thin_rate, inv_rate, type = 'l', xlim = c(1, 10), ylim = c(0, 1))
0.3/700
*10^2
30/700
3*10^-3*10^2
7231/(5084* 2)
5084*2
42*1.3
(7231/ 2)/(5084* 2)
(1221-54)/5
233.4* 3
233.4* 3
help(.Fortran)
help(as.numeric)
help(numeric)
numeric(1)
c = numeric(1)
c
help(seq)
help(rep)
m = seq(1, 12, by = 1)
nmon = 12
20*cos(2*pi*(m-0.5-1.5)/nmon)
dT = 20*cos(2*pi*(m-0.5-1.5)/nmon)
plot(m, dT)
exp(-1)
help(double)
help(attr)
help(single)
6000/ 40
6* 30* 10
6* 30* 10/ 40
4.5* 30* 10
1800/ 40
7.5* 300
7.5* 300/ 40
7.5* 300/ 40/ 4
7.5* 300/ 40* 2/ 3
7.5* 300/ 40* 2/ 3/ 4
(1200+ 1800+ 2250)/ 3
(1200+ 1800+ 2250)/ 3/ 40
(1200+ 1800+ 2250)/ 3/ 40* 2/ 3
4.5* 300
1800/ 40
1800/ 40/ 4
1200*60
19.64* 1/ 2204.62262
10* 19.64* 1/ 2204.62262
help(index)
??index
sum(matrix)
sum(mask)
foo = matrix(seq(1, 6), nrow = 3, byrow = TRUE)
sum(foo)
foo = matrix(seq(1, 6), nrow = 3, byrow = TRUE)
sum(foo)
which(rmse == min(rmse))
max(diff, na.rm = TRUE)
19.5^2/13^2
31.8-16.5
(31.8-16.5)/30
(31.8-16.5)/3
0.4/3
(5.1+ 13.4+ 7.06)* 360
39000- 9201.6
help(cat)
cat(seq(1, 10, by = 1), seq(100, 200, by = 10))
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
i
t
T_t
S_eq
help(cat)
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
i = 11
S_eq[11]
S[i- 1]
S[i- 1]- S_eq[i- 1]
i = 12
S[i- 1]+ (S[i- 1]- S_eq[i- 1])/ tau
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
help(line)
help(lines)
help(plot)
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
length(c(rep(0, length.out = n_t/ 3), seq(0, 1, length.out = n_t/ 6), seq(1, 0, length.out = n_t/ 6), rep(0, length.out = n_t/ 3)))
n_t
source('~/.active-rstudio-document')
(n_t/ 3)- 1
source('~/.active-rstudio-document')
source('~/.active-rstudio-document')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v3.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v3.R')
S_best_rcp8p5_t = sem_core(fit$optim$bestmem, delta_t, t, T_rcp8p5_t)
fit$optim$bestmem
sem_core(fit$optim$bestmem, delta_t, t, T_rcp8p5_t)
sem_core
source('sem_functions_v2.R')
sem_core
source('~/Documents/Work/geoengineering/sem_test/sem_test_v3.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v3.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v3.R')
t
which(comp_i == seq(2025, 2475, by = 50))
which(t == seq(2025, 2475, by = 50))
find(t == seq(2025, 2475, by = 50))
help(find)
help(which)
t
t(seq(20, 520, by = 50))
t[seq(20, 520, by = 50)]
t[seq(20, 470, by = 50)]
source('~/Documents/Work/geoengineering/sem_test/sem_test_v3.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v3.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v3.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v2.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v2.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v4.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v4.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v2.R')
help(DEoptim)
source('~/Documents/Work/geoengineering/sem_test/sem_test_v2.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v5.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v5.R')
pdf('sem_test_fig.pdf')
matplot(t, S_grad_t, type = 'l', lty = 1, col = color, xlim = c(2000, 3000), ylim = c(0, max(c(S_rcp8p5_t, S_best_rcp8p5_t))), xlab = 'Time [yr]', ylab = 'Sea level contribution [m]')
lines(t, S_rcp8p5_t, type = 'l', col = 'black')
matlines(t, S_best_grad_t, type = 'l', lty = 2, col = color)
lines(t, S_best_rcp8p5_t, type = 'l', lty = 2, col = 'black')
dev.off()
split_i = seq(20, 470, by = 50)
split_i
t[split_i]
pdf('sem_test_fig.pdf')
matplot(t, S_grad_t, type = 'l', lty = 1, col = color, xlim = c(2000, 3000), ylim = c(0, max(c(S_rcp8p5_t, S_best_rcp8p5_t))), xlab = 'Time [yr]', ylab = 'Sea level contribution [m]')
lines(t, S_rcp8p5_t, type = 'l', col = 'black')
points(t[split_i], S_rcp8p5_t[split_i], pch = 16, col = color)
matlines(t, S_best_grad_t, type = 'l', lty = 2, col = color)
lines(t, S_best_rcp8p5_t, type = 'l', lty = 2, col = 'black')
points(t[split_i], S_best_rcp8p5_t[split_i], col = color)
dev.off()
source('~/Documents/Work/geoengineering/sem_test/sem_test_v5.R')
S_best_grad_t = matrix(0, nrow = 995, ncol = 10)
S_best_equil_t = matrix(0, nrow = 995, ncol = 10)
for (i in 1: 10) {
S_best_grad_t[, i] = sem_core(fit$optim$bestmem, delta_t, 0, t, T_grad_t[, i])
# S_best_grad_t[, i] = sem_core(fit$par, delta_t, 0, t, T_grad_t[, i])
S_best_equil_t[, i] = sem_core(fit$optim$bestmem, delta_t, 0, t, T_equil_t[, i])
}
pdf('sem_test_fig.pdf')
par(mfrow = c(2, 2))
matplot(t, S_equil_t, type = 'l', lty = 1, col = color, xlim = c(2000, 3000), ylim = c(0, max(c(S_rcp8p5_t, S_best_rcp8p5_t))), xlab = 'Time [yr]', ylab = 'Sea level contribution [m]')
lines(t, S_rcp8p5_t, type = 'l', col = 'black')
points(t[split_i], S_rcp8p5_t[split_i], pch = 16, col = color)
matlines(t, S_best_equil_t, type = 'l', lty = 2, col = color)
lines(t, S_best_rcp8p5_t, type = 'l', lty = 2, col = 'black')
points(t[split_i], S_best_rcp8p5_t[split_i], col = color)
matplot(t, S_grad_t, type = 'l', lty = 1, col = color, xlim = c(2000, 3000), ylim = c(0, max(c(S_rcp8p5_t, S_best_rcp8p5_t))), xlab = 'Time [yr]', ylab = 'Sea level contribution [m]')
lines(t, S_rcp8p5_t, type = 'l', col = 'black')
points(t[split_i], S_rcp8p5_t[split_i], pch = 16, col = color)
matlines(t, S_best_grad_t, type = 'l', lty = 2, col = color)
lines(t, S_best_rcp8p5_t, type = 'l', lty = 2, col = 'black')
points(t[split_i], S_best_rcp8p5_t[split_i], col = color)
dev.off()
help(set.seed)
source('~/Documents/Work/geoengineering/sem_test/sem_test_v5.R')
source('~/Documents/Work/geoengineering/sem_test/sem_test_v5.R')
