Correlació a l'atzar
Author: Pep Bujosa

X

Y

Un altre núvol

Punt mitjà i eixos

r=

Solució

Entra el coeficient de correlació lineal

a = Random(-2, 2)
b: -2 * a + Random[5, 10]
f(x) = a * x + b
A2: abs(Random[0, 7] + RandomNormal[0, 1])
B2: abs(f(A2) + RandomNormal[0, 2])
A3: abs(Random[0, 7] + RandomNormal[0, 1])
B3: abs(f(A3) + RandomNormal[0, 2])
A4: abs(Random[0, 7] + RandomNormal[0, 1])
B4: abs(f(A4) + RandomNormal[0, 2])
A5: abs(Random[0, 7] + RandomNormal[0, 1])
B5: abs(f(A5) + RandomNormal[0, 2])
A6: abs(Random[0, 7] + RandomNormal[0, 1])
B6: abs(f(A6) + RandomNormal[0, 2])
A7: abs(Random[0, 7] + RandomNormal[0, 1])
B7: abs(f(A7) + RandomNormal[0, 2])
A8: abs(Random[0, 7] + RandomNormal[0, 1])
B8: abs(f(A8) + RandomNormal[0, 2])
A9: abs(Random[0, 7] + RandomNormal[0, 1])
B9: abs(f(A9) + RandomNormal[0, 2])
A10: abs(Random[0, 7] + RandomNormal[0, 1])
B10: abs(f(A10) + RandomNormal[0, 2])
A11: abs(Random[0, 7] + RandomNormal[0, 1])
B11: abs(f(A11) + RandomNormal[0, 2])
A12: abs(Random[0, 7] + RandomNormal[0, 1])
B12: abs(f(A12) + RandomNormal[0, 2])
A13: abs(Random[0, 7] + RandomNormal[0, 1])
B13: abs(f(A13) + RandomNormal[0, 2])
A14: abs(Random[0, 7] + RandomNormal[0, 1])
B14: abs(f(A14) + RandomNormal[0, 2])
A15: abs(Random[0, 7] + RandomNormal[0, 1])
B15: abs(f(A15) + RandomNormal[0, 2])
A16: abs(Random[0, 7] + RandomNormal[0, 1])
B16: abs(f(A16) + RandomNormal[0, 2])
A17: abs(Random[0, 7] + RandomNormal[0, 1])
B17: abs(f(A17) + RandomNormal[0, 2])
A18: abs(Random[0, 7] + RandomNormal[0, 1])
B18: abs(f(A18) + RandomNormal[0, 2])
A19: abs(Random[0, 7] + RandomNormal[0, 1])
B19: abs(f(A19) + RandomNormal[0, 2])
A20: abs(Random[0, 7] + RandomNormal[0, 1])
B20: abs(f(A20) + RandomNormal[0, 2])
A21: abs(Random[0, 7] + RandomNormal[0, 1])
B21: abs(f(A21) + RandomNormal[0, 2])
A22: abs(Random[0, 7] + RandomNormal[0, 1])
B22: abs(f(A22) + RandomNormal[0, 2])
A23: abs(Random[0, 7] + RandomNormal[0, 1])
B23: abs(f(A23) + RandomNormal[0, 2])
A24: abs(Random[0, 7] + RandomNormal[0, 1])
B24: abs(f(A24) + RandomNormal[0, 2])
A25: abs(Random[0, 7] + RandomNormal[0, 1])
B25: abs(f(A25) + RandomNormal[0, 2])
A26: abs(Random[0, 7] + RandomNormal[0, 1])
B26: abs(f(A26) + RandomNormal[0, 2])
A27: abs(Random[0, 7] + RandomNormal[0, 1])
B27: abs(f(A27) + RandomNormal[0, 2])
A28: abs(Random[0, 7] + RandomNormal[0, 1])
B28: abs(f(A28) + RandomNormal[0, 2])
A29: abs(Random[0, 7] + RandomNormal[0, 1])
B29: abs(f(A29) + RandomNormal[0, 2])
A30: abs(Random[0, 7] + RandomNormal[0, 1])
B30: abs(f(A30) + RandomNormal[0, 2])
A31: abs(Random[0, 7] + RandomNormal[0, 1])
B31: abs(f(A31) + RandomNormal[0, 2])
A32: abs(Random[0, 7] + RandomNormal[0, 1])
B32: abs(f(A32) + RandomNormal[0, 2])
A33: abs(Random[0, 7] + RandomNormal[0, 1])
B33: abs(f(A33) + RandomNormal[0, 2])
A34: abs(Random[0, 7] + RandomNormal[0, 1])
B34: abs(f(A34) + RandomNormal[0, 2])
A35: abs(Random[0, 7] + RandomNormal[0, 1])
B35: abs(f(A35) + RandomNormal[0, 2])
A36: abs(Random[0, 7] + RandomNormal[0, 1])
B36: abs(f(A36) + RandomNormal[0, 2])
A37: abs(Random[0, 7] + RandomNormal[0, 1])
B37: abs(f(A37) + RandomNormal[0, 2])
A38: abs(Random[0, 7] + RandomNormal[0, 1])
B38: abs(f(A38) + RandomNormal[0, 2])
A39: abs(Random[0, 7] + RandomNormal[0, 1])
B39: abs(f(A39) + RandomNormal[0, 2])
A40: abs(Random[0, 7] + RandomNormal[0, 1])
B40: abs(f(A40) + RandomNormal[0, 2])
A41: abs(Random[0, 7] + RandomNormal[0, 1])
B41: abs(f(A41) + RandomNormal[0, 2])
A42: abs(Random[0, 7] + RandomNormal[0, 1])
B42: abs(f(A42) + RandomNormal[0, 2])
A43: abs(Random[0, 7] + RandomNormal[0, 1])
B43: abs(f(A43) + RandomNormal[0, 2])
A44: abs(Random[0, 7] + RandomNormal[0, 1])
B44: abs(f(A44) + RandomNormal[0, 2])
A45: abs(Random[0, 7] + RandomNormal[0, 1])
B45: abs(f(A45) + RandomNormal[0, 2])
A46: abs(Random[0, 7] + RandomNormal[0, 1])
B46: abs(f(A46) + RandomNormal[0, 2])
A47: abs(Random[0, 7] + RandomNormal[0, 1])
B47: abs(f(A47) + RandomNormal[0, 2])
A48: abs(Random[0, 7] + RandomNormal[0, 1])
B48: abs(f(A48) + RandomNormal[0, 2])
A49: abs(Random[0, 7] + RandomNormal[0, 1])
B49: abs(f(A49) + RandomNormal[0, 2])
A50: abs(Random[0, 7] + RandomNormal[0, 1])
B50: abs(f(A50) + RandomNormal[0, 2])
A51: abs(Random[0, 7] + RandomNormal[0, 1])
B51: abs(f(A51) + RandomNormal[0, 2])
A52: abs(Random[0, 7] + RandomNormal[0, 1])
B52: abs(f(A52) + RandomNormal[0, 2])
A53: abs(Random[0, 7] + RandomNormal[0, 1])
B53: abs(f(A53) + RandomNormal[0, 2])
A54: abs(Random[0, 7] + RandomNormal[0, 1])
B54: abs(f(A54) + RandomNormal[0, 2])
A55: abs(Random[0, 7] + RandomNormal[0, 1])
B55: abs(f(A55) + RandomNormal[0, 2])
A56: abs(Random[0, 7] + RandomNormal[0, 1])
B56: abs(f(A56) + RandomNormal[0, 2])
A57: abs(Random[0, 7] + RandomNormal[0, 1])
B57: abs(f(A57) + RandomNormal[0, 2])
A58: abs(Random[0, 7] + RandomNormal[0, 1])
B58: abs(f(A58) + RandomNormal[0, 2])
A59: abs(Random[0, 7] + RandomNormal[0, 1])
B59: abs(f(A59) + RandomNormal[0, 2])
A60: abs(Random[0, 7] + RandomNormal[0, 1])
B60: abs(f(A60) + RandomNormal[0, 2])
A61: abs(Random[0, 7] + RandomNormal[0, 1])
B61: abs(f(A61) + RandomNormal[0, 2])
A62: abs(Random[0, 7] + RandomNormal[0, 1])
B62: abs(f(A62) + RandomNormal[0, 2])
A63: abs(Random[0, 7] + RandomNormal[0, 1])
B63: abs(f(A63) + RandomNormal[0, 2])
A64: abs(Random[0, 7] + RandomNormal[0, 1])
B64: abs(f(A64) + RandomNormal[0, 2])
A65: abs(Random[0, 7] + RandomNormal[0, 1])
B65: abs(f(A65) + RandomNormal[0, 2])
A66: abs(Random[0, 7] + RandomNormal[0, 1])
B66: abs(f(A66) + RandomNormal[0, 2])
A67: abs(Random[0, 7] + RandomNormal[0, 1])
B67: abs(f(A67) + RandomNormal[0, 2])
A68: abs(Random[0, 7] + RandomNormal[0, 1])
B68: abs(f(A68) + RandomNormal[0, 2])
A69: abs(Random[0, 7] + RandomNormal[0, 1])
B69: abs(f(A69) + RandomNormal[0, 2])
A70: abs(Random[0, 7] + RandomNormal[0, 1])
B70: abs(f(A70) + RandomNormal[0, 2])
A71: abs(Random[0, 7] + RandomNormal[0, 1])
B71: abs(f(A71) + RandomNormal[0, 2])
A72: abs(Random[0, 7] + RandomNormal[0, 1])
B72: abs(f(A72) + RandomNormal[0, 2])
A73: abs(Random[0, 7] + RandomNormal[0, 1])
B73: abs(f(A73) + RandomNormal[0, 2])
A74: abs(Random[0, 7] + RandomNormal[0, 1])
B74: abs(f(A74) + RandomNormal[0, 2])
A75: abs(Random[0, 7] + RandomNormal[0, 1])
B75: abs(f(A75) + RandomNormal[0, 2])
A76: abs(Random[0, 7] + RandomNormal[0, 1])
B76: abs(f(A76) + RandomNormal[0, 2])
A77: abs(Random[0, 7] + RandomNormal[0, 1])
B77: abs(f(A77) + RandomNormal[0, 2])
A78: abs(Random[0, 7] + RandomNormal[0, 1])
B78: abs(f(A78) + RandomNormal[0, 2])
A79: abs(Random[0, 7] + RandomNormal[0, 1])
B79: abs(f(A79) + RandomNormal[0, 2])
A80: abs(Random[0, 7] + RandomNormal[0, 1])
B80: abs(f(A80) + RandomNormal[0, 2])
A81: abs(Random[0, 7] + RandomNormal[0, 1])
B81: abs(f(A81) + RandomNormal[0, 2])
A82: abs(Random[0, 7] + RandomNormal[0, 1])
B82: abs(f(A82) + RandomNormal[0, 2])
A83: abs(Random[0, 7] + RandomNormal[0, 1])
B83: abs(f(A83) + RandomNormal[0, 2])
A84: abs(Random[0, 7] + RandomNormal[0, 1])
B84: abs(f(A84) + RandomNormal[0, 2])
A85: abs(Random[0, 7] + RandomNormal[0, 1])
B85: abs(f(A85) + RandomNormal[0, 2])
A86: abs(Random[0, 7] + RandomNormal[0, 1])
B86: abs(f(A86) + RandomNormal[0, 2])
A87: abs(Random[0, 7] + RandomNormal[0, 1])
B87: abs(f(A87) + RandomNormal[0, 2])
A88: abs(Random[0, 7] + RandomNormal[0, 1])
B88: abs(f(A88) + RandomNormal[0, 2])
A89: abs(Random[0, 7] + RandomNormal[0, 1])
B89: abs(f(A89) + RandomNormal[0, 2])
A90: abs(Random[0, 7] + RandomNormal[0, 1])
B90: abs(f(A90) + RandomNormal[0, 2])
A91: abs(Random[0, 7] + RandomNormal[0, 1])
B91: abs(f(A91) + RandomNormal[0, 2])
A92: abs(Random[0, 7] + RandomNormal[0, 1])
B92: abs(f(A92) + RandomNormal[0, 2])
A93: abs(Random[0, 7] + RandomNormal[0, 1])
B93: abs(f(A93) + RandomNormal[0, 2])
A94: abs(Random[0, 7] + RandomNormal[0, 1])
B94: abs(f(A94) + RandomNormal[0, 2])
A95: abs(Random[0, 7] + RandomNormal[0, 1])
B95: abs(f(A95) + RandomNormal[0, 2])
A96: abs(Random[0, 7] + RandomNormal[0, 1])
B96: abs(f(A96) + RandomNormal[0, 2])
A97: abs(Random[0, 7] + RandomNormal[0, 1])
B97: abs(f(A97) + RandomNormal[0, 2])
A98: abs(Random[0, 7] + RandomNormal[0, 1])
B98: abs(f(A98) + RandomNormal[0, 2])
A99: abs(Random[0, 7] + RandomNormal[0, 1])
B99: abs(f(A99) + RandomNormal[0, 2])
A100: abs(Random[0, 7] + RandomNormal[0, 1])
B100: abs(f(A100) + RandomNormal[0, 2])
C2: (A2, B2)
C3: (A3, B3)
C4: (A4, B4)
C5: (A5, B5)
C6: (A6, B6)
C7: (A7, B7)
C8: (A8, B8)
C9: (A9, B9)
C10: (A10, B10)
C11: (A11, B11)
C12: (A12, B12)
C13: (A13, B13)
C14: (A14, B14)
C15: (A15, B15)
C16: (A16, B16)
C17: (A17, B17)
C18: (A18, B18)
C19: (A19, B19)
C20: (A20, B20)
C21: (A21, B21)
C22: (A22, B22)
C23: (A23, B23)
C24: (A24, B24)
C25: (A25, B25)
C26: (A26, B26)
C27: (A27, B27)
C28: (A28, B28)
C29: (A29, B29)
C30: (A30, B30)
C31: (A31, B31)
C32: (A32, B32)
C33: (A33, B33)
C34: (A34, B34)
C35: (A35, B35)
C36: (A36, B36)
C37: (A37, B37)
C38: (A38, B38)
C39: (A39, B39)
C40: (A40, B40)
C41: (A41, B41)
C42: (A42, B42)
C43: (A43, B43)
C44: (A44, B44)
C45: (A45, B45)
C46: (A46, B46)
C47: (A47, B47)
C48: (A48, B48)
C49: (A49, B49)
C50: (A50, B50)
C51: (A51, B51)
C52: (A52, B52)
C53: (A53, B53)
C54: (A54, B54)
C55: (A55, B55)
C56: (A56, B56)
C57: (A57, B57)
C58: (A58, B58)
C59: (A59, B59)
C60: (A60, B60)
C61: (A61, B61)
C62: (A62, B62)
C63: (A63, B63)
C64: (A64, B64)
C65: (A65, B65)
C66: (A66, B66)
C67: (A67, B67)
C68: (A68, B68)
C69: (A69, B69)
C70: (A70, B70)
C71: (A71, B71)
C72: (A72, B72)
C73: (A73, B73)
C74: (A74, B74)
C75: (A75, B75)
C76: (A76, B76)
C77: (A77, B77)
C78: (A78, B78)
C79: (A79, B79)
C80: (A80, B80)
C81: (A81, B81)
C82: (A82, B82)
C83: (A83, B83)
C84: (A84, B84)
C85: (A85, B85)
C86: (A86, B86)
C87: (A87, B87)
C88: (A88, B88)
C89: (A89, B89)
C90: (A90, B90)
C91: (A91, B91)
C92: (A92, B92)
C93: (A93, B93)
C94: (A94, B94)
C95: (A95, B95)
C96: (A96, B96)
C97: (A97, B97)
C98: (A98, B98)
C99: (A99, B99)
C100: (A100, B100)
L_1: {A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31, A32, A33, A34, A35, A36, A37, A38, A39, A40, A41, A42, A43, A44, A45, A46, A47, A48, A49, A50, A51, A52, A53, A54, A55, A56, A57, A58, A59, A60, A61, A62, A63, A64, A65, A66, A67, A68, A69, A70, A71, A72, A73, A74, A75, A76, A77, A78, A79, A80, A81, A82, A83, A84, A85, A86, A87, A88, A89, A90, A91, A92, A93, A94, A95, A96, A97, A98, A99, A100}
L_2: {B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13, B14, B15, B16, B17, B18, B19, B20, B21, B22, B23, B24, B25, B26, B27, B28, B29, B30, B31, B32, B33, B34, B35, B36, B37, B38, B39, B40, B41, B42, B43, B44, B45, B46, B47, B48, B49, B50, B51, B52, B53, B54, B55, B56, B57, B58, B59, B60, B61, B62, B63, B64, B65, B66, B67, B68, B69, B70, B71, B72, B73, B74, B75, B76, B77, B78, B79, B80, B81, B82, B83, B84, B85, B86, B87, B88, B89, B90, B91, B92, B93, B94, B95, B96, B97, B98, B99, B100}
L_3: {C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24, C25, C26, C27, C28, C29, C30, C31, C32, C33, C34, C35, C36, C37, C38, C39, C40, C41, C42, C43, C44, C45, C46, C47, C48, C49, C50, C51, C52, C53, C54, C55, C56, C57, C58, C59, C60, C61, C62, C63, C64, C65, C66, C67, C68, C69, C70, C71, C72, C73, C74, C75, C76, C77, C78, C79, C80, C81, C82, C83, C84, C85, C86, C87, C88, C89, C90, C91, C92, C93, C94, C95, C96, C97, C98, C99, C100}
MX = Mean(L_1)
MY = Mean(L_2)
SX = SD(L_1)
SY = SD(L_2)
r = PMCC(L_3)
PMX: (MX, 0)
PMY: (0, MY)
PM: (MX, MY)
c = Ray(PMY, PM)
d = Ray(PMX, PM)
text1: "$ \bar{x}=" + (LaTeX[MX]) + " $"
text2: "$ \bar{y} =" + (LaTeX[MY]) + "$"
e = false
rr = NaN
CampDeText1 = Textfield(rr)
g = false
dif: rr - r
n = 0
text5: "Intents = " + n + ""
TextR = If(Defined[dif], If[dif ≤ -0.2, "Ha de ser força més gran", If[dif ≤ -0.02, "Ha de ser més gran", If[dif < 0.02, "Bona vista!", If[dif < 0.2, "Ha de ser més petit", "Ha de ser força més petit"]]]])
text3: "Coef. de correlació lineal  r= " + r + ""