3308_es-ES
Pregunta de la función de Col SumEstoy creando una fórmula de columna en el editor de fórmulas y me he encontrado con un problema con la función Col Sum.
Mi conjunto de datos se estructura de la siguiente manera:
Reclamación una segundo
3154 1.5 10000
844 .5 1000000
7311 1.5 1000000
22777 .5 10000
. . .
y me gustaría sumar los valores de acuerdo a la función:
Suma sobre i = 1 a n {log (claim_i / b) * [(b / claim_i) ^ a + 1] ^ (- 1)}.
Los valores de reclamación deben sumarse para todas las filas en mi conjunto de datos, por lo tanto, una función Col Sum parece ser la opción natural. Sin embargo, no quiero sumar las variables ayb por fila: quiero que solo se incluya el valor de fila de cada a y b en la fórmula.
Normalmente usaría manipulaciones algebraicas para llevar las constantes a y b fuera de la suma. Sin embargo, dada la complejidad de esta fórmula, esta no es una opción.
Es posible que excluir variables de columna de la función Col Sum?
Muchas gracias,
RobertRe: Col Suma pregunta de funciónFuncionó perfectamente!
Gracias PMrozRe: Col Suma pregunta de función
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">Tu
La fórmula sería algo como lo siguiente:
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> dt
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> current
tabla de datos
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> ()
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> mysum
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: teal;"> 0
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> para
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
( yo
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: teal;"> 1
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
yo
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> <=
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> nrows
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> dt )
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
yo
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> ++,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
reclamo_i
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> column
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> dt
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;"> "Claim"
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">) [
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> i ]
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
mysum
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
mysum
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> +
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> log
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> claim_i
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> /:
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> b )
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> *
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
((
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">:
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> b
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> /
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> claim_i )
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> ^:
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> a
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> +
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: teal;"> 1
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">)
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> ^
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
(
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> -
style = "font-size: 10pt; font-family:" Courier New "; color: teal;"> 1
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">)
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">)
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> mysum
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
Re: Col Suma pregunta de funciónBien, excepto que no quiero sumar las a y b en cada fila.
Por ejemplo, la suma de la primera fila (donde a = 1.5 y b = 10,000)
sería:
sum1 =
registro (3154/10000) * [(10000/3154) ^ 1.5 + 1] ^ (- 1) +
log (844/10000) * [(10000/844) ^ 1.5 + 1] ^ (- 1) +
log (7311/10000) * [(10000/7311) ^ 1.5 + 1] ^ (- 1) +
log (22777/10000) * [(10000/22777) ^ 1.5 + 1] ^ (- 1) +. . .
y la suma de la segunda fila (donde a = .5 y b = 1,000,000)
sería:
sum2 =
registro (3154/1000000) * [(1000000/3154) ^. 5 + 1] ^ (- 1) +
log (844/1000000) * [(1000000/844) ^. 5 + 1] ^ (- 1) +
log (7311/1000000) * [(1000000/7311) ^. 5 + 1] ^ (- 1) +
log (22777/1000000) * [(1000000/22777) ^. 5 + 1] ^ (- 1) +. . .
No estoy seguro de que JMP pueda realizar este tipo de suma.Re: Col Suma pregunta de funciónAsí que eso hace que tu fórmula sea realmente
log (claim_i / b_i) * [(b_i / claim_i) ^ a_i + 1] ^ (- 1)
si es así, entonces podrías usar
suma (registro (reclamo / b) * [(b / reclamo) ^ a + 1] ^ (- 1))
Comments
There are no comments yet