โมเดล Factor

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Charlotte Werger

Data Scientist

การใช้ Factor เพื่ออธิบายผลการดำเนินงาน

$$

  • Factor ใช้สำหรับบริหารความเสี่ยง
  • Factor ช่วยอธิบายผลการดำเนินงานของพอร์ตโฟลิโอ
  • โมเดล Factor ช่วยเชื่อมโยง Factor กับผลตอบแทนของพอร์ตโฟลิโอ
  • โมเดล Factor เชิงประจักษ์ผ่านการทดสอบด้วยข้อมูลในอดีตแล้ว
  • Fama French 3 Factor Model เป็นโมเดล Factor ที่เป็นที่รู้จักกันดี
การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Fama French Multi Factor Model

$ $

  • $ R_{pf} = \alpha + \beta_m MKT + \beta_s SMB + \beta_h HML $

  • MKT คือผลตอบแทนส่วนเกินของตลาด ได้แก่ $R_m - R_f$

  • SMB (Small Minus Big) คือ Factor ด้านขนาด
  • HML (High Minus Low) คือ Factor ด้านมูลค่า
การวิเคราะห์พอร์ตโฟลิโอด้วย Python

ทบทวน Regression Model

การใช้ Linear Regression ลากเส้นผ่านจุดข้อมูล

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

ความแตกต่างระหว่าง Beta และ Correlation

ตารางเปรียบเทียบ Beta กับ Correlation

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Regression Model ใน Python

import statsmodels.api as sm
# Define the model
model = sm.OLS(factor_data['sp500'],
               factor_data[['momentum','value']]).fit()
# Get the model predictions
predictions = model.predict(factor_data[['momentum','value']])
b1, b2 = model.params
การวิเคราะห์พอร์ตโฟลิโอด้วย Python

ผลลัพธ์สรุปของ Regression

# Print out the summary statistics
model.summary()

สรุปผล Linear Regression Model

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

การดึงค่า Beta อย่างรวดเร็ว

# Get just beta coefficients from linear regression model
b1, b2 = regression.linear_model.OLS(df['returns'], 
                          df[['F1', 'F2']]).fit().params
# Print the coefficients 
print('Sensitivities of active returns to factors:'
      '\nF1: %f\nF2: %f' % (b1, b2))
Sensitivities of active returns to factors:
F1: -0.0381
F2: 0.9858
การวิเคราะห์พอร์ตโฟลิโอด้วย Python

มาฝึกกันเถอะ!

การวิเคราะห์พอร์ตโฟลิโอด้วย Python

Preparing Video For Download...