forked from ericaashe/AsheEtAl2018
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runET_GP_CC.m
79 lines (61 loc) · 1.39 KB
/
runET_GP_CC.m
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
%% Empirical Temporal Gaussian Process Regression of Continuous Core Data from Ashe et al., 2018
% for independent runs of the continuous core data
% change label1 and datPX line to switch from New Jersey to Northern North
% Carolina data analysis
cd ('~/AsheEtAl2018');
addpath('~/AsheEtAl2018');
addpath('~/AsheEtAl2018/MFILES');
pd=pwd;
CEpd='~/AsheEtAl2018';
%% example:
% cd ('/Users/ericaashe/AsheEtAl2018');
% addpath('/Users/ericaashe/AsheEtAl2018');
% addpath('/Users/ericaashe/AsheEtAl2018/MFILES');
% pd=pwd;
% CEpd='/Users/ericaashe/AsheEtAl2018';
%%
CEIFILES=[CEpd '/IFILES'];
IFILES=fullfile(pd,'IFILES');
date_field='181106';
%% change this label for different runs
label1='CC_NJ';
%label1='CC_NNC';
label=label1;
WORKDIR=[date_field label1];
if ~exist(WORKDIR,'dir')
mkdir(WORKDIR);
end
cd(WORKDIR);
idHolo = 3e4;
%%%%%%
% import proxy data, read files
%%%%%%
datPX=importdata(fullfile(IFILES,'NJ_CC.csv'));
%datPX=importdata(fullfile(IFILES,'NNC_CC.csv'));
%%%%%%
% prepare data
%%%%%%
prep_data;
%%%%%%
% define covariance function
%%%%%%
DefCovOneSite;
%%%%%%
% optimize covariance
%%%%%%
tic
[thetPX,trainsubset,logp] = OptimizeHoloceneCovariance(datasets{1},modelspec(1),[2.4 2.0 3.4 3.0],[],[],0,0,0); %2.4 2.0 3.4 3.0
opt_time=toc;
thetTGG={};
thetTGG{1}=thetPX;
time_for_opt=toc
%%%%%%
%% do GP regression
%%%%%%
regress_data;
%%%%%%
% plot results
%%%%%%
plot_figures;
%%%%%%
save;