net.sourceforge.fixagora.basis.shared.control.analysis
Class AnalysisToolPak

java.lang.Object
  extended by net.sourceforge.fixagora.basis.shared.control.analysis.AnalysisToolPak

public class AnalysisToolPak
extends java.lang.Object

The Class AnalysisToolPak.


Constructor Summary
AnalysisToolPak()
           
 
Method Summary
static double getAccrInt(java.util.Date issue, java.util.Date firstInterest, java.util.Date settlement, double rate, double redemption, int frequency, int basis)
          Gets the accr int.
static double getAccrIntM(java.util.Date issue, java.util.Date settlement, double rate, double redemption, int basis)
          Gets the accr int m.
static double getCoupDays(java.util.Date settlement, java.util.Date maturity, int frequency, int basis)
          Gets the coup days.
static double getCoupDaysNC(java.util.Date settlement, java.util.Date maturity, int frequency, int basis)
          Gets the coup days nc.
static double getCoupNcd(java.util.Date settlement, java.util.Date maturity, int frequency, int basis)
          Gets the coup ncd.
static double getCoupNum(java.util.Date settlement, java.util.Date maturity, int frequency, int basis)
          Gets the coup num.
static double getCouponDayBS(java.util.Date settlement, java.util.Date maturity, int frequency, int basis)
          Gets the coupon day bs.
static double getCoupPcd(java.util.Date settlement, java.util.Date maturity, int frequency, int basis)
          Gets the coup pcd.
static double getDisc(java.util.Date settlement, java.util.Date maturity, double price, double redemption, int basis)
          Gets the disc.
static double getDuration(java.util.Date settlement, java.util.Date maturity, double rate, double yield, int frequency, int basis)
          Gets the duration.
static double getEffect(double nominal, double npery)
          Gets the effect.
static double getIntRate(java.util.Date settlement, java.util.Date maturity, double investement, double redemption, int basis)
          Gets the int rate.
static double getMDuration(java.util.Date settlement, java.util.Date maturity, double rate, double yield, int frequency, int basis)
          Gets the m duration.
static double getNominal(double effect, double npery)
          Gets the nominal.
static double getNPer(double rate, double pmt, double pv, double fv, double type)
          Gets the n per.
static double getOddFPrice(java.util.Date settlement, java.util.Date maturity, java.util.Date issue, java.util.Date firstCoupon, double rate, double yield, double redemption, int frequency, int basis)
          Gets the odd f price.
static double getOddFYield(java.util.Date settlement, java.util.Date maturity, java.util.Date issue, java.util.Date firstCoupon, double rate, double price, double redemption, int frequency, int basis)
          Gets the odd f yield.
static double getOddLPrice(java.util.Date settlement, java.util.Date maturity, java.util.Date lastInterest, double rate, double yield, double redemption, int frequency, int basis)
          Gets the odd l price.
static double getOddLYield(java.util.Date settlement, java.util.Date maturity, java.util.Date lastInterest, double rate, double price, double redemption, int frequency, int basis)
          Gets the odd l yield.
static double getPrice(java.util.Date settlement, java.util.Date maturity, double rate, double yield, double redemption, int frequency, int basis)
          Gets the price.
static double getPriceDisc(java.util.Date settlement, java.util.Date maturity, double discount, double redemption, int basis)
          Gets the price disc.
static double getPriceMat(java.util.Date settlement, java.util.Date maturity, java.util.Date issue, double rate, double yield, int basis)
          Gets the price mat.
static double getTBillEq(java.util.Date settlement, java.util.Date maturity, double discount)
          Gets the t bill eq.
static double getTBillPrice(java.util.Date settlement, java.util.Date maturity, double rate)
          Gets the t bill price.
static double getTBillYield(java.util.Date settlement, java.util.Date maturity, double price)
          Gets the t bill yield.
static double getYield(java.util.Date settlement, java.util.Date maturity, double rate, double price, double redemption, int frequency, int basis)
          Gets the yield.
