# Polynomial Models¶

## Notes regarding usage of domain and window¶

Most of the polynomial models have optional domain and window attributes. It is important to understand how they currently are interpreted, which can be confusing since the terminology often implies something different.

Both the domain and window attributes for a polynomial consist of a two element list (this will change to tuples in a future release) that indicate a range of values for input values. For 2-Dimensional polynomials the attributes become x_domain, y_domain, x_window, and y_window. Generally speaking, the main purpose of these attributes is to define a linear transform between the supplied input variable and the resultant input variable that is supplied to the polynomial. For example, if domain = [-2, 2] and window = [-1, 1], input values will be divided by two so that the domain maps to the window. Correspondingly the pair domain = [0, 2], window = [-1, 1] implies that 1 will be subtracted from the input variable before using it in the polynomial.

Neither domain or window are meant to imply that values that fall outside of their corresponding ranges will result in an exception, or that such values are necessarily invalid (the latter depends on the context of how the polynomial is being used).

It is the case that the orthogonal polynomials are defined on a range of [-1, 1], but nothing in the current machinery prevents them from being evaluated outside that range.

Domain is used in fitting polynomials to bound the input variable to map to the defined window so that they fall within the expected [-1, 1] range for such polynomials. That is, the fitting routine will set the domain to map to the window range for the range of input x values supplied (so that domain may change if the minimum and maximum x values being fit change).

The meaning of these terms may conflict with expectations (e.g., domain is often meant to mean the range of input values the funciton is valid for). For fit results that is somewhat true, but otherwise, it is not. The default values for ordinary polynomials is [-1, 1] for both domain and window, which effectively signals no transformation of the input variable.

The terminology was adopted from numpy polynomials, which have the same confusion in meaning.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8894201,"math_prob":0.9455445,"size":2387,"snap":"2022-27-2022-33","text_gpt3_token_len":493,"char_repetition_ratio":0.16911456,"word_repetition_ratio":0.0,"special_character_ratio":0.20611647,"punctuation_ratio":0.0921659,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97321,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-15T22:52:41Z\",\"WARC-Record-ID\":\"<urn:uuid:aa837d85-aa3b-4179-89b3-f2e078eddec7>\",\"Content-Length\":\"10740\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:53213f2b-c436-4609-93d0-0dcdc073f201>\",\"WARC-Concurrent-To\":\"<urn:uuid:8f903f49-e515-4457-8848-96f5bc4253d3>\",\"WARC-IP-Address\":\"151.20.80.167\",\"WARC-Target-URI\":\"https://lira.no-ip.org:8443/doc/python-astropy-doc/html/modeling/polynomial_models.html\",\"WARC-Payload-Digest\":\"sha1:U4QJGOPTJ42IFCPMIY4BG7A2R5GQ3ASA\",\"WARC-Block-Digest\":\"sha1:5K5BVD3P363JPWUN5X75KEL7JHYIFCBW\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882572212.96_warc_CC-MAIN-20220815205848-20220815235848-00571.warc.gz\"}"}