-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMAIN_script.m
More file actions
48 lines (35 loc) · 1.5 KB
/
MAIN_script.m
File metadata and controls
48 lines (35 loc) · 1.5 KB
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
% Main script to call other code in this folder
% Created by Jack Baker 12/17/2019
% Updated 11/4/2020 to reflect final publication info
%
% Results and motivations related to these calculations are documented in:
%
% Baker and Chen (2020), "Ground motion spatial correlation fitting methods
% and estimation uncertainty" Earthquake Engineering & Structural Dynamics,
% 49(15), 1662–1681.
clear; close all; clc;
homeDir = [pwd]; % reference directory for outputs (the current directory by default
%% process NGA-West2 data to get residuals
if 1==0 % do new analysis (otherwise, if analysis is complete, we can load that data instead)
cd('data')
getResiduals % select data and run mixed effects regression to get residuals
cd(homeDir) % switch back to original directory
end
%% compute event-specific variograms for each earthquake (this script sets most of the user-defined parameters)
compute_variograms
%% get illustrative results for two earthquakes
study_two_events
%% generate synthetic data using station configurations, and fit variograms
if 1==1 % do new analysis
load main_data
[h, synthetic] = fn_synthetic_range (station_lat, station_long, recIdx, recsPerEQ, eventIdx, EQ_name_string, options);
save synthetic_data h synthetic
end
%% plots of results from the synthetic data
synthetic_data_plots
%% analyze estimation and true variance
variance_decomposition
%% Posterior analysis of empirical data
posterior_distributions
%% study role of WLS coefficient value
wls_coeff_study