Esempio n. 1
0
 def ts_rf(self):
     # 构造变长时序
     return basetype.VarTimeSeries(self.idataloader.load_rf()["value"],
                                   self.start,
                                   self.end,
                                   fill=True,
                                   shift=1,
                                   lmbd=lambda x: x / 36500)
Esempio n. 2
0
    def ts_bm(self):
        # 构造变长时序
        data = self.idataloader.load_bm()
        if self.fb_map:
            cols = [self.fb_map.get(fid, data.columns[0]) for fid in self.fund_ids]
        else:
            cols = data.columns

        if len(set(cols)) == 1:
            data = data[cols[0]]  # 降维至1维
        elif len(set(cols)) > 1:
            data = data[cols]
        else:
            raise ValueError("无可用基准数据")
        return basetype.VarTimeSeries(data, self.start, self.end)
Esempio n. 3
0
 def ts(self):
     # 构造变长时序
     return basetype.VarTimeSeries(self.fdataloader.load_nv(),
                                   self.start,
                                   self.end,
                                   check=True)