Bonjour,je suis débutante en programmation statistique en général, je veux calculer ARL(average run length) moyenne des alarmes dans une carte de controle statistique,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 /* Multiple CUSUM control chart code*/ dm log 'clear'; dm output 'clear'; options nonumber nodate; Title CUSUM2000; proc iml; create control var {count}; do i= 1 to 10000; Flag = 0; /*Flag to stop iterations*/ count=0; /*Count variable to measure ARL*/ D=0; /*Value holder for calculated values*/ var=2; /*number of variables in simulation*/ do while (Flag=0); m={0, .25}; /*Mean or observation vector*/ l={1 1.118, 1.118 1.25}; /*Covariance matrix*/ s={1 .1, .1 1}; /*Correlation values*/ /*Begin observation generation*/ seed = 0; n = 1; sigma =l#s; p = nrow(sigma); b = repeat(m,n,1); q = root(sigma); q = root(sigma); z =normal(repeat(seed,n,p)); y =z*q + b; out=y; j=count+1; k=2*j; fir={0, 0}; /*Fast initial response values (not used in simulation)*/ R=D+(y)-fir`; if R > 0 then D=R; else D=0; T = R; h = 12.20; /*Critical value for test*/ count = count + 1; flag = (T > h); if count > 9999 then flag = 1; end; append var {count}; end; quit; proc means data = control MEAN; /*Calculation of ARL*/ var count; output out = stats; run;
les messages d'erreur sont les suivants
svp aider moi,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 ERROR: (execution) Matrices do not conform to the operation. operation : + at line 1467 column 11 operands : _TEM1001, B _TEM1001 1 row 2 cols (numeric) 1.2391863 1.7611714 B 2 rows 1 col (numeric) 0 0.25 statement : ASSIGN at line 1467 column 4 1487 quit; NOTE: Exiting IML. NOTE: The data set WORK.CONTROL has 0 observations and 1 variables. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE IML used (Total process time): real time 0.09 seconds cpu time 0.06 seconds![]()
Partager