1 00:00:00,090 --> 00:00:02,346 You now know a bunch about machine learning. 2 00:00:02,390 --> 00:00:03,635 In this video, I like to 3 00:00:03,635 --> 00:00:05,448 teach you a programing language, 4 00:00:05,470 --> 00:00:06,718 Octave, in which you'll be 5 00:00:06,760 --> 00:00:08,878 able to very quickly implement 6 00:00:08,890 --> 00:00:10,259 the the learning algorithms we've 7 00:00:10,259 --> 00:00:11,770 seen already, and the learning 8 00:00:11,770 --> 00:00:14,872 algorithms we'll see later in this course. 9 00:00:14,900 --> 00:00:16,381 In the past, I've tried to teach machine learning 10 00:00:16,381 --> 00:00:19,497 using a large variety of different programming languages 11 00:00:19,500 --> 00:00:22,046 including C++ Java, 12 00:00:22,825 --> 00:00:25,379 Python, NumPy, and also 13 00:00:25,379 --> 00:00:27,128 Octave, and what I 14 00:00:27,160 --> 00:00:28,783 found was that students were able 15 00:00:28,790 --> 00:00:30,535 to learn the most 16 00:00:30,570 --> 00:00:32,497 productively learn the most quickly 17 00:00:32,497 --> 00:00:33,780 and prototype your algorithms most 18 00:00:33,780 --> 00:00:35,569 quickly using a relatively 19 00:00:35,569 --> 00:00:38,262 high level language like octave. 20 00:00:38,290 --> 00:00:39,798 In fact, what I often 21 00:00:39,798 --> 00:00:41,516 see in Silicon Valley is 22 00:00:41,520 --> 00:00:43,655 that if even if you need to build. 23 00:00:43,655 --> 00:00:44,714 If you want to build a large 24 00:00:44,740 --> 00:00:46,548 scale deployment of a learning 25 00:00:46,610 --> 00:00:48,242 algorithm, what people will often do 26 00:00:48,242 --> 00:00:50,637 is prototype and the language is Octave. 27 00:00:50,660 --> 00:00:52,200 Which is a great prototyping language. 28 00:00:52,210 --> 00:00:55,264 So you can sort of get your learning algorithms working quickly. 29 00:00:55,270 --> 00:00:56,629 And then only if you need 30 00:00:56,629 --> 00:00:58,459 to a very large scale deployment of it. 31 00:00:58,480 --> 00:01:00,362 Only then spend your time 32 00:01:00,362 --> 00:01:03,059 re-implementing the algorithm 33 00:01:03,059 --> 00:01:05,150 to C++ Java or some of the language like that. 34 00:01:05,160 --> 00:01:06,273 Because all the lessons we've learned is 35 00:01:06,300 --> 00:01:08,679 that a time or develop a time. 36 00:01:08,710 --> 00:01:09,848 That is your time. 37 00:01:09,870 --> 00:01:13,309 The machine learning's time is incredibly valuable. 38 00:01:13,320 --> 00:01:15,101 And if you can 39 00:01:15,101 --> 00:01:17,898 get your learning algorithms to work more quickly in Octave. 40 00:01:17,898 --> 00:01:18,932 Then overall you have a 41 00:01:18,932 --> 00:01:20,697 huge time savings by first 42 00:01:20,720 --> 00:01:22,143 developing the algorithms in 43 00:01:22,150 --> 00:01:23,971 Octave, and then implementing and 44 00:01:23,971 --> 00:01:28,145 maybe C++ Java, only after we have the ideas working. 45 00:01:28,160 --> 00:01:30,238 The most common prototyping language I 46 00:01:30,238 --> 00:01:31,538 see people use for machine 47 00:01:31,560 --> 00:01:34,058 learning are: Octave, MATLAB, 48 00:01:34,070 --> 00:01:37,230 Python, NumPy, and R. 49 00:01:38,150 --> 00:01:40,032 Octave is nice because open sourced. 50 00:01:40,032 --> 00:01:42,660 And MATLAB works well 51 00:01:42,670 --> 00:01:44,656 too, but it is expensive for 52 00:01:44,656 --> 00:01:45,956 to many people. 53 00:01:45,960 --> 00:01:47,972 But if you have access to a copy of MATLAB. 54 00:01:47,988 --> 00:01:50,095 You can also use MATLAB with this class. 55 00:01:50,110 --> 00:01:52,037 If you know Python, NumPy, 56 00:01:52,037 --> 00:01:54,853 or if you know R. I do see some people use it. 57 00:01:54,870 --> 00:01:56,353 But, what I see is 58 00:01:56,360 --> 00:01:57,739 that people usually end up 59 00:01:57,760 --> 00:02:00,041 developing somewhat more slowly, and 60 00:02:00,050 --> 00:02:02,121 you know, these languages. 61 00:02:02,121 --> 00:02:04,048 Because the Python, NumPy syntax 62 00:02:04,048 --> 00:02:08,391 is just slightly clunkier than the Octave syntax. 63 00:02:08,410 --> 00:02:09,704 And so because of that, and 64 00:02:09,704 --> 00:02:11,372 because we are releasing starter 65 00:02:11,380 --> 00:02:13,039 code in Octave. 66 00:02:13,039 --> 00:02:14,363 I strongly recommend that you 67 00:02:14,363 --> 00:02:18,321 not try to do the following exercises in this class in NumPy and R. 68 00:02:18,330 --> 00:02:19,805 But that I do recommend that 69 00:02:19,805 --> 00:02:21,498 you instead do the programming exercises 70 00:02:21,520 --> 00:02:24,292 for this class in octave instead. 71 00:02:24,330 --> 00:02:25,428 What I'm going to do in 72 00:02:25,428 --> 00:02:26,708 this video is go through 73 00:02:26,708 --> 00:02:28,667 a list of commands very, 74 00:02:28,667 --> 00:02:29,879 very quickly, and its goal 75 00:02:29,879 --> 00:02:31,073 is to quickly show you the 76 00:02:31,080 --> 00:02:34,807 range of commands and the range of things you can do in Octave. 77 00:02:34,807 --> 00:02:36,493 The course website will have 78 00:02:36,520 --> 00:02:38,965 a transcript of everything I 79 00:02:38,965 --> 00:02:42,095 do, and so after 80 00:02:42,095 --> 00:02:43,185 watching this video you 81 00:02:43,185 --> 00:02:44,905 can refer to the transcript 82 00:02:44,905 --> 00:02:46,635 posted on the course website 83 00:02:46,635 --> 00:02:48,247 when you want find a command. 84 00:02:48,247 --> 00:02:50,226 Concretely, what I recommend 85 00:02:50,226 --> 00:02:53,225 you do is first watch the tutorial videos. 86 00:02:53,230 --> 00:02:55,118 And after watching to the 87 00:02:55,120 --> 00:02:58,728 end, then install Octave on your computer. 88 00:02:58,728 --> 00:02:59,738 And finally, it goes to 89 00:02:59,738 --> 00:03:01,769 the course website, download the transcripts 90 00:03:01,770 --> 00:03:02,983 of the things you see in the 91 00:03:02,983 --> 00:03:04,915 session, and type in 92 00:03:04,930 --> 00:03:07,162 whatever commands seem interesting 93 00:03:07,200 --> 00:03:09,132 to you into Octave, so that it's 94 00:03:09,132 --> 00:03:10,602 running on your own computer, so 95 00:03:10,602 --> 00:03:12,962 you can see it run for yourself. 96 00:03:12,970 --> 00:03:15,535 And with that let's get started. 97 00:03:15,920 --> 00:03:19,363 Here's my Windows desktop, and I'm going to start up Octave. 98 00:03:19,370 --> 00:03:20,977 And I'm now in Octave. 99 00:03:20,977 --> 00:03:22,522 And that's my Octave prompt. 100 00:03:22,522 --> 00:03:24,475 Let me first show the elementary 101 00:03:24,475 --> 00:03:27,291 operations you can do in Octave. 102 00:03:27,330 --> 00:03:28,505 So you type in 5 + 6. 103 00:03:28,505 --> 00:03:30,493 That gives you the answer of 11. 104 00:03:30,493 --> 00:03:31,516 3 - 2. 105 00:03:31,540 --> 00:03:33,710 5 x 8, 1/2, 2^6 106 00:03:35,733 --> 00:03:37,747 is 64. 107 00:03:37,810 --> 00:03:42,361 So those are the elementary math operations. 108 00:03:42,390 --> 00:03:44,495 You can also do logical operations. 109 00:03:44,550 --> 00:03:45,929 So one equals two. 110 00:03:45,929 --> 00:03:47,722 This evaluates to false. 111 00:03:47,722 --> 00:03:51,658 The percent command here means a comment. 112 00:03:51,658 --> 00:03:53,861 So, one equals two, evaluates to false. 113 00:03:53,861 --> 00:03:55,622 Which is represents by zero. 114 00:03:55,650 --> 00:03:58,028 One not equals to two. 115 00:03:58,028 --> 00:03:59,312 This is true. 116 00:03:59,312 --> 00:04:00,718 So that returns one. 117 00:04:00,718 --> 00:04:02,146 Note that a not equal sign 118 00:04:02,146 --> 00:04:05,478 is this tilde equals symbol. 119 00:04:05,550 --> 00:04:07,336 And not bang equals. 120 00:04:07,336 --> 00:04:09,267 Which is what some other 121 00:04:09,267 --> 00:04:10,878 programming languages use. 122 00:04:10,910 --> 00:04:13,616 Lets see logical operations one and zero 123 00:04:13,616 --> 00:04:15,545 use a double ampersand sign to 124 00:04:15,545 --> 00:04:17,340 the logical AND. 125 00:04:18,120 --> 00:04:20,188 And that evaluates false. 126 00:04:20,188 --> 00:04:23,886 One or zero is the OR operation. 127 00:04:23,900 --> 00:04:25,736 And that evaluates to true. 128 00:04:25,736 --> 00:04:27,131 And I can XOR one and 129 00:04:27,131 --> 00:04:30,333 zero, and that evaluates to one. 130 00:04:30,333 --> 00:04:32,928 This thing over on the left, this Octave 324.x 131 00:04:32,928 --> 00:04:35,683 equals 11, this is the default Octave prompt. 132 00:04:35,700 --> 00:04:37,513 It shows the, what, the 133 00:04:37,520 --> 00:04:39,150 version in Octave and so on. 134 00:04:39,150 --> 00:04:40,423 If you don't want that prompt, 135 00:04:40,450 --> 00:04:43,025 there's a somewhat cryptic command PF 136 00:04:43,025 --> 00:04:44,670 quote, greater than, greater 137 00:04:44,670 --> 00:04:46,602 than and so on, 138 00:04:46,602 --> 00:04:48,800 that you can use to change the prompt. 139 00:04:48,810 --> 00:04:51,272 And I guess this quote a string in the middle. 140 00:04:51,272 --> 00:04:53,362 Your quote, greater than, greater than, space. 141 00:04:53,400 --> 00:04:55,592 That's what I prefer my Octave prompt to look like. 142 00:04:55,592 --> 00:04:57,722 So if I hit enter. 143 00:04:57,920 --> 00:04:59,763 Oops, excuse me. 144 00:04:59,763 --> 00:05:00,786 Like so. 145 00:05:00,786 --> 00:05:02,622 PS1 like so. 146 00:05:02,622 --> 00:05:05,420 Now my Octave prompt has changed to the greater than, greater than sign.Which, 147 00:05:05,500 --> 00:05:09,263 you know, looks quite a bit better. 148 00:05:09,710 --> 00:05:12,384 Next let's talk about Octave variables. 149 00:05:12,384 --> 00:05:13,865 I can take the variable 150 00:05:13,865 --> 00:05:16,165 A and assign it to 3. 151 00:05:16,165 --> 00:05:18,421 And hit enter. 152 00:05:18,440 --> 00:05:20,043 And now A is equal to 3. 153 00:05:20,070 --> 00:05:22,861 You want to assign a variable, but you don't want to print out the result. 154 00:05:22,861 --> 00:05:26,758 If you put a semicolon, the semicolon 155 00:05:26,920 --> 00:05:30,824 suppresses the print output. 156 00:05:30,824 --> 00:05:33,160 So to do that, enter, it doesn't print anything. 157 00:05:33,160 --> 00:05:35,399 Whereas A equals 3. 158 00:05:35,420 --> 00:05:36,719 mix it, print it out, 159 00:05:36,719 --> 00:05:39,845 where A equals, 3 semicolon doesn't print anything. 160 00:05:39,850 --> 00:05:41,845 I can do string assignment. 161 00:05:41,845 --> 00:05:43,473 B equals hi 162 00:05:43,520 --> 00:05:45,047 Now if I just 163 00:05:45,047 --> 00:05:46,072 enter B it prints out the 164 00:05:46,072 --> 00:05:48,338 variable B. So B is the string hi 165 00:05:48,370 --> 00:05:51,118 C equals 3 greater than colon 1. 166 00:05:51,130 --> 00:05:54,538 So, now C evaluates the true. 167 00:05:55,710 --> 00:05:57,999 If you want to print 168 00:05:58,030 --> 00:06:00,832 out or display a variable, here's how you go about it. 169 00:06:00,832 --> 00:06:03,725 Let me set A equals Pi. 170 00:06:03,760 --> 00:06:04,985 And if I want to print 171 00:06:04,985 --> 00:06:08,545 A I can just type A like so, and it will print it out. 172 00:06:08,545 --> 00:06:10,344 For more complex printing there is 173 00:06:10,344 --> 00:06:13,674 also the DISP command which stands for Display. 174 00:06:13,710 --> 00:06:15,858 Display A just prints out A like so. 175 00:06:15,890 --> 00:06:18,337 You can also display strings 176 00:06:18,350 --> 00:06:21,392 so: DISP, sprintf, two 177 00:06:21,460 --> 00:06:24,990 decimals, percent 0.2, 178 00:06:25,260 --> 00:06:28,273 F, comma, A. Like so. 179 00:06:28,273 --> 00:06:29,863 And this will print out the string. 180 00:06:29,863 --> 00:06:31,722 Two decimals, colon, 3.14. 181 00:06:31,722 --> 00:06:33,651 This is kind of 182 00:06:33,670 --> 00:06:35,993 an old style C syntax. 183 00:06:35,993 --> 00:06:37,404 For those of you that 184 00:06:37,420 --> 00:06:39,073 have programmed C before, this is 185 00:06:39,073 --> 00:06:41,378 essentially the syntax you use to print screen. 186 00:06:41,380 --> 00:06:44,498 So the Sprintf generates a 187 00:06:44,510 --> 00:06:46,021 string that is less 188 00:06:46,021 --> 00:06:48,274 than the 2 decimals, 3.1 plus string. 189 00:06:48,290 --> 00:06:50,644 This percent 0.2 F means 190 00:06:50,644 --> 00:06:52,475 substitute A into here, 191 00:06:52,475 --> 00:06:55,926 showing the two digits after the decimal points. 192 00:06:55,926 --> 00:06:58,104 And DISP takes the string 193 00:06:58,130 --> 00:07:00,691 DISP generates it by the Sprintf command. 194 00:07:00,691 --> 00:07:01,683 Sprintf. 195 00:07:01,683 --> 00:07:03,091 The Sprintf command. 196 00:07:03,091 --> 00:07:05,835 And DISP actually displays the string. 197 00:07:05,870 --> 00:07:07,020 And to show you another 198 00:07:07,020 --> 00:07:11,360 example, Sprintf six decimals 199 00:07:11,361 --> 00:07:14,551 percent 0.6 F comma A. 200 00:07:14,930 --> 00:07:17,075 And, this should print Pi 201 00:07:17,090 --> 00:07:21,100 with six decimal places. 202 00:07:22,060 --> 00:07:25,728 Finally, I was saying, a like so, looks like this. There 203 00:07:25,740 --> 00:07:28,633 are useful shortcuts that type type formats long. 204 00:07:28,633 --> 00:07:31,759 It causes strings by default. 205 00:07:31,760 --> 00:07:33,748 Be displayed to a lot more decimal places. 206 00:07:33,748 --> 00:07:35,593 And format short is a 207 00:07:35,593 --> 00:07:37,095 command that restores the default 208 00:07:37,120 --> 00:07:40,113 of just printing a small number of digits. 209 00:07:40,600 --> 00:07:43,934 Okay, that's how you work with variables. 210 00:07:43,934 --> 00:07:47,047 Now let's look at vectors and matrices. 211 00:07:47,070 --> 00:07:49,274 Let's say I want to assign MAT A to the matrix. 212 00:07:49,280 --> 00:07:50,974 Let me show you an example: 1, 2, 213 00:07:50,980 --> 00:07:54,593 semicolon, 3, 4, semicolon, 5, 6. 214 00:07:54,600 --> 00:07:56,235 This generates a three by 215 00:07:56,240 --> 00:07:58,572 two matrix A whose first 216 00:07:58,580 --> 00:07:59,818 row is 1, 2. Second row 217 00:07:59,820 --> 00:08:02,030 3, 4. Third row is 5, 6. 218 00:08:02,030 --> 00:08:04,385 What the semicolon does is 219 00:08:04,390 --> 00:08:05,818 essentially say, go to 220 00:08:05,820 --> 00:08:07,915 the next row of the matrix. 221 00:08:07,915 --> 00:08:09,016 There are other ways to type this in. 222 00:08:09,016 --> 00:08:11,536 Type A 1, 2 semicolon 223 00:08:11,536 --> 00:08:15,046 3, 4, semicolon, 5, 6, like so. 224 00:08:15,046 --> 00:08:17,038 And that's another equivalent way of 225 00:08:17,038 --> 00:08:18,576 assigning A to be 226 00:08:18,576 --> 00:08:22,183 the values of this three by two matrix. 227 00:08:22,200 --> 00:08:23,568 Similarly you can assign vectors. 228 00:08:23,568 --> 00:08:25,532 So V equals 1, 2, 3. 229 00:08:25,560 --> 00:08:27,359 This is actually a row vector. 230 00:08:27,359 --> 00:08:29,915 Or this is a 3 by 1 vector. 231 00:08:29,940 --> 00:08:32,016 Where that is a fat Y vector, 232 00:08:32,030 --> 00:08:34,375 excuse me, not, this is 233 00:08:34,380 --> 00:08:37,998 a 1 by 3 matrix, right. 234 00:08:37,998 --> 00:08:39,256 Not 3 by 1. 235 00:08:39,256 --> 00:08:41,015 If I want to assign 236 00:08:41,015 --> 00:08:43,975 this to a column vector, 237 00:08:43,975 --> 00:08:48,778 what I would do instead is do v 1;2;3. 238 00:08:48,830 --> 00:08:50,030 And this will give me a 3 by 1. 239 00:08:50,100 --> 00:08:51,797 There's a 1 by 3 vector. 240 00:08:51,797 --> 00:08:55,892 So this will be a column vector. 241 00:08:56,250 --> 00:08:57,968 Here's some more useful notation. 242 00:08:57,968 --> 00:09:02,343 V equals 1: 0.1: 2. 243 00:09:02,343 --> 00:09:03,598 What this does is 244 00:09:03,620 --> 00:09:05,716 it sets V to the bunch 245 00:09:05,716 --> 00:09:08,714 of elements that start from 1. 246 00:09:08,714 --> 00:09:10,392 And increments and steps 247 00:09:10,410 --> 00:09:13,657 of 0.1 until you get up to 2. 248 00:09:13,660 --> 00:09:19,168 So if I do this, V is going to be this, you know, row vector. 249 00:09:19,168 --> 00:09:23,022 This is what one by eleven matrix really. 250 00:09:23,022 --> 00:09:23,739 That's 1, 1.1, 1.2, 1.3 and 251 00:09:23,739 --> 00:09:26,921 so on until we 252 00:09:27,630 --> 00:09:30,141 get up to two. 253 00:09:31,440 --> 00:09:33,269 Now, and I can also 254 00:09:33,269 --> 00:09:35,049 set V equals one colon six, 255 00:09:35,060 --> 00:09:38,270 and that sets V to be these numbers. 256 00:09:38,270 --> 00:09:41,291 1 through 6, okay. 257 00:09:41,620 --> 00:09:44,254 Now here are some other ways to generate matrices. 258 00:09:44,254 --> 00:09:47,426 Ones 2.3 is a command 259 00:09:47,426 --> 00:09:49,134 that generates a matrix that 260 00:09:49,140 --> 00:09:50,790 is a two by three matrix 261 00:09:50,790 --> 00:09:52,712 that is the matrix of all ones. 262 00:09:52,712 --> 00:09:53,991 So if I set that c2 263 00:09:54,000 --> 00:09:56,845 times ones two by 264 00:09:56,845 --> 00:09:59,798 three this generates a 265 00:09:59,798 --> 00:10:03,061 two by three matrix that is all two's. 266 00:10:03,080 --> 00:10:04,258 You can think of this as a 267 00:10:04,258 --> 00:10:05,513 shorter way of writing this and 268 00:10:05,550 --> 00:10:06,943 c2,2,2's and you can 269 00:10:06,943 --> 00:10:10,951 call them 2,2,2, which would also give you the same result. 270 00:10:11,450 --> 00:10:13,910 Let's say W equals one's, one 271 00:10:13,920 --> 00:10:15,485 by three, so this is 272 00:10:15,485 --> 00:10:17,937 going to be a row vector 273 00:10:17,940 --> 00:10:20,998 or a row of 274 00:10:20,998 --> 00:10:23,853 three one's and similarly 275 00:10:23,853 --> 00:10:25,463 you can also say w equals 276 00:10:25,463 --> 00:10:27,469 zeroes, one by 277 00:10:27,469 --> 00:10:30,209 three, and this generates a matrix. 278 00:10:30,220 --> 00:10:34,732 A one by three matrix of all zeros. 279 00:10:34,732 --> 00:10:36,910 Just a couple more ways to generate matrices . 280 00:10:36,930 --> 00:10:39,175 If I do W equals 281 00:10:39,175 --> 00:10:41,512 Rand one by three, 282 00:10:41,520 --> 00:10:43,050 this gives me a one 283 00:10:43,050 --> 00:10:45,370 by three matrix of all random numbers. 284 00:10:45,372 --> 00:10:47,118 If I do Rand 285 00:10:47,215 --> 00:10:49,008 three by three. 286 00:10:49,050 --> 00:10:50,417 This gives me a three by 287 00:10:50,417 --> 00:10:51,918 three matrix of all 288 00:10:51,930 --> 00:10:54,009 random numbers drawn from the 289 00:10:54,009 --> 00:10:55,830 uniform distribution between zero and one. 290 00:10:55,830 --> 00:10:56,937 So every time I do 291 00:10:56,937 --> 00:10:58,608 this, I get a different 292 00:10:58,608 --> 00:11:00,510 set of random numbers drawn 293 00:11:00,540 --> 00:11:02,573 uniformly between zero and one. 294 00:11:02,573 --> 00:11:03,718 For those of you that 295 00:11:03,718 --> 00:11:05,375 know what a Gaussian random variable 296 00:11:05,410 --> 00:11:06,275 is or for those of you that 297 00:11:06,275 --> 00:11:07,659 know what a normal random variable 298 00:11:07,660 --> 00:11:09,112 is, you can also set W 299 00:11:09,112 --> 00:11:11,956 equals Rand N, one by three. 300 00:11:11,990 --> 00:11:13,565 And so these are going 301 00:11:13,570 --> 00:11:15,435 to be three values drawn from 302 00:11:15,435 --> 00:11:17,798 a Gaussian distribution with mean 303 00:11:17,798 --> 00:11:19,266 zero and variance or 304 00:11:19,266 --> 00:11:21,642 standard deviation equal to one. 305 00:11:21,642 --> 00:11:23,148 And you can set more complex 306 00:11:23,150 --> 00:11:24,698 things like W equals minus 307 00:11:24,698 --> 00:11:26,194 six, plus the square root 308 00:11:26,210 --> 00:11:28,656 ten, times, lets say 309 00:11:28,660 --> 00:11:31,978 Rand N, one by ten thousand. 310 00:11:31,978 --> 00:11:33,106 And I'm going to put a semicolon at 311 00:11:33,106 --> 00:11:35,623 the end because I don't really want this printed out. 312 00:11:35,623 --> 00:11:37,599 This is going to be a what? 313 00:11:37,599 --> 00:11:38,905 Well, it's going to 314 00:11:38,910 --> 00:11:40,582 be a vector of, with 315 00:11:40,610 --> 00:11:44,481 a hundred thousand, excuse me, ten thousand elements. 316 00:11:44,490 --> 00:11:47,596 So, well, actually, you know what? 317 00:11:47,596 --> 00:11:48,373 Let's print it out. 318 00:11:48,373 --> 00:11:51,570 So this will generate a matrix like this. 319 00:11:51,570 --> 00:11:52,408 Right? 320 00:11:52,408 --> 00:11:53,978 With 10,000 elements. 321 00:11:53,978 --> 00:11:55,835 So that's what W is. 322 00:11:55,835 --> 00:11:57,392 And if I now 323 00:11:57,392 --> 00:11:59,442 plot a histogram of W 324 00:11:59,442 --> 00:12:01,818 with a hist command, I can 325 00:12:01,820 --> 00:12:04,752 now. And Octave's print hist 326 00:12:04,752 --> 00:12:06,130 command, you know, takes a 327 00:12:06,130 --> 00:12:07,297 couple seconds to bring this up, 328 00:12:07,297 --> 00:12:08,965 but this is a histogram of 329 00:12:08,970 --> 00:12:10,646 my random variable for W. 330 00:12:10,650 --> 00:12:12,732 There was minus 6 plus zero 331 00:12:12,732 --> 00:12:15,537 ten times this Gaussian random variable. 332 00:12:15,537 --> 00:12:17,537 And I can plot a histogram with 333 00:12:17,560 --> 00:12:21,032 more buckets, with more bins, with say, 50 bins. 334 00:12:21,032 --> 00:12:22,578 And this is my 335 00:12:22,578 --> 00:12:25,735 histogram of a Gaussian with mean minus 6. 336 00:12:25,735 --> 00:12:27,285 Because I have a minus 337 00:12:27,285 --> 00:12:29,208 6 there plus square root 10 times this. 338 00:12:29,230 --> 00:12:32,952 So the variance of 339 00:12:32,952 --> 00:12:34,961 this Gaussian random variable 340 00:12:34,961 --> 00:12:36,696 is 10 on the standard deviation is 341 00:12:36,700 --> 00:12:38,935 square root of 10, which is about what? 342 00:12:38,950 --> 00:12:41,063 Three point one. 343 00:12:41,780 --> 00:12:43,857 Finally, one special command 344 00:12:43,857 --> 00:12:46,208 for generator matrix, which is the I command. 345 00:12:46,208 --> 00:12:48,394 So I stands for this 346 00:12:48,394 --> 00:12:51,028 is maybe a pun on the word identity. 347 00:12:51,050 --> 00:12:52,650 It's server set eye 4. 348 00:12:52,720 --> 00:12:56,004 This is the 4 by 4 identity matrix. 349 00:12:56,004 --> 00:12:57,681 So I equals eye 4. 350 00:12:57,681 --> 00:13:00,458 This gives me a 4 by 4 identity matrix. 351 00:13:00,458 --> 00:13:04,475 And I equals eye 5, eye 6. 352 00:13:04,475 --> 00:13:05,611 That gives me a 6 by 353 00:13:05,611 --> 00:13:08,089 6 identity matrix, i3 354 00:13:08,120 --> 00:13:09,134 is the 3 by 3 identity matrix. 355 00:13:09,134 --> 00:13:12,064 Lastly, to 356 00:13:12,064 --> 00:13:14,263 wrap up this video, there's one more useful command. 357 00:13:14,280 --> 00:13:15,479 Which is the help command. 358 00:13:15,479 --> 00:13:17,454 So you can type help i and 359 00:13:17,454 --> 00:13:21,181 this brings up the help function for the identity matrix. 360 00:13:21,190 --> 00:13:22,803 Hit Q to quit. 361 00:13:22,803 --> 00:13:25,375 And you can also type help rand. 362 00:13:25,380 --> 00:13:27,793 Brings up documentation for the rand or the 363 00:13:27,793 --> 00:13:29,734 random number generation function. 364 00:13:29,734 --> 00:13:31,898 Or even help help, which 365 00:13:31,900 --> 00:13:35,615 shows you, you know help on the help function. 366 00:13:36,455 --> 00:13:39,022 So, those are the 367 00:13:39,022 --> 00:13:41,612 basic operations in Octave. 368 00:13:41,612 --> 00:13:42,699 And with this you should be 369 00:13:42,699 --> 00:13:47,131 able to generate a few matrices, multiply, add things. 370 00:13:47,131 --> 00:13:50,553 And use the basic operations in Octave. 371 00:13:50,560 --> 00:13:51,893 In the next video, I'd like 372 00:13:51,920 --> 00:13:53,818 to start talking about more 373 00:13:53,818 --> 00:13:55,700 sophisticated commands and how 374 00:13:55,750 --> 00:13:59,180 to use data around and start to process data in Octave.