import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pandas import DataFrame
from statsmodels.tsa.stattools import adfuller
from math import radians, cos, sin, asin, sqrt
import statsmodels.api as sm
from statsmodels.graphics.tsaplots import plot_acf
from statsmodels.stats.diagnostic import acorr_ljungbox
from statsmodels.graphics.tsaplots import plot_pacf
def haversine(lon1, lat1, lon2, lat2):
lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2])
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat / 2) ** 2 + cos(lat1) * cos(lat2) * sin(dlon / 2) ** 2
c = 2 * asin(sqrt(a))
r = 6371
return c * r
# read the file
df = pd.read_excel('2021MCMProblemC_DataSet.xlsx')
# select the right data
reports = df.loc[(df['Lab Status'] == 'Positive ID'), [
2021 MCM 数学建模美赛 C题第一问(全代码+解决思路)
最新推荐文章于 2025-01-24 09:10:25 发布
本文通过地理距离计算与时间序列分析,使用Python中的Pandas、NumPy等库进行数据处理,并利用statsmodels库进行时间序列分析及ARIMA模型预测,展示了疫情在时间和空间上的传播特性。

&spm=1001.2101.3001.5002&articleId=113773968&d=1&t=3&u=f807be0021a242b580300d23544c096c)
7753

被折叠的 条评论
为什么被折叠?



