קובץ:MATLABCChart.png
תוכן הדף אינו נתמך בשפות אחרות.
מראה
מתוך ויקיפדיה, האנציקלופדיה החופשית
MATLABCChart.png (560 × 420 פיקסלים, גודל הקובץ: 4 ק"ב, סוג MIME: image/png)
זהו קובץ שמקורו במיזם ויקישיתוף. תיאורו בדף תיאור הקובץ המקורי (בעברית) מוצג למטה. |
תוכן עניינים
תקציר
תיאורMATLABCChart.png |
English: A en:MATLAB-generated en:c-chart for a process that experienced a 1.5σ drift starting at midnight. |
תאריך יצירה | |
מקור | נוצר על־ידי מעלה היצירה |
יוצר | DanielPenfield |
רישיון
אני, בעל זכויות היוצרים על עבודה זו, מפרסם בזאת את העבודה תחת הרישיון הבא:
הקובץ הזה מתפרסם לפי תנאי רישיון קריאייטיב קומונז ייחוס-שיתוף זהה 3.0 לא מותאם.
- הנכם רשאים:
- לשתף – להעתיק, להפיץ ולהעביר את העבודה
- לערבב בין עבודות – להתאים את העבודה
- תחת התנאים הבאים:
- ייחוס – יש לתת ייחוס הולם, לתת קישור לרישיון, ולציין אם נעשו שינויים. אפשר לעשות את זה בכל צורה סבירה, אבל לא בשום צורה שמשתמע ממנה שמעניק הרישיון תומך בך או בשימוש שלך.
- שיתוף זהה – אם תיצרו רמיקס, תשנו, או תבנו על החומר, חובה עליכם להפיץ את התרומות שלך לפי תנאי רישיון זהה או תואם למקור.
Source code
#!/usr/bin/perl -w
#
# randomly generate process observations that simulate a
# Poisson-distributed process in the state of statistical control
# (c_setup.csv) and simulate the same process experiencing a drift of
# magnitude $drift starting two hours into the $shift shift
# (c_monitoring.csv)
#
use strict;
use Math::Random;
my %shiftSchedule = (
"first" => { "start" => 6.00, "end" => 14.00 },
"second" => { "start" => 14.00, "end" => 22.00 },
"third" => { "start" => 22.00, "end" => 6.00 }
);
my $shift = "third"; # shift to monitor
my $inspectionRate = 1 / 2; # every 1/2 hour
my $drift = 1.5; # sigma drift to simulate
my $m = 25; # samples in control chart setup
my $target = 0.10; # fraction nonconforming target
my $c = $target;
my $n = 48; # observations per sample
my $hour;
my $i;
my $minute;
my @observations;
my $observation;
my $setupM = $m;
#
# simulate control chart setup
#
open(SETUPCSV, ">c_setup.csv") || die "! can't open \"c_setup.csv\" ($!)\n";
for ($i = 1; $i <= $m; $i++) {
@observations = Math::Random::random_poisson($n, $c);
$observation = 0;
map { $observation += $_ } @observations;
print SETUPCSV $observation . "\r\n";
}
close(SETUPCSV);
#
# simulate control chart monitoring
#
open(MONITORINGCSV, ">c_monitoring.csv") || die "! can't open \"c_monitoring.csv\" ($!)\n";
$m = $shiftSchedule{$shift}{"end"} - $shiftSchedule{$shift}{"start"};
if ($m < 0) {
$m += 24;
}
$m /= $inspectionRate;
for ($i = 1; $i <= $m; $i++) {
$hour = int($i * $inspectionRate + $shiftSchedule{$shift}{"start"});
if ($hour >= 24) {
$hour -= 24;
}
$minute = ($i & 0x1) ? (60 * $inspectionRate) : 0;
if ($i >= (0.25 * $m)) {
if ($i < (0.75 * $m)) {
$c = $target + ($drift * $target / (0.5 * $m)) * ($i - (0.25 * $m));
} else {
$c = $target + $drift * $target;
}
}
@observations = Math::Random::random_poisson($n, $c);
$observation = 0;
map { $observation += $_ } @observations;
printf MONITORINGCSV "'%d:%02d',%d\r\n", $hour, $minute, $observation;
}
close(MONITORINGCSV);
%
% display a c-chart control chart in MATLAB
%
clear
%
% rational subgroup size
%
n = 48
%
% Phase I
%
% compute the control chart center line and control limits based on a
% process that is simulated to be in a state of statistical control
%
setupobservations = csvread('c_setup.csv');
setupstats = controlchart(setupobservations, 'charttype', 'c', 'unit', n);
%
% Phase II
%
% read in the process observations representing the monitoring phase
%
observations = importdata('c_monitoring.csv');
%
% first column is the time of the observation (24 hour clock)
%
halfhourlylabel = observations.rowheaders;
%
% second column consists of the observations (counts of
% nonconformances per rational subgroup)
%
monitoringobservations = observations.data;
%
% just display labels on the "on the hour" ticks
%
emptylabel = cell(size(monitoringobservations,1) - size(halfhourlylabel,1), 1);
emptylabel(:) = {''};
hourlylabel = vertcat(halfhourlylabel(2:2:end), emptylabel);
%
% plot the control chart for the monitoring phase observations based
% on the "in control" estimates for the process mean
%
monitoringstats = controlchart(monitoringobservations, ...
'charttype', 'c', ...
'label', halfhourlylabel, ...
'unit', n, ...
'mean', setupstats.m, ...
'sigma', setupstats.m);
title('c chart for quality characteristic XXX')
xlabel('Sample')
ylabel('Number of nonconformances')
%
% the labels supplied to controlchart() only appear when the user
% selects a plotted point with her mouse--we have to explicitly
% set labels in the X axis if we want them
%
set(gca,'XTickLabel', hourlylabel)
פריטים שמוצגים בקובץ הזה
מוצג
ערך כלשהו ללא פריט ויקינתונים
22 ביוני 2013
היסטוריית הקובץ
ניתן ללחוץ על תאריך/שעה כדי לראות את הקובץ כפי שנראה באותו זמן.
תאריך/שעה | תמונה ממוזערת | ממדים | משתמש | הערה | |
---|---|---|---|---|---|
נוכחית | 17:04, 22 ביוני 2013 | 420 × 560 (4 ק"ב) | DanielPenfield | User created page with UploadWizard |
שימוש בקובץ
אין בוויקיפדיה דפים המשתמשים בקובץ זה.
מטא־נתונים
קובץ זה מכיל מידע נוסף, שכנראה הגיע ממצלמה דיגיטלית או מסורק שבהם הקובץ נוצר או עבר דיגיטציה.
אם הקובץ שונה ממצבו הראשוני, כמה מהנתונים להלן עלולים שלא לשקף באופן מלא את הקובץ הנוכחי.
יוצר | |
---|---|
בעל זכויות היוצרים |
|
כותרת התמונה |
|
רזולוציה אופקית | 37.8 dpc |
רזולוציה אנכית | 37.8 dpc |
התאריך והשעה של הפיכת הקובץ לדיגיטלי |
|
תוכנה בשימוש |
|
אוחזר מתוך "https://he.wikipedia.org/wiki/קובץ:MATLABCChart.png"