Good afternoon, I have the following code in R
funcao<-function(delta) {delta}
Intensity2AccumulationFactor<-function(delta,s,t){
int<-function(s,t) {integrate(funcao,s,t)}
p=int(s,t)
b=c(p)
a=exp(b)
print(a)
}
Testing gives the following error:
Intensity2AccumulationFactor (function, 0,1) Error in exp (b): non-numeric argument to mathematical function
Can someone help me?
The goal is to calculate 1/(-integral(delta))
between s
and t
.