static double getYieldDisc(java.util.Date settlement, java.util.Date maturity, double price, double redemption, int basis)
          Gets the yield disc.
static double getYieldMat(java.util.Date settlement, java.util.Date maturity, java.util.Date issue, double rate, double price, int basis)
          Gets the yield mat.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalysisToolPak

public AnalysisToolPak()
Method Detail

getCoupPcd

public static double getCoupPcd(java.util.Date settlement,
                                java.util.Date maturity,
                                int frequency,
                                int basis)
                         throws java.lang.Exception
Gets the coup pcd.

Parameters:
settlement - the settlement
maturity - the maturity
frequency - the frequency
basis - the basis
Returns:
the coup pcd
Throws:
java.lang.Exception - the exception

getCoupNcd

public static double getCoupNcd(java.util.Date settlement,
                                java.util.Date maturity,
                                int frequency,
                                int basis)
                         throws java.lang.Exception
Gets the coup ncd.

Parameters:
settlement - the settlement
maturity - the maturity
frequency - the frequency
basis - the basis
Returns:
the coup ncd
Throws:
java.lang.Exception - the exception

getCoupNum

public static double getCoupNum(java.util.Date settlement,
                                java.util.Date maturity,
                                int frequency,
                                int basis)
                         throws java.lang.Exception
Gets the coup num.

Parameters:
settlement - the settlement
maturity - the maturity
frequency - the frequency
basis - the basis
Returns:
the coup num
Throws:
java.lang.Exception - the exception

getCouponDayBS

public static double getCouponDayBS(java.util.Date settlement,
                                    java.util.Date maturity,
                                    int frequency,
                                    int basis)
                             throws java.lang.Exception
Gets the coupon day bs.

Parameters:
settlement - the settlement
maturity - the maturity
frequency - the frequency
basis - the basis
Returns:
the coupon day bs
Throws:
java.lang.Exception - the exception

getCoupDays

public static double getCoupDays(java.util.Date settlement,
                                 java.util.Date maturity,
                                 int frequency,
                                 int basis)
                          throws java.lang.Exception
Gets the coup days.

Parameters:
settlement - the settlement
maturity - the maturity
frequency - the frequency
basis - the basis
Returns:
the coup days
Throws:
java.lang.Exception - the exception

getAccrInt

public static double getAccrInt(java.util.Date issue,
                                java.util.Date firstInterest,
                                java.util.Date settlement,
                                double rate,
                                double redemption,
                                int frequency,
                                int basis)
                         throws java.lang.Exception
Gets the accr int.

Parameters:
issue - the issue
firstInterest - the first interest
settlement - the settlement
rate - the rate
redemption - the redemption
frequency - the frequency
basis - the basis
Returns:
the accr int
Throws:
java.lang.Exception - the exception

getCoupDaysNC

public static double getCoupDaysNC(java.util.Date settlement,
                                   java.util.Date maturity,
                                   int frequency,
                                   int basis)
                            throws java.lang.Exception
Gets the coup days nc.

Parameters:
settlement - the settlement
maturity - the maturity
frequency - the frequency
basis - the basis
Returns:
the coup days nc
Throws:
java.lang.Exception - the exception

getDisc

public static double getDisc(java.util.Date settlement,
                             java.util.Date maturity,
                             double price,
                             double redemption,
                             int basis)
Gets the disc.

Parameters:
settlement - the settlement
maturity - the maturity
price - the price
redemption - the redemption
basis - the basis
Returns:
the disc

getAccrIntM

public static double getAccrIntM(java.util.Date issue,
                                 java.util.Date settlement,
                                 double rate,
                                 double redemption,
                                 int basis)
Gets the accr int m.

Parameters:
issue - the issue
settlement - the settlement
rate - the rate
redemption - the redemption
basis - the basis
Returns:
the accr int m

getPriceDisc

public static double getPriceDisc(java.util.Date settlement,
                                  java.util.Date maturity,
                                  double discount,
                                  double redemption,
                                  int basis)
                           throws java.lang.Exception
