시작하기무료로 시작하기

Parkfield 지진 발생 간격 시간 추정

이 연습 문제에서는 지진 발생 간격 시간에 대한 지수 모델과 가우시안 모델의 최적 매개변수를 먼저 계산합니다. 그런 다음 각 모델의 이론적 CDF와 실제 Parkfield 지진 발생 간격 시간의 공식 ECDF를 함께 시각화합니다.

이 연습은 강의의 일부입니다

통계적 사고 사례 연구

강의 보기

연습 안내

  • 평균 지진 발생 간격 시간을 계산하여 mean_time_gap에 저장하세요. 주요 지진 사이의 시간 간격(단위: 년)은 time_gap에 저장되어 있습니다.
  • 지진 발생 간격 시간의 표준편차를 계산하여 std_time_gap에 저장하세요.
  • np.random.exponential()을 사용하여 적절한 평균을 가진 지수 분포에서 10,000개의 샘플을 추출하고 time_gap_exp 변수에 저장하세요.
  • np.random.normal()을 사용하여 적절한 평균과 표준편차를 가진 정규 분포에서 10,000개의 샘플을 추출하고 time_gap_norm 변수에 저장하세요.
  • 이 챕터 앞부분에서 소개된 *dcst.ecdf() 방식을 사용하여 각 이론적 CDF를 한 줄씩 그리세요.
  • formal=True, min_x=-10, max_x=50 키워드 인수를 사용하여 ECDF를 그리세요.

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

# Compute the mean time gap: mean_time_gap
mean_time_gap = ____

# Standard deviation of the time gap: std_time_gap
std_time_gap = ____

# Generate theoretical Exponential distribution of timings: time_gap_exp
time_gap_exp = ____

# Generate theoretical Normal distribution of timings: time_gap_norm
time_gap_norm = ____

# Plot theoretical CDFs
_ = plt.plot(*____)
_ = plt.plot(*____)

# Plot Parkfield ECDF
_ = plt.plot(*____(____, ____=____, ____=____, ____=____))

# Add legend
_ = plt.legend(('Exp.', 'Norm.'), loc='upper left')

# Label axes, set limits and show plot
_ = plt.xlabel('time gap (years)')
_ = plt.ylabel('ECDF')
_ = plt.xlim(-10, 50)
plt.show()
코드 편집 및 실행