# In statistical learning, is the learning function a random variable or a constant?

#### arkm25

##### New Member
Hi

Consider a predictor x and a response Y, where the true relationship between them is given by Y = f(x) + e. e is a random error term.

A training data set (x_1, Y_1), ..., (x_n, Y_n) is collected and from this an estimated learning function f_hat is fitted. Then Y_hat = f_hat(x) becomes an estimate for the true response Y.

My question is about the derivation of the error of this estimate. This derivation shows that the total error can be divided into a reducible and irreducible component and can be summarized as ...

E(Y-Y_hat)^2 = E(f(x) - f_hat(x))^2 + var(e).

For the reducible component, in some derivations I've seen, they simply write E(f(x) - f_hat(x))^2 = (f(x) - f_hat(x))^2.

This treats the the fitted/estimated learning function f_hat(x) as constant and not a random variable. My question is why is this the case?

The estimated learning function f_hat is constructed from a training data set which is a random sample since each response Y_i is a random variable. Therefore if you collected a different sample, you should get a different estimate for f_hat.

Shouldn't f_hat be a random variable then?

Appreciate any insight.

Last edited:

#### Buckeye

##### Member
We take a random sample and gather data on it (height, weight, occupation, residence, etc.). These are the x's or inputs to the model. They are fixed because we know what they are. The parameters of the model (the beta coefficients) are also fixed, but unknown. We use statistics to study the parameters of a population / model (and characterize variability). There is random unexplained variation from sample to sample which is captured in the error term.

Last edited:
{"ft_lang_label":"__label__en","ft_lang_prob":0.9026794,"math_prob":0.9934935,"size":2293,"snap":"2021-31-2021-39","text_gpt3_token_len":559,"char_repetition_ratio":0.12844037,"word_repetition_ratio":0.98191214,"special_character_ratio":0.25599653,"punctuation_ratio":0.11904762,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99874085,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-23T07:00:01Z\",\"WARC-Record-ID\":\"<urn:uuid:6ab68a00-a1bb-4913-81bf-639053a421bf>\",\"Content-Length\":\"36685\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:262862ca-cfdb-4325-9eeb-01999b33f918>\",\"WARC-Concurrent-To\":\"<urn:uuid:577313b5-9d40-4338-8337-b480a9b80134>\",\"WARC-IP-Address\":\"199.167.200.62\",\"WARC-Target-URI\":\"https://talkstats.com/threads/in-statistical-learning-is-the-learning-function-a-random-variable-or-a-constant.72834/\",\"WARC-Payload-Digest\":\"sha1:36FCXK4DJTSTTU3OHIOYYUJGNA6UANML\",\"WARC-Block-Digest\":\"sha1:IXIZF4VYB7JXZ6ETO46IQPTLARYS3DG3\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780057417.10_warc_CC-MAIN-20210923044248-20210923074248-00425.warc.gz\"}"}