(71B) calculate interest rate

12222019, 03:07 PM
(This post was last modified: 12272019 12:23 PM by Albert Chan.)
Post: #5




RE: (71B) calculate interest rate
(12212019 03:44 PM)JF Garnier Wrote:(12202019 10:10 PM)Albert Chan Wrote: Playing emulator interactively, this is unexpected ... Thanks JF Garnier. A trick to get around this limitation is to wrap FNROOT inside an user function. >PURGE >10 INPUT "N, FV, PV, PMT ? ";N,F,P,M >20 DEF FNF(I) @ Y=F+P+(M/I+P)*EXPM1(N*LOGP1(I)) @ DISP I,Y @ FNF=Y @ END DEF >30 I1=(M*N+P+F)/(N*((N1)/2*M+P)) >40 I2=.9*I1 >50 DEF FNS(A,B)=FNROOT(A,B,FNF(FVAR)) > >RUN N, FV, PV, PMT ? 168, 10925.76, 0, 45 >I=FNS(I1,.5*I1) 2.66590628268E3 1404.76181566 5.33181256535E3 1255.8749515 3.99885942402E3 177.2179603 4.16369398215E3 11.8480797 4.17461116337E3 .7831244 4.75321186436E3 606.2697042 4.1753575833E3 .0260875 4.46428472383E3 298.0104306 4.17538287345E3 .0004365 4.31983379864E3 147.7508024 4.1753833002E3 .0000036 4.24760854942E3 73.5647316 4.17538330374E3 .0000001 4.21149592658E3 36.7050556 4.17538330384E3 0 Update: this may improve rate guesses closer to true rate. y = (1+I)^N1 ≈ NI / (1  ½ (N1)I), Pade[1,1] approximation Using this rough estimate of y for equation F + P + y(P + M/I) = 0 Solve for I, we have I = (F+P+M*N) / ((N1)/2*(FP)  P) Above should be better than I1 estimate, which assumed no compounding. Note: I1 is solution of F + P(1+NI) + m Σ(1+kI, k=0 to N1) = 0 To make I2 still overestimated true rate, take the arithmetic mean. For the same reasoning, I1 can be reduced the same way. >I1=(F+P+M*N) / (N*((1N)/2*M  P)) → 5.33181256535E3 >I2=(F+P+M*N) / ((N1)/2*(FP)  P) → 3.68930884387E3 >I3=(I1+I2)/2 → 4.51056070461E3 >I4=(I1+I3)/2 → 4.92118663498E3 >I=FNS(I3,I4) 4.51056070461E3 346.6853844 4.92118663498E3 790.3342398 4.18968078622E3 14.5135902 4.17566057222E3 .2812298 4.17538353441E3 .0002338 4.1753833039E3 0 

« Next Oldest  Next Newest »

Messages In This Thread 
(71B) calculate interest rate  Albert Chan  12202019, 04:14 PM
RE: (71B) calculate interest rate  Joe Horn  12202019, 08:36 PM
RE: (71B) calculate interest rate  Albert Chan  12202019, 10:10 PM
RE: (71B) calculate interest rate  JF Garnier  12212019, 03:44 PM
RE: (71B) calculate interest rate  Albert Chan  12222019 03:07 PM
RE: (71B) calculate interest rate  Albert Chan  12292019, 02:46 PM
RE: (71B) calculate interest rate  Albert Chan  01022020, 05:43 PM
RE: (71B) calculate interest rate  Albert Chan  01062020, 09:16 PM
RE: (71B) calculate interest rate  Albert Chan  02132020, 03:41 PM

User(s) browsing this thread: 1 Guest(s)