91 questions
0
votes
0
answers
38
views
Discrepancy between XIRR in R and Excel
I am having an issue slightly similar to this question, I have a quarterly data that the excel and R brings different values e.g. the following in excel =XIRR(I2:I28, B2:B28) brings a value of 2.9802E-...
0
votes
0
answers
61
views
Excel: Excluding dates from IRR calculation
I need to implement a dynamic XIRR formula that exclude all the cash flow which related dates are lower than a reference date.
At the moment I have this construction which helps calculating XIRR based ...
-1
votes
1
answer
500
views
How to calculate IRR for each investment in a dataframe?
If I've created a scrubbed Pandas dataframe containing investments, dates and cash flows, anyone have tips for calculating the IRR for each investment according to the cash flows in the dataframe? I'...
0
votes
0
answers
35
views
Unable to obtain output using excel VBA (when yrs of investment > 25 or when return is less than certain amount)
I am trying to calculate the IRR for insurance policies using VBA. The four input variables are total premium paid, Years of Payment, Number of Policy Years and Final expected value.
I am able to ...
0
votes
1
answer
170
views
Calculate IRR using custom functions with monthly payment
How should I modify the code to calculate the IRR based on the monthly payment? Because the value I obtained from the code does not match with the value I calculated manually via XIRR.
I would like to ...
0
votes
1
answer
206
views
Calculate IRR using custom functions in Excel VBA
I would like to calculate the IRR of my savings insurance based on the total premium paid, years of payment, policy years, and the value received at the end of policies.
For example:
total premium ...
1
vote
0
answers
79
views
How(what) to plot (for) results of negative binomial glmm with categorical variables against counts?
I have count data for an ungulate species from two sites (here made up for the question). I want to know how to showcase results of categorical variable in this analysis. I first thought the graph I ...
1
vote
1
answer
348
views
Big Difference in XIRR vs IRR calculation
Background
I am getting substantially large variation in XIRR vs IRR calculations.
Problem & Help requested
Can someone please explain why I get two very different outcomes, and which method is ...
1
vote
1
answer
788
views
Calculate intraclass correlation (ICC) on each column and return a dataframe with results
I have a dataframe based on a questionnaire, all participants answer the questionnaire 2 times. based on this a dataframe with all participants and questionnaire items is formed.
The dataframe looks ...
1
vote
1
answer
287
views
Split list and turn into dataframe in R
When analysing a dataframe, the output of the analysis i put in a dataframe, but that dataframe shows up as a list with all data as 1 list.
I want the data-analyses output in a dataframe with the ...
0
votes
2
answers
136
views
calculate IRR on dateframe
How calculate IRR on dateframe(df).
I have dateframe:
ID
Amount_paid
Rate1
Rate2
Rate3
1
-3000
78,40
78,40
2500
2
-200
28,60
28,60
28,60
3
-4000
635,90
635,90
3600
4
-1000
635,90
635,90
3600
5
-...
0
votes
0
answers
271
views
How do I calculate incidence rate ratios for a categorical variable with more than two levels?
I am trying to calculate incidence rate ratio for each level of an an exposure variable in Dtata, but I'm only finding that I can do it when the exposure variable has only two levels.
The exposure ...
1
vote
2
answers
197
views
How to calculate IRR function by group
I'm trying to calculate IRR by group using the package "jrvFinance" - function "irr" but i don't know how.
I have this for only 1 group:
example:
pr1 <- data.frame(idC=1,period ...
0
votes
1
answer
230
views
How to calculate internal rate of return (IRR) and yield to maturity (YTM) in Sympy
How do I calculate internal rate of return (IRR) and yield to maturity (YTM) in Sympy? I am trying to calculate the YTM of a bond of $1000 face value that pays $50 in coupons every year. The bond is ...
0
votes
1
answer
318
views
How to calculate internal rate of return (IRR) and yield to maturity (YTM) in Maxima
How do I calculate internal rate of return (IRR) and yield to maturity (YTM) in Maxima? I am trying to calculate the YTM of a bond of $1000 face value that pays $50 in coupons every year. The bond is ...
0
votes
1
answer
569
views
Calculation of Internal Rate of Return (IRR) in C#
Good evening, I ran into the problem of calculating IRR in C# for an array of cash flows. On the advice from another topic, I used the ExcelFinancialFunction package, but when calculating it gives an ...
1
vote
0
answers
136
views
Package 'irr', function 'icc': Unrealistic p-values in output
I'm getting crazy over this issue:
I'm computing (lots of) ICCs at the moment to assess the retest-reliability of brain-parameters using the function 'icc' in the package 'irr' by Matthias Gamer. ...
1
vote
0
answers
44
views
Dplyr calculation gives an error and stops running the calculations
I'm trying to calculate IRRs with cashflow datas that I have for my data's funds. I try this with following code:
install.packages("tvm")
library(dplyr)
library(tvm)
var1 <- my_data %>%...
0
votes
1
answer
186
views
Tidying data for calculation of ICC
I want to compute the IRR for a dataset with two raters (ICC2, Two-way-random-effects model).
I wanted to use the ICC function from the psych-package but wonder how I need to restructure my data to ...
0
votes
0
answers
580
views
Inter-rater reliability with Light's kappa in R
I have 4 raters who have rated 10 subjects. Because I have multiple raters (and in my actual dataset, these 4 raters have rated the 10 subjects on multiple variables) I've chosen to use the Light's ...
0
votes
0
answers
378
views
Excel IRR formula in javasript
public static async IRRCalc(CArray: string | any[], guest: number) {
const inc = 0.000001;
let NPV;
do {
guest += inc;
NPV = 0;
for (let j = 0;...
0
votes
1
answer
439
views
How to loop over grouped data Payments and dates in Pyxirr library in XIRR function
I am trying to get XIRR for each customer with multiple entries with dates and payments in float.
I want to find XIRR for each customer by grouping them with Unique ID
Code I am trying
import pandas ...
0
votes
1
answer
169
views
Passing an array into the IRR function in VBA. Keep getting the error "Compile error: Type mismatch: array or user-defined type expected."
I'm calculating the IRR of an array in VBA. Here's my ugly code:
Dim iRRArray() As Variant
Erase iRRArray()
ReDim iRRArray(garageLife)
Dim i As Integer
i = 0
Do While i <= garageLife
Dim ...
0
votes
1
answer
316
views
Internal rate of return calculation with a growing perpetuity
I'm pretty new in coding and I'm trying to learn it for application in finance.
I should to find the r variable in this equation that I'm sharing. Can someone help me?
enter image description here
...
0
votes
1
answer
1k
views
Calculating a Rolling IRR in Excel
I have two columns that I'd like to use to calculate a rolling monthly IRR with. The data looks like this:
Date Net Cash Flow Principal IRR
2023-01-31 0 0 idk
...
1
vote
0
answers
238
views
Error in R when using psych- Error in if (n.obs < n.obs.original) message("Warning, missing data were found for ", : argument is of length zero
Whenever I try to analyse my data using R it comes up with the above error message does anybody know why this is?
1
vote
0
answers
79
views
Excel IRR: Can I use range reference inside IRR with math inside {}?
Good morning. In post "Excel IRR: can I use it referencing a combination of cells and fixed numbers? IRR({-10,11+A2})" is said we can math inside {} using CHOOSE function. But if I have ...
0
votes
1
answer
857
views
Calculate percentage agreement between values in every row
I'm trying to calculate the intra-class correlation between two raters and multiple subjects. However, I also want to be able to determine the raters' agreement for each and every subject so I can ...
-1
votes
1
answer
330
views
How to calculate a rolling IRR in python pandas
I have dataframe with two columns: CFs and NAV,(cashflows and net asset valuation) now want to calculate the rolling IRR.
Any suggestions are welcome.
Example:
CFs NAV
-100 100
1 101
2 103
3 ...
0
votes
1
answer
1k
views
Different Robust Standard Errors of Poisson regression in Stata and R
i am not getting the same results by following Hilbe's, J. 2011 procedure (herein referred to as "the book") on page 20. The procedure is for computing Poisson regression with robust ...
3
votes
4
answers
12k
views
Calculate IRR in Python
I am running into a roadblock and would appreciate some help on this.
Problem Statement:
I am trying to calculate XIRR for a cash flow over 30 years in Python.
What have I tried so far:
However, none ...
0
votes
1
answer
271
views
Dynamic IRR calculation. Is there a way to add zeros after the terminal amount is added?
I am building out a dashboard that allows you to add in a disposal date and amount which will add the data to the current modelled cashflows and recalculate the IRR.
The issue I am having is trouble ...
0
votes
1
answer
257
views
Calculating multiple IRRs from a panda dataframe
I have a Panadas dataframe which encompasses 4 columns (company, price today, cash flow y1, cash flow y2, cash flow y3 (i.e. a terminal value)):
Code
Price
0
1
2
GOOGL-US
-2380
0
0
4074.94
AMZN-US
-...
1
vote
2
answers
627
views
Is weighted Kappa calculated by `irr` package in R wrong?
I found the irr package has 2 big bugs for the calculation of weighted kappa.
Please tell me if the 2 bugs are really there or I misunderstood someting.
You can replicate the bugs using the following ...
1
vote
1
answer
1k
views
IRR calculation with Javascript
I have this code to calculate IRR (Internal Rate of Return) and it works like the IRR function in Excel (we have the cashflow values and the guess rate).
This is working fine and I have the same ...
1
vote
1
answer
634
views
Problem with loop to calculate IRR function in python
I have a problem with calculating a function in python. I want to calculate the IRR for a number of investment, all of which are described in their own dataframe. I have a dataframe for each ...
0
votes
1
answer
636
views
Need help calculating IRR for different investments at different dates for each investment, in python
I need help calculating IRR for different investments, and the IRR for those investments at different times.
So a have one dataframe that looks like this:
DATE
Investment
Flow
2012-05-12
1
-50
2013-...
1
vote
1
answer
566
views
How to generate a summary table (flextable) for r-markdown from irr output?
I have run 3 different Kappa2 analysis using the irr package.
library(irr)
data("diagnoses", package = "irr")
# Analysis 1
kappa2(diagnoses[, c("rater1", "rater2&...
1
vote
1
answer
2k
views
Python IRR Function giving different result than Excel XIRR
I am using the following functions to perform IRR-Calculations with Python:
from scipy.optimize import newton
def xnpv(rate, values, dates):
if rate <= -1.0:
return float('inf')
...
0
votes
1
answer
164
views
IRR double type array conversion from a variant type
Sorry if the question is stupid since I'm new to VBA.
The problem arises in the beginning since an excel IRR cannot calculate a changing column in a simulation(only calculates the initial values not ...
0
votes
1
answer
94
views
Is there a way to implement the IRR algorithm in PuLP?
Numpy has a function which allows me to calculate the IRR of an array of floats. My problem is that I am trying to use it within a PuLP problem, and the array that I want to pass to the function is ...
-1
votes
2
answers
286
views
SQL Floating Point Error with IRR Calculation
I had a coworker that wrote an IRR calculation function. You supply what seems to be set of cash flows, and it returns the IRR. It works 99% of the time but sometimes I get a floating point error. I ...
0
votes
0
answers
331
views
Implementing Brent's method in Clojure to find IRR
I'm trying to use brents method for calculating the internal rate of return. Using this as a template Brent's Method
I currently have this code:
(defn discount-factor
[discount-rate n]
(/ 1 (...
7
votes
0
answers
506
views
How to calculate new list of payment
First of all, apologies for posting the same question again.
I want to add the grace period to a repay table for the flat interest calculation method such that the interest amount can be received for ...
0
votes
1
answer
272
views
argument must be a string or a number, not 'LpAffineExpression'
I am trying to use python IRR function with PULP maximisation but i am getting the following error
TypeError: float() argument must be a string or a number, not 'LpAffineExpression'
TypeError ...
2
votes
1
answer
1k
views
IRR in poi return NaN but correct value in excel
When i calculate Irr value use apache/poi i get Double.NaN, but the same inputs in excel i got a negative value.
So why they return different value?
inputs here:
irr(-1.0601017230994111E8,19150.63,...
1
vote
2
answers
4k
views
How to calculate Internal Rate of Return (IRR) in .NET Core
I try to calculate an Internal Rate of Return (IRR) in a C# .NET Core 2.2 project.
Is there any built in formula that I could use?
From the MSDN documentation available here, you should be able to ...
0
votes
2
answers
57
views
How to add additional rows to an imported csv?
I am currently loading multiple csv-files into R in the following form:
read.csv("Cashflows2.csv", header = F, )
V1 V2
1 Date Payments
2 18/08/2017 -20495*
3 18/04/2018 639....
-1
votes
1
answer
401
views
How to run a function on multiple csv's at the same time
I have a set of 3 csv's which are all saved in the below directory:
setwd("~/R/CashFlows")
The csv's are named:
"Cashflows1.csv" "Cashflows2.csv" "Cashflows3.csv"
And are all in a form similar to ...
0
votes
1
answer
502
views
Calculating the annualized internal rate of return
How would i write a simple function to calculate the annualized internal rate of return for the below dates and payments in csv form:
19/10/2003 -13275
19/11/2003 940.49
19/12/2003 884.71
19/01/...