Minimizing cost function Statistics

In summary, the equations show that the constant c that minimizes E(Y-c)2 is c=\mu. The attempt at a solution shows that the random variable f(X) that minimizes E[(Y-f(X))2|X] is f(X)= E[Y|X]. The equations and the attempt at a solution both show that the random variable f(X) that minimizes E[(Y-f(X))2] is also f(X)= E[Y|X].
  • #1
colstat
56
0

Homework Statement


Let X and Y be two unknown variables with E(Y)=[tex]\mu[/tex] and EY2 < [tex]\infty[/tex].

Homework Equations


a. Show that the constant c that minimizes E(Y-c)2 is c=[tex]\mu[/tex].
b. Deduce that the random variable f(X) that minimizes E[(Y-f(X))2|X] is f(X)= E[Y|X].
c. Deduce that the random variable f(X) that minimizes E[(Y-f(X))2] is also f(X)= E[Y|X].

The Attempt at a Solution


a. E(Y-c)2 = E[Y2-2Y*c+c2]
other ideas: Can I do the derivative w.r.t. Y, set it equal to zero. But there is an expectation operator, how do you take expectation through the operator.
I can't use a posterior mean, the problem did not specify distr.of the r.v.

b, c. no ideas yet
 
Last edited:
Physics news on Phys.org
  • #2
colstat said:

Homework Statement


Let X and Y be two unknown variables with E(Y)=[tex]\mu[/tex] and EY2 < [tex]\infty[/tex].

Homework Equations


a. Show that the constant c that minimizes E(Y-c)2 is c=[tex]\mu[/tex].
b. Deduce that the random variable f(X) that minimizes E[(Y-f(X))2|X] is f(X)= E[Y|X].
c. Deduce that the random variable f(X) that minimizes E[(Y-f(X))2] is also f(X)= E[Y|X].

The Attempt at a Solution


a. E(Y-c)2 = E[Y2-2Y*c+c2]
other ideas: Can I do the derivative w.r.t. Y, set it equal to zero. But there is an expectation operator, how do you take expectation through the operator.
I can't use a posterior mean, the problem did not specify distr.of the r.v.

b, c. no ideas yet

For (a) Remember, the variable here is c, not Y. Start by using linearity to expand
E[Y2-2Y*c+c2] and remember that.
 
  • #3
LCKurtz,
E[Y2-2Y*c+c2]=E[Y2]-2E[Y]E[c]+E[c2]],
is that what you meant by linearity to expand?
But how do you solve for c, really!

correction from my post: "how do you take derivative through operator"
 
  • #4
colstat said:
LCKurtz,
E[Y2-2Y*c+c2]=E[Y2]-2E[Y]E[c]+E[c2]],
is that what you meant by linearity to expand?
But how do you solve for c, really!

correction from my post: "how do you take derivative through operator"

Close, but the way you have written the middle term leads me to believe you don't quite understand. The expected value operation is linear means that if X and Y are random variables and c is a constant then

1. E(X + Y) = E(X) + E(Y)

and

2. E(cX) = cE(X)

Use those two properties (carefully) on E[Y2-2Y*c+c2].

And remember, E(Y2) and μ = E(Y) are just numbers. You are trying to minimize a function of c, just like you maximized and minimized functions of x in calculus.
 
  • #5
Yes, I know about the expectation part wait, I still don't get it. Do I use derivative to do it?
 
  • #6
colstat said:
Yes, I know about the expectation part wait, I still don't get it. Do I use derivative to do it?

Show me the function of c that you got when you expanded it.
 
  • #7
E[Y2-2Y*c+c2]
=E[Y2]-2E[Y]E[c]+E[c2]]
=E[Y2]-2cE[Y]+c2
=E[Y2]-2c[tex]\mu[/tex]+c2
 
  • #8
OK, so, if you have

[tex]
E[(Y-\mu)^2] = E[Y^2-2c\mu + c^2
[/tex]

as a function of [itex] c [/itex], how would you minimize it?
 
  • #9
colstat said:
E[Y2-2Y*c+c2]
=E[Y2]-2E[Y]E[c]+E[c2]]
=E[Y2]-2cE[Y]+c2
=E[Y2]-2c[tex]\mu[/tex]+c2

While I wouldn't quibble with the result, my objection to your expansion is your writing

E(-2Yc) = -2E(Y)E(c)

with no additional commentary. It looks like you are treating c as a random variable and using the "fact" that E(XY) = E(X)E(Y), which is not generally true and certainly not one of the two linearity properties. Perhaps you understand what you are doing at that step, but you haven't convinced me of it yet.

On an additional note, we have company for the next week so I am going to let StatDad take it from here if he is willing.
 
  • #10
so, what do you do next?
 

What is the purpose of minimizing cost function in statistics?

The purpose of minimizing cost function in statistics is to find the optimal values of parameters in a statistical model that will result in the lowest possible cost or error. This is important in order to improve the accuracy and efficiency of the model.

How is cost function related to statistical models?

Cost function is a mathematical representation of the error or difference between the predicted values of a statistical model and the actual values. Therefore, minimizing the cost function allows for the model to be improved and make more accurate predictions.

What are the common methods for minimizing cost function in statistics?

The common methods for minimizing cost function in statistics include gradient descent, Newton's method, and the Levenberg-Marquardt algorithm. These methods use different approaches to iteratively adjust the parameters of the model in order to minimize the cost function.

What factors can affect the effectiveness of minimizing cost function?

The effectiveness of minimizing cost function can be affected by the choice of optimization algorithm, the initial values of the parameters, and the complexity of the model. Additionally, the quality and quantity of the data used to train the model can also have an impact.

Can minimizing cost function lead to overfitting in statistical models?

Yes, minimizing cost function can potentially lead to overfitting in statistical models if the model is too complex or if there is not enough data to accurately represent the underlying patterns. It is important to use regularization techniques and to validate the model to prevent overfitting.

Similar threads

  • Calculus and Beyond Homework Help
Replies
18
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
466
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
439
  • Calculus and Beyond Homework Help
Replies
3
Views
260
Replies
1
Views
619
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
Replies
10
Views
1K
  • Calculus and Beyond Homework Help
Replies
21
Views
3K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
Back
Top