Showing posts with label statistics. Show all posts
Showing posts with label statistics. Show all posts

Sunday, March 16, 2008

Nonlinear Regression *

Nonlinear regression is a method of finding a nonlinear model of the relationship between the dependent variable and a set of independent variables. Unlike traditional linear regression, which is restricted to estimating linear models, nonlinear regression can estimate models with arbitrary relationships between independent and dependent variables. This is accomplished using iterative estimation algorithms. Note that this procedure is not necessary for simple polynomial models of the form Y = A + BX^2. By defining W = X^2, we get a simple linear model, Y = A + BW, which can be estimated using traditional methods such as the Linear Regression procedure.

Implementation

  • Can population be predicted based on time? A scatter plot shows that there seems to be a strong relationship between population and time, but the relationship is nonlinear, so it requires the special estimation methods of the Nonlinear Regression procedure. By setting up an appropriate equation, such as a logistic population growth model, we can get a good estimate of the model, allowing us to make predictions about population for times that were not actually measured.
  • An internet service provider (ISP) is determining the effects of a virus on its networks. As part of this effort, they have tracked the (approximate) percentage of infected e-mail traffic on its networks over time, from the moment of discovery until the threat was contained. We can use Nonlinear Regression to model the rise and decline of the infection.

Linear Regression

Linear regression is used to model the value of a dependent scale variable based on its linear relationship to one or more predictors. It estimates the coefficients of the linear equation, involving one or more independent variables that best predict the value of the dependent variable. For example, you can try to predict a salesperson's total yearly sales (the dependent variable) from independent variables such as age, education, and years of experience.
Implementation

  • An automotive industry group keeps track of the sales for a variety of personal motor vehicles. In an effort to be able to identify over- and underperforming models, you want to establish a relationship between vehicle sales and vehicle characteristics. We can use linear regression to identify models that are not selling well.
  • Is the number of games won by a basketball team in a season related to the average number of points the team scores per game? A scatter plot indicates that these variables are linearly related. The number of games won and the average number of points scored by the opponent are also linearly related. These variables have a negative relationship. As the number of games won increases, the average number of points scored by the opponent decreases. With linear regression, you can model the relationship of these variables. A good model can be used to predict how many games teams will win.
  • The Nambe Mills company has a line of metal tableware products that require a polishing step in the manufacturing process. To help plan the production schedule, the polishing times for 59 products were recorded, along with the product type and the relative sizes of these products, measured in terms of their diameters. We can use linear regression to determine whether the polishing time can be predicted by product size.

Thursday, March 6, 2008

Moving Average - MA

Moving averages may be calculated for any sequential data set, including opening and closing prices, highest and lowest prices, trading volume or any other indicators. It is often the case when double moving averages are used.

The only thing where moving averages of different types diverge considerably from each other, is when weight coefficients, which are assigned to the latest data, are different. In case we are talking of simple moving average, all prices of the time period in question, are equal in value. Exponential and Linear Weighted Moving Averages attach more value to the latest prices.

The most common way to interpreting the price moving average is to compare its dynamics to the price action. When the instrument price rises above its moving average, a buy signal appears, if the price falls below its moving average, what we have is a sell signal.

This trading system, which is based on the moving average, is not designed to provide entrance into the market right in its lowest point, and its exit right on the peak. It allows to act according to the following trend: to buy soon after the prices reach the bottom, and to sell soon after the prices have reached their peak.

Moving averages may also be applied to indicators. That is where the interpretation of indicator moving averages is similar to the interpretation of price moving averages: if the indicator rises above its moving average, that means that the ascending indicator movement is likely to continue: if the indicator falls below its moving average, this means that it is likely to continue going downward.

Here are the types of moving averages on the chart:

  • Simple Moving Average (SMA)

  • Exponential Moving Average (EMA)

  • Smoothed Moving Average (SMMA)

  • Linear Weighted Moving Average (LWMA)

Moving Average Technical Indicators

Calculation:

Simple Moving Average (SMA)

Simple, in other words, arithmetical moving average is calculated by summing up the prices of instrument closure over a certain number of single periods (for instance, 12 hours). This value is then divided by the number of such periods.

SMA = SUM(CLOSE, N)/N
Where:
N — is the number of calculation periods.

Exponential Moving Average (EMA)

Exponentially smoothed moving average is calculated by adding the moving average of a certain share of the current closing price to the previous value. With exponentially smoothed moving averages, the latest prices are of more value. P-percent exponential moving average will look like:

EMA = (CLOSE(i)*P)+(EMA(i-1)*(100-P))
Where:
CLOSE(i) — the price of the current period closure;
EMA(i-1) — Exponentially Moving Average of the previous period closure;
P — the percentage of using the price value.

Smoothed Moving Average (SMMA)

The first value of this smoothed moving average is calculated as the simple moving average (SMA):

SUM1 = SUM(CLOSE, N)
SMMA1 = SUM1/N

The second and succeeding moving averages are calculated according to this formula:

SMMA(i) = (SUM1-SMMA1+CLOSE(i))/N

Where:
SUM1 — is the total sum of closing prices for N periods;
SMMA1 — is the smoothed moving average of the first bar;
SMMA(i) — is the smoothed moving average of the current bar (except for the first one);
CLOSE(i) — is the current closing price;
N — is the smoothing period.

Linear Weighted Moving Average (LWMA)

In the case of weighted moving average, the latest data is of more value than more early data. Weighted moving average is calculated by multiplying each one of the closing prices within the considered series, by a certain weight coefficient.

LWMA = SUM(Close(i)*i, N)/SUM(i, N)
Where:
SUM(i, N) — is the total sum of weight coefficients.

OfficeUsers.ORG Editorials