September 2, 2008 at 3:24 am
All,
I have to convert the below formula in TSQL standard. Please help me out.
----------------
Annualized Return
The annualized return is the geometric mean of the returns with respect to one year. If we denote by NumYears the number of years covered by the returns, the formula becomes:
AnnRtn(r1, ..., rn) = http://www.styleadvisor.com/support/statistics/annualized_return.htmlwhere r1, ..., rn is a return series, i.e., a sequence of returns for n time periods.
----------------
karthik
September 2, 2008 at 5:27 am
Do you have some sample data to verify with?
DECLARE@Sample TABLE
(
Period TINYINT,
Rate SMALLMONEY
)
INSERT@Sample
SELECT1, 0.0500 UNION ALL
SELECT2, 0.0450 UNION ALL
SELECT3, 0.0362 UNION ALL
SELECT4, 0.0411
SELECTEXP(SUM(LOG(POWER(1 + Rate, Period)))) - 1
FROM@Sample
N 56°04'39.16"
E 12°55'05.25"
September 2, 2008 at 7:22 am
Peso,
Thanks ! Sorry I don't have the test data. I will ask my manager and get back to you.
karthik
September 4, 2008 at 2:31 am
Peso,
Can you help me to convert the below formula's also ?
http://www.styleadvisor.com/support/statistics/standard_deviation.html
http://www.styleadvisor.com/support/statistics/cumulative_return.html
http://www.styleadvisor.com/support/statistics/mean.html
http://www.styleadvisor.com/support/statistics/variance.html
karthik
September 4, 2008 at 6:48 am
Without feedback for the first formula, the Annualized Return?
N 56°04'39.16"
E 12°55'05.25"
September 5, 2008 at 6:55 am
Mean, Variance, and Standard Deviation are built in SQL functions.
--mean
SELECT AVG(Period) AS Mean
FROM @Sample
-- standard deviation
SELECT STDEV(Period) As StandardDeviation
FROM @Sample
-- variance
SELECT VAR(Period) As Variance
FROM @Sample
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply