psi_to_priorSR {BayesianFactorZoo}R Documentation

Mapping ψ\psi (psi0) to the prior Sharpe ratio of factors (priorSR), and vice versa.

Description

This function provides the one-to-one mapping between ψ\psi and the prior Sharpe ratio of factors. See Section II.A.3 in Bryzgalova et al. (2023).

Usage

psi_to_priorSR(R, f, psi0 = NULL, priorSR = NULL, aw = 1, bw = 1)

Arguments

R

A matrix of test assets with dimension t×Nt \times N, where tt is the number of periods and NN is the number of test assets;

f

A matrix of factors with dimension t×kt \times k, where kk is the number of factors and tt is the number of periods;

psi0

The hyper-parameter in the prior distribution of risk prices (see Details in the function continuous_ss_sdf);

priorSR

The prior Sharpe ratio of all factors (see Details);

aw

The hyper-parameter in the prior of γ\gamma (default value = 1, see Details);

bw

The hyper-parameter in the prior of γ\gamma (default value = 1, see Details);

Details

According to equation (27) in Bryzgalova et al. (2023), we learn that

Eπ[SRf2γ,σ2]Eπ[SRα2σ2]=ψk=1Kr(γk)ρ~kρ~kN,\frac{E_{\pi} [ SR^2_f \mid \gamma, \sigma^2 ] }{E_{\pi} [ SR^2_{\alpha} \mid \sigma^2] } = \frac{\psi \sum^K_{k=1} r(\gamma_k) \tilde{\rho}^\top_k \tilde{\rho}_k }{N},

where SRf2SR^2_f and SRα2SR^2_{\alpha} denote the Sharpe ratios of all factors (ftf_t) and of the pricing errors (α\alpha), and EπE_{\pi} denotes prior expectations.

The prior π(ω)\pi (\omega) encodes the belief about the sparsity of the true model using the prior distribution π(γj=1ωj)=ωj,  ωjBeta(aω,bω).\pi (\gamma_j = 1 | \omega_j) = \omega_j, \ \ \omega_j \sim Beta(a_\omega, b_\omega) . We further integrate out γj\gamma_j in Eπ[SRf2γ,σ2]E_{\pi} [ SR^2_f \mid \gamma, \sigma^2 ] and show the following:

Eπ[SRf2σ2]Eπ[SRα2σ2]aωaω+bωψk=1Kρ~kρ~kN, as r0.\frac{E_{\pi} [ SR^2_f \mid \sigma^2 ] }{E_{\pi} [ SR^2_{\alpha} \mid \sigma^2 ] } \approx \frac{a_\omega}{a_\omega+b_\omega} \psi \frac{ \sum^K_{k=1} \tilde{\rho}^\top_k \tilde{\rho}_k }{N}, \ as \ r \to 0 .

Since we can decompose the Sharpe ratios of all test assets, SRR2SR^2_R, into SRf2SR^2_f and SRα2SR^2_{\alpha} (i.e., SRR2=SRf2+SRα2SR^2_R = SR^2_f + SR^2_{\alpha}), we can represent SRf2SR^2_f as follows:

Eπ[SRf2σ2]aωaω+bωψk=1Kρ~kρ~kN1+aωaω+bωψk=1Kρ~kρ~kNSRR2. E_{\pi} [ SR^2_f \mid \sigma^2 ] \approx \frac{\frac{a_\omega}{a_\omega+b_\omega} \psi \frac{ \sum^K_{k=1} \tilde{\rho}^\top_k \tilde{\rho}_k }{N}}{1 + \frac{a_\omega}{a_\omega+b_\omega} \psi \frac{ \sum^K_{k=1} \tilde{\rho}^\top_k \tilde{\rho}_k }{N}} SR^2_R.

We define the prior Sharpe ratio implied by the factor models as Eπ[SRf2σ2]\sqrt{E_{\pi} [ SR^2_f \mid \sigma^2 ]}. Given aωa_\omega, bωb_\omega, k=1Kρ~kρ~kN\frac{ \sum^K_{k=1} \tilde{\rho}^\top_k \tilde{\rho}_k }{N}, and the observed Sharpe ratio of test assets, we have one-to-one mapping between ψ\psi and Eπ[SRf2σ2]\sqrt{E_{\pi} [ SR^2_f \mid \sigma^2 ]}.

If the user aims to convert ψ\psi to the prior Sharpe ratio, she should input only psi0. In contrast, if she wants to convert the prior Sharpe ratio to ψ\psi, priorSR should be entered.

Value

The return of psi_to_priorSR is:

References

Bryzgalova S, Huang J, Julliard C (2023). “Bayesian solutions for the factor zoo: We just ran two quadrillion models <https://doi.org/10.1111/jofi.13197>.” Journal of Finance, 78(1), 487–557.

Examples


## Load the example data
data("BFactor_zoo_example")
HML <- BFactor_zoo_example$HML
lambda_ols <- BFactor_zoo_example$lambda_ols
R2.ols.true <- BFactor_zoo_example$R2.ols.true
sim_f <- BFactor_zoo_example$sim_f
sim_R <- BFactor_zoo_example$sim_R
uf <- BFactor_zoo_example$uf

## If the user aims to convert \eqn{\psi} to the prior Sharpe ratio:
print(psi_to_priorSR(sim_R, sim_f, priorSR=0.1))

## If the user  wants to convert the prior Sharpe ratio to \eqn{\psi}:
psi0_to_map <- psi_to_priorSR(sim_R, sim_f, priorSR=0.1)
print(psi_to_priorSR(sim_R, sim_f, psi0=psi0_to_map))

## If we enter both psi0 and priorSR (or forget to input them simultaneously),
## a warning will be printed:
print(psi_to_priorSR(sim_R, sim_f))
print(psi_to_priorSR(sim_R, sim_f, priorSR=0.1, psi0=2))




[Package BayesianFactorZoo version 0.0.0.2 Index]