3308_it-IT
Domanda di funzione Col SumSto creando una formula di colonna nell'editor di formule e ho riscontrato un problema con la funzione di somma di colonne.
Il mio set di dati è strutturato come segue:
Richiesta un B
3154 1,5 10000
844 .5 1000000
7311 1,5 1000000
22777 .5 10000
. . .
e mi piacerebbe sommare i valori in base alla funzione:
Somma i = 1 a n {log (claim_i / b) * [(b / claim_i) ^ a + 1] ^ (- 1)}.
I valori delle attestazioni devono essere sommati per tutte le righe nel mio set di dati, quindi una funzione di Col Sum sembra la scelta naturale. Tuttavia, non voglio sommare le variabili a e b per riga: voglio solo il valore di riga di a e b da includere nella formula.
Normalmente userei le manipolazioni algebriche per portare le costanti a e b al di fuori della sommatoria. Tuttavia, data la complessità di questa formula, questa non è un'opzione.
È possibile escludere variabili di colonna dalla funzione Col Sum?
Grazie molto,
RobertoRi: domanda di funzione Col SumHa funzionato perfettamente!
Grazie PMrozRi: domanda di funzione Col Sum
style = "font-size: 10pt; font-family:" Courier New "; color: black;">Il tuo
formula sarebbe qualcosa di simile al seguente:
style = "font-size: 10pt; font-family:" Courier New "; color: black;"> dt
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> current
tabella dati
style = "font-size: 10pt; font-family:" Courier New "; colore: black;"> ()
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; colore: black;"> mysum
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
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: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> per
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
( io
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
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: black;">
io
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> <=
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> nrows
style = "font-size: 10pt; font-family:" Courier New "; color: black;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: black;"> dt )
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
io
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> ++,
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "">
claim_i
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; colour: rgb (0, 0, 221);"> column
style = "font-size: 10pt; font-family:" Courier New "; color: black;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: black;"> dt
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: purple;"> "Claim"
style = "font-size: 10pt; font-family:" Courier New "; color: black;">) [
style = "font-size: 10pt; font-family:" Courier New "; colore: black;"> i ]
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "">
MySum
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
MySum
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> +
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> log
style = "font-size: 10pt; font-family:" Courier New "; color: black;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: black;"> claim_i
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> /:
style = "font-size: 10pt; font-family:" Courier New "; colore: black;"> b )
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> *
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
((
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">:
style = "font-size: 10pt; font-family:" Courier New "; colore: black;"> b
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> /
style = "font-size: 10pt; font-family:" Courier New "; color: black;"> claim_i )
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> ^:
style = "font-size: 10pt; font-family:" Courier New "; colore: black;"> a
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> +
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: teal;"> 1
style = "font-size: 10pt; font-family:" Courier New "; color: black;">)
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> ^
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
(
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: black;">)
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: black;">)
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
style = "font-size: 10pt; font-family:" Courier New "; colore: black;"> mysum
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: black;">
Ri: domanda di funzione Col SumGiusto, tranne che non voglio sommare le a e b su ogni riga.
Ad esempio, la somma per la prima riga (dove a = 1.5 eb = 10.000)
sarebbe:
sum1 =
log (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) +. . .
e la somma per la seconda riga (dove a = .5 eb = 1.000.000)
sarebbe:
sum2 =
log (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) +. . .
Non sono sicuro che JMP possa eseguire questo tipo di somma.Ri: domanda di funzione Col SumQuesto rende la tua formula davvero
log (claim_i / b_i) * [(b_i / claim_i) ^ a_i + 1] ^ (- 1)
se è così, allora potresti usare
somma (log (claim / b) * [(b / claim) ^ a + 1] ^ (- 1))
Comments
There are no comments yet