CNAI4S
智算平台热点追踪算子框架领域模型科学任务智算套件数据资源智算评测协作社区运行情况

友情链接

科技部工信部北京航空航天大学浙江大学
中山大学北京大学华中科技大学之江实验室
百度飞桨华为昇思中科可控
版权所有:科学智算共性平台 京ICP备18020905号-2
京公网安备11010802046602号
联系邮箱: tianyuc@buaa.edu.cn
数据资源
金融

2D Black-Scholes-Barenblatt Equation

111 浏览 8 下载 0 收藏 0 点赞 1,000 条数据
A
AI群智社区
查看原始数据源

数据集描述

Mathematical description

The PDE is given by

∂tu=−12Tr⁡(σ2diag⁡(x2)Hess⁡xu)+r(u−∇u⋅x),\partial_tu=-\frac{1}{2}\operatorname{Tr}(\sigma^2\operatorname{diag}(\bold{x}^2)\operatorname{Hess}_\bold{x}u)+r(u-\nabla u \cdot \bold{x}),∂t​u=−21​Tr(σ2diag(x2)Hessx​u)+r(u−∇u⋅x),

where σ=0.04\sigma=0.04σ=0.04 and r=0.05r=0.05r=0.05 .

The domain is defined as

(x,t)∈[0,1]2×(0,1](\bold{x},t) \in [0,1]^2 \times (0,1](x,t)∈[0,1]2×(0,1]

The terminal condition is

u(x,1)=c∣∣x∣∣22,u(\bold{x},1)=c||\bold{x}||_2^2,u(x,1)=c∣∣x∣∣22​,

where c ∼ U(0,1).c \sim \mathcal{U}(0,1).c ∼ U(0,1).







Dataset file information

File name: 2D_Black-Scholes-Barenblatt_r0.05_sigma0.4.hdf5

File hierarchy:







/
|-- tensor
|-- x-coordinate
|-- y-coordinate
|-- t-coordinate

Datasets information:







  • tensor
  • Shape: (1000, 101, 128, 128)
  • Data Type: float
  • Description: 1000 solution samples, each corresponding to a solution under one terminal condition.
  • x-coordinate
  • Shape: (128,)
  • Data Type: float
  • Description: x-axis spatial coordinates
  • y-coordinate
  • Shape: (128,)
  • Data Type: float
  • Description: y-axis spatial coordinates
  • t-coordinate
  • Shape: (101,)
  • Data Type: float
  • Description: temporal coordinates

Data generation method

According to the paper, the equation admits the explicit solution: u(x,t)=exp⁡((r+σ2)(1−t))g(x)u(\bold{x},t)=\operatorname{exp}((r+\sigma^2)(1-t))g(x)u(x,t)=exp((r+σ2)(1−t))g(x) . We generate data directly based on the explicit solution. The python script is below:







import torch
import h5py

# 2D
Nt = 101
Nx = 128
Ny = 128
spatial_dim = 2
num_samples = 1000

# create coordinates
T, X, Y = torch.meshgrid(torch.linspace(0, 1, Nt), torch.linspace(0, 1, Nx), torch.linspace(0, 1, Ny), indexing="ij")
coords = torch.stack([T, X, Y], dim=spatial_dim+1)
# print(coords[0,0,:,:], coords[0,:,0,:], coords[:,0,0,:])
coords = torch.reshape(coords, [-1, spatial_dim+1])

# random coefficient c
C = torch.rand(num_samples)

dataset_path = "2D_Black-Scholes-Barenblatt_r0.05_sigma0.4.hdf5"
with h5py.File(dataset_path, 'w') as f:
    f.create_dataset("x-coordinate", data=torch.linspace(0, 1, Nx))
    f.create_dataset("y-coordinate", data=torch.linspace(0, 1, Ny))
    f.create_dataset("t-coordinate", data=torch.linspace(0, 1, Nt))
    tensor = f.create_dataset("tensor", (num_samples, Nt, Nx, Ny), dtype='f')
    tensor.attrs["c"] = C
    for i in range(num_samples):
        U = C[i] * torch.exp((r + sigma**2) * (1 - coords[:,0])) * torch.linalg.vector_norm(coords[:,1:], ord=2, dim=1)**2
        U = torch.reshape(U, [Nt, Nx, Ny, -1])
        tensor[i] = U.squeeze(-1)

下载文件

Black-Scholes-Barenblatt.zip

数据集信息

领域
金融
浏览
111
下载
8
数据量
1,000

同类数据集

隔夜股票走势预测新闻数据集
金融5

隔夜股票走势预测新闻数据集

4127AI4S003910
股票技术面因子数据集
金融2

股票技术面因子数据集

6621AI4S003910
信用卡欺诈预测数据集
金融2

信用卡欺诈预测数据集

175AI群智社区
qlib数据库
金融1

qlib数据库

215AI4S007407