SQL Server specific risk of asset returns

Use the aggregate function SpecificRisk to calculate Specific Risk, the standard deviation of the error term in the regression equation. Specific Risk is calculated as:

Where

Ra

=

asset return

Rb

=

benchmark return

Rf

=

risk-free return

freq

=

periodicity of returns

Syntax

SELECT [wct].[SpecificRisk](

<@Ra,float,>

,<@Rb,float,>

,<@Rf,float,>

,<@Freq,int,>)

Arguments

@Ra

the asset return for a period; the percentage return in floating point format (i.e. 10% = 0.10). @R is an expression of type float or of a type that can be implicitly converted to float.

@Rb

the benchmark return for a period; the percentage return in floating point format (i.e. 10% = 0.10). @R is an expression of type float or of a type that can be implicitly converted to float.

@Rf

the risk-free return for the period in floating point format (i.e. 10% = 0.10). @Rf is an expression of type float or of a type that can be implicitly converted to float.

@Freq

the period in which @Ra, @Rb, and @Rf are expressed. For example, a @Freq of 1 would indicate that the returns are annual; 4 would be quarterly, 12 would be monthly, and 252 would be business-daily. @Freq must be of a type int or of a type that implicitly converts to int.