Gets the price disc.

Parameters:
settlement - the settlement
maturity - the maturity
discount - the discount
redemption - the redemption
basis - the basis
Returns:
the price disc
Throws:
java.lang.Exception - the exception

getYieldDisc

public static double getYieldDisc(java.util.Date settlement,
                                  java.util.Date maturity,
                                  double price,
                                  double redemption,
                                  int basis)
                           throws java.lang.Exception
Gets the yield disc.

Parameters:
settlement - the settlement
maturity - the maturity
price - the price
redemption - the redemption
basis - the basis
Returns:
the yield disc
Throws:
java.lang.Exception - the exception

getPrice

public static double getPrice(java.util.Date settlement,
                              java.util.Date maturity,
                              double rate,
                              double yield,
                              double redemption,
                              int frequency,
                              int basis)
                       throws java.lang.Exception
Gets the price.

Parameters:
settlement - the settlement
maturity - the maturity
rate - the rate
yield - the yield
redemption - the redemption
frequency - the frequency
basis - the basis
Returns:
the price
Throws:
java.lang.Exception - the exception

getYield

public static double getYield(java.util.Date settlement,
                              java.util.Date maturity,
                              double rate,
                              double price,
                              double redemption,
                              int frequency,
                              int basis)
                       throws java.lang.Exception
Gets the yield.

Parameters:
settlement - the settlement
maturity - the maturity
rate - the rate
price - the price
redemption - the redemption
frequency - the frequency
basis - the basis
Returns:
the yield
Throws:
java.lang.Exception - the exception

getTBillPrice

public static double getTBillPrice(java.util.Date settlement,
                                   java.util.Date maturity,
                                   double rate)
                            throws java.lang.Exception
Gets the t bill price.

Parameters:
settlement - the settlement
maturity - the maturity
rate - the rate
Returns:
the t bill price
Throws:
java.lang.Exception - the exception

getTBillYield

public static double getTBillYield(java.util.Date settlement,
                                   java.util.Date maturity,
                                   double price)
                            throws java.lang.Exception
Gets the t bill yield.

Parameters:
settlement - the settlement
maturity - the maturity
price - the price
Returns:
the t bill yield
Throws:
java.lang.Exception - the exception

getTBillEq

public static double getTBillEq(java.util.Date settlement,
                                java.util.Date maturity,
                                double discount)
                         throws java.lang.Exception
Gets the t bill eq.

Parameters:
settlement - the settlement
maturity - the maturity
discount - the discount
Returns:
the t bill eq
Throws:
java.lang.Exception - the exception

getPriceMat

public static double getPriceMat(java.util.Date settlement,
                                 java.util.Date maturity,
                                 java.util.Date issue,
                                 double rate,
                                 double yield,
                                 int basis)
                          throws java.lang.Exception
Gets the price mat.

Parameters:
settlement - the settlement
maturity - the maturity
issue - the issue
rate - the rate
yield - the yield
basis - the basis
Returns:
the price mat
Throws:
java.lang.Exception - the exception

getYieldMat

public static double getYieldMat(java.util.Date settlement,
                                 java.util.Date maturity,
                                 java.util.Date issue,
                                 double rate,
                                 double price,
                                 int basis)
                          throws java.lang.Exception
Gets the yield mat.

Parameters:
settlement - the settlement
maturity - the maturity
issue - the issue
rate - the rate
price - the price
basis - the basis
Returns:
the yield mat
Throws:
java.lang.Exception - the exception

getDuration

public static double getDuration(java.util.Date settlement,
                                 java.util.Date maturity,
                                 double rate,
                                 double yield,
                                 int frequency,
                                 int basis)
                          throws java.lang.Exception
Gets the duration.

Parameters:
settlement - the settlement
maturity - the maturity
rate - the rate
yield - the yield
frequency - the frequency
basis - the basis
Returns:
the duration
Throws:
java.lang.Exception - the exception

getMDuration

