Implements Longstaff-Schwartz algorithm for valuation of American Basket option. The calling sequence is: AmericanBasket(payoff,K,S,shares,SamSize,NumInt, maturity,covar,interestRate,divDates,divAmounts,...) EuropeanBasket(payoff,K,S,shares,SamSize, maturity,covar,interestRate,divDates,divAmounts,...) Where: payoff(K,M,Shares,...) is the payoff function; K is the strike price, M is the vactor of assets prices, Shares is the vector containing the number of shares of each stock, ... additional parameters to be passed to payoff function K - strike price S - current stocks prices (vector) Shares - the number of shares of each stock SamSize - the number of different paths for Monte Carlo NumInt - number of time intervals into which the time to maturity is to be divided (>=2) maturity - time to maturity (in years) covar - the covariance matrix for the stocks (yearly covariance) interestRate - the yearly interest rate (continuously compound); 0.08 is 8% divDates - dates when dividends are paid divAmounts - dividend paid per share Notes: divDates and divAmounts are lists, each containing k elements, where k is the number of stocks. For each 1 <= j <= N, divDates[[j]] is a vector containing the dates where dividends for stock j are expected (number of years since now); divAmounts is a similar list where divAmounts[[j]] is a vector containing dividends which will be paid per share of stock j Finally, there is no NumInt for European option.