3
good afternoon staff
I have a function that I know the result, and I want to find the value of parameter c for each result I have , similar to Excel target function
#Vetor com valores de cv para cada parcela
cv<-c(0.2901,0.2836,0.3150,0.2535,0.2762,0.2578,0.2729,0.2737,0.2943,0.2243)
# Função para estimar c ---------------------------------------------------
cvcalculado<-function(c){
sqrt((exp(log(gamma(1+(2/c)))))-(exp(log(gamma(1+
(1/c))))^2))/(exp(log(gamma(1+(1/c)))))
}
I need to get the value of the parameter c
for each vector value cv
, where the vector values cv
are the function response given any value of c
So I’ll have an estimate of c
for each vector value cv
I have tried to go down this road, but no answer is given for each value of cv
, but a global response
optimise(cvcalculado, cv)
thank you in advance
The problem is poorly defined. First, the function is monotonous decreasing, there is nothing to optimize, see
curve(cvcalculado, 1, 100)
. Secondly, the value ofc
for whichcvcalculado(c) == cv[1]
and then the value ofc
for whichcvcalculado(c) == cv[2]
, etc.?– Rui Barradas
exactly, sorry for the poor elaboration of the problem
– Henrique Faria de Oliveira
Done, see my answer.
– Rui Barradas