[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Need some math help to code NORMSDIST into AB.



PureBytes Links

Trading Reference Links

While on this subject, I usually import data from AB and do further 
analysis using Excel, and I use "BETAINV" function from excel.
Does anybody know how to convert this formula in AB? Help would be 
appreciated.

Thanks,
Gary.



NOTE:
This is the help of BETAINV usage in Excel:

Syntax

BETAINV(probability,alpha,beta,A,B)

Probability   is a probability associated with the beta distribution.
Alpha   is a parameter of the distribution.
Beta   is a parameter the distribution.
A   is an optional lower bound to the interval of x.
B   is an optional upper bound to the interval of x.

Remarks

If any argument is nonnumeric, BETAINV returns the #VALUE! error 
value. 
If alpha ¡Ü 0 or beta ¡Ü 0, BETAINV returns the #NUM! error value. 
If probability ¡Ü 0 or probability > 1, BETAINV returns the #NUM! 
error value. 
If you omit values for A and B, BETAINV uses the standard cumulative 
beta distribution, so that A = 0 and B = 1. 
Given a value for probability, BETAINV seeks that value x such that 
BETADIST(x, alpha, beta, A, B) = probability. Thus, precision of 
BETAINV depends on precision of BETADIST. BETAINV uses an iterative 
search technique. If the search has not converged after 100 
iterations, the function returns the #N/A error value.



--- In amibroker@xxxxxxxxxxxxxxx, "sebastiandanconia" 
<sebastiandanconia@xxx> wrote:
>
> 
> I came across what I consider to be a valuable stock market/economic
> indicator, the Wright Model "B" yield-curve indicator.  Using this
> formula in Excel:
> 
> 
> Probability = NORMSDIST(-2.17 - 0.76 x S + 0.35 x R)
> 
> where "S" is the spread (10-Year Treasury yield minus 3-month T-Bill
> yield) and "R" is the Fed Funds rate, it gives the probability of
> economic recession within the next 4 quarters.  (Only about 44% 
right
> now, so there's some good news.  I envision using this as a market-
exit 
> indicator, warning when conditions are about to turn really ugly for
> both the stock market and the economy. )
> 
> This formula:
> 
> 
> Z(x) = (1/(sqrt(2*pi()))*exp(-x^2/2))
> 
> appears to be the actual math represented by the NORMSDIST 
function.  I
> believe AB supports all the operations in this formula.
> 
> My problem is that I'm not math-savvy enough to make the leap from 
here
> to turn this into a complete AB formula.   I don't know what 
operation
> the NORMSDIST formula performs on the Wright Model part, I don't 
know
> what the "x" variable is supposed to be...there's no end to what I 
don't
> know.:)
> 
> Any help from my superiors in the math field (undoubtedly a VERY 
large
> club) would be greatly appreciated.
> 
> 
> 
> Luck to all,
> 
> Sebastian
>



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.30/674 - Release Date: 2/7/2007 3:33 PM