# Find the value of x by using least means square method

1. Sep 26, 2011

### xugi

I cant understand this problem, anyone can help me...

Given a function y = 4x2, you are required to find the value of x that will result y = 2 by using the Least Mean Squares method.
Use initial estimate x0 = 1 and learning rate η = 0.01.
Write down the results of the first 10 epochs/iterations.

Note: Calculation can be done manually or using Matlab

I've googled this but no way out...

2. Sep 26, 2011

### rcgldr

Are you sure the method is "least mean squares" or "least squares"?

Wiki article on least mean squares filter, which is an adaptive filtering algorithm:

http://en.wikipedia.org/wiki/Least_mean_squares_filter

With least squares method you're given a set of data points, and you then choose a function and then calculate the coefficients for that function that minimize the sum of the squares of the differences between the input data and the values calculated by the function:

http://en.wikipedia.org/wiki/Least_squares

3. Sep 26, 2011

### xugi

Yes it is Least Mean Square algorithm...

Yes, I learn in my university which is contained in this link http://en.wikipedia.org/wiki/Least_mean_squares_filter

But the problem I dont know how to apply the equations to the problem I showed in 1st post...

4. Sep 26, 2011

### rcgldr

I assume the function you're trying to model is y = 4 x^2 or y = 4 x2. What you're trying to find out is the x value for when 4 x2 - 2 = 0.

The wiki article mentions that the algorithm needs a series of values going into and out of an unknown process in order to approximate that process by observing the difference between actual and predicted outputs. However in the problem statement, you're only given an initial value, and the goal is not to find a model for the equation, but to find a root.

Hopefully someone else here will be able to help.

Last edited: Sep 26, 2011
5. Sep 27, 2011

### xugi

This morning the lecturer explain how he did it, it is simple thought but it is difficult to relate it to least mean square...
I am trying to write the answer in equation here but since I do not know how to put math symbol and equation, I just will attach the file in matlab and in excel...

I wish it will help other students.

View attachment NNFL_HW1.xls
View attachment NNFL_HW1.m

Thank you Bro...:D