such term shall not include commodities held in connection with the active conduct of a commodities business as a producer, processor, merchant, or handler of commodities. (4) Applicable loan (A) In general The term applicable loan means, with respect to any partnership interest, any loan issued directly or indirectly from the partnership, any other partner of the partnership, or any person related to such other partner or such partnership. (B) Safe harbor The term applicable loan does not include any loan which— (i) is fully recourse to the borrower or fully secured by the borrower's assets, and (ii) requires payments of interest with a stated rate not less than the specified rate determined under subsection (c)(2). (c) Deemed compensation amount For purposes of this section— (1) Deemed compensation amount (A) In general The term deemed compensation amount means, with respect to any applicable partnership interest for any partnership taxable year, an amount equal to the product of— (i) the specified rate determined under paragraph (2) for the calendar year in which such taxable year begins, multiplied by (ii) the excess (if any) of— (I) an amount equal to the applicable percentage of the weighted average of the aggregate of invested capital of all partners of the partnership on each measurement date occurring within such taxable year, over (II) the weighted average of invested capital with respect to the applicable partnership interest on each measurement date occurring within such taxable year. (B) Measurement date For purposes of subparagraph (A), the term measurement date means— (i) the last day of the partnership taxable year, (ii) any date specified in the regulations under subchapter K as a date on which to revalue property of the partnership for purposes of adjusting capital accounts of the partner (without regard to whether the partnership capital accounts are adjusted on that date), and (iii) any other date specified by the Secretary. (2) Specified rate The term specified rate means, with respect to