public static double getMDuration(java.util.Date settlement,
                                  java.util.Date maturity,
                                  double rate,
                                  double yield,
                                  int frequency,
                                  int basis)
                           throws java.lang.Exception
Gets the m duration.

Parameters:
settlement - the settlement
maturity - the maturity
rate - the rate
yield - the yield
frequency - the frequency
basis - the basis
Returns:
the m duration
Throws:
java.lang.Exception - the exception

getOddLPrice

public static double getOddLPrice(java.util.Date settlement,
                                  java.util.Date maturity,
                                  java.util.Date lastInterest,
                                  double rate,
                                  double yield,
                                  double redemption,
                                  int frequency,
                                  int basis)
                           throws java.lang.Exception
Gets the odd l price.

Parameters:
settlement - the settlement
maturity - the maturity
lastInterest - the last interest
rate - the rate
yield - the yield
redemption - the redemption
frequency - the frequency
basis - the basis
Returns:
the odd l price
Throws:
java.lang.Exception - the exception

getOddLYield

public static double getOddLYield(java.util.Date settlement,
                                  java.util.Date maturity,
                                  java.util.Date lastInterest,
                                  double rate,
                                  double price,
                                  double redemption,
                                  int frequency,
                                  int basis)
                           throws java.lang.Exception
Gets the odd l yield.

Parameters:
settlement - the settlement
maturity - the maturity
lastInterest - the last interest
rate - the rate
price - the price
redemption - the redemption
frequency - the frequency
basis - the basis
Returns:
the odd l yield
Throws:
java.lang.Exception - the exception

getOddFPrice

public static double getOddFPrice(java.util.Date settlement,
                                  java.util.Date maturity,
                                  java.util.Date issue,
                                  java.util.Date firstCoupon,
                                  double rate,
                                  double yield,
                                  double redemption,
                                  int frequency,
                                  int basis)
                           throws java.lang.Exception
Gets the odd f price.

Parameters:
settlement - the settlement
maturity - the maturity
issue - the issue
firstCoupon - the first coupon
rate - the rate
yield - the yield
redemption - the redemption
frequency - the frequency
basis - the basis
Returns:
the odd f price
Throws:
java.lang.Exception - the exception

getOddFYield

public static double getOddFYield(java.util.Date settlement,
                                  java.util.Date maturity,
                                  java.util.Date issue,
                                  java.util.Date firstCoupon,
                                  double rate,
                                  double price,
                                  double redemption,
                                  int frequency,
                                  int basis)
                           throws java.lang.Exception
Gets the odd f yield.

Parameters:
settlement - the settlement
maturity - the maturity
issue - the issue
firstCoupon - the first coupon
rate - the rate
price - the price
redemption - the redemption
frequency - the frequency
basis - the basis
Returns:
the odd f yield
Throws:
java.lang.Exception - the exception

getIntRate

public static double getIntRate(java.util.Date settlement,
                                java.util.Date maturity,
                                double investement,
                                double redemption,
                                int basis)
                         throws java.lang.Exception
Gets the int rate.

Parameters:
settlement - the settlement
maturity - the maturity
investement - the investement
redemption - the redemption
basis - the basis
Returns:
the int rate
Throws:
java.lang.Exception - the exception

getEffect

public static double getEffect(double nominal,
                               double npery)
                        throws java.lang.Exception
Gets the effect.

Parameters:
nominal - the nominal
npery - the npery
Returns:
the effect
Throws:
java.lang.Exception - the exception

getNominal

public static double getNominal(double effect,
                                double npery)
                         throws java.lang.Exception
Gets the nominal.

Parameters:
effect - the effect
npery - the npery
Returns:
the nominal
Throws:
java.lang.Exception - the exception

getNPer

public static double getNPer(double rate,
                             double pmt,
                             double pv,
                             double fv,
                             double type)
                      throws java.lang.Exception
Gets the n per.

Parameters:
rate - the rate
pmt - the pmt
pv - the pv
fv - the fv
type - the type
Returns:
the n per
Throws:
java.lang.Exception - the exception