Transcend class 10 vs. SanDisk Extreme Pro: a real-case scenario
I own a Pentax K-5 with Transcend Class 10 cards (2 x 16 GB + 1 x 64 GB) and I am mostly satisfied with it. However I have been wondering if a better SD card (such as a SanDisk Extreme Pro 95 MB/s) would make a noticeable difference. I mean, it does on the paper in controlled tests. But is it really any better inside the camera? I mean, isn't the limiting factor the camera itself? So I just bought a 8 GB Extreme Pro one and tested the time necessary to write 10 pictures to the card in the camera and display the photo on the screen. This is a rather typical scenario: you shoot and wait to see the result. I also tested a slower SanDisk Class 4 card just for the fun.
Test setup
The Pentax K-5 was fixed on a tripod, aiming at a white paper sheet and manually focused. The mode was set to M, 80 ISO, 1/80s and F/2.8. The “all-manual” settings should eliminate most variations coming from refocusing or different exposure times. The drive mode was set to continuous shooting (Lo), taking about 1.5 image/second.
With each card, I repeat the following procedure 5 times. I put the card in the camera, turn it on, format the card, and press the trigger until 10 shots are taken. I then start the chronometer as soon as the last shot is taken (with the Android App Chronometer by REmaxer), wait until the last image appears on the screen and stop the chronometer as soon as possible. The resulting images (DNG + JPG) for each shot are about 25 MB, summing up to a total of 250 MB for each test. I should note that the cards were put in the camera in more or less random order, and changed each time (so I didn't do all the test for a card in a row).
The following 5 cards were tested:
- SanDisk Extreme Pro 8GB Class 10 UHS-I
- SanDisk Ultra 4GB Class 4
- 2 Transcend 16GB Class 10
- Transcend 64GB Class 10
Results
Time to display the last photo after the last of 10 shots (in seconds). The lower the better.
Unsurprisingly, the class 4 card is the worst. I had to wait more than 13 seconds after the last shot before I could see anything displayed on the screen. It is more than 10 seconds more than with the best cards. Clearly not a good choice.
Next thing, and still quite unsurprising, the SanDisk Extreme Pro was the fastest card, with an average of 3 seconds between the last shot and its display on screen. This is slightly better than the Transcend Class 10 cards.
The real surprise came from the Transcend cards. First, the 64 GB was significantly slower than the 16 GB ones, with about 7 seconds required to display the last photo versus only 3.5 – 4. Probably the controller isn't able to cope with all this space to allocate? Second, the two 16 GB cards performed fairly differently, one being noticeably slower than the other. More precisely, it had a few “outlier” points where it would take up to 5 seconds to display the last shot. I repeated the test several more times and came to the same conclusion: only one of the card displayed this feature. All other cards had much more stable results.
Conclusion
So, are the more expensive cards really better?
Well, the first thing we can conclude is that cheap class 4 cards are clearly slower. At least the SanDisk Ultra. Since Transcend class 10 cards are about the same price but much, much faster (even in the worst-case outlier scenario), the latter should be prefered.
Then, is it worth buying a SanDisk ExtremePro that is 2.5–3 times more expensive (at the same capacity)? Well, it depends if the 0.5–1 second gain really means something to you. It may be significant on the field when the action is taking place right now and you quickly need to check your photos are OK before continuing.
Several questions remain.
- Is the bad Transcend 16 GB an exception or is it a frequent issue? Is it because it's already more than 1.5 years old (and used pretty intensively)?
- Would I have different results if I tested a second Extreme Pro? And what about 16 GB ones?
- If I had a 8 GB Transcend, would it be faster than the 16 GB ones (and thus could compete with the Extreme Pro)?
- I bought the 64 GB card more than a year ago. Did Transcend improve their controller since?
- How would a 64 GB Extreme Pro perform? Would it have the same controller issues than the Transcend?
As you can see, my testings raise more questions than they solve. For now, I will keep the Extreme Pro in my K-5, with spare Transcends in the bag for when the 8 GB are full (with > 150 photos it shouldn't happen that often). I think this kind of setup is quite efficient: a small, fast card for everyday photos, and big, cheap ones available when more space is needed, at the cost of slightly slower shooting.
Xavier Robin
Published Friday, December 28, 2012 18:34 CET
Permalink: /blog/2012/12/28/transcend-class-10-vs-sandisk-extreme-pro-a-real-case-scenario
Tags:
Photo
Comments: 2
Unifying a new Logitech mouse on Ubuntu 12.10
I just received my new Logitech Performance MX mouse. It is a wonderful mouse, one of the rare being big enough to fit comfortably in my hand. Unfortunately, it comes with a Unifying receiver that is not well supported on Linux. Because I already have an other Unifying Logitech mouse (a small portable M325), I wanted both to be associated with the same receiver (don't want to switch the receiver each time I change my mouse).
Rather than booting on Windows to pair both mouses, I followed Tycho Andersen's instructions to pair new devices in Linux. I saved the code in a file, compiled it, found that the receiver was on hidraw0 (I have a Logitech Unifying Device. Wireless PID:400a on hidraw1, but it is really the device named Logitech USB Receiver that you must select), turned off the MX mouse, ran the program, quickly turned the mouse on… and it works!
The next step is to setup the additional buttons (and there are quite a few of them).
Xavier Robin
Published Friday, December 28, 2012 14:06 CET
Permalink: /blog/2012/12/28/unifying-a-new-logitech-mouse-on-ubuntu-12.10
Tags:
Ubuntu
Comments: 0
pROC 1.5.3 released
I just released a minor revision of pROC, version 1.5.3.
This version fixes the following bugs:
- AUC specification was lost when
roc.test,covorvarwas passed anauc' object. - Incorrect computation of "accuracy" in
coords.
As usual, you can find the new version on ExPASy and on the CRAN (please allow up to a few days before it is available for Windows). To update, type update.packages() or install.packages("pROC") if you want to update pROC only.
Xavier Robin
Published Friday, August 31, 2012 11:48 CEST
Permalink: /blog/2012/08/31/proc-1.5.3-released
Tags:
pROC
Comments: 0
Convert Pentax K-5 AVI video to OGG for wikipedia in Ubuntu Precise Pangolin… with no clicks
I captured a video with my Pentax K-5, and I wanted to send it to Wikipedia (in fact, to Wikimedia Commons) where OGG files are required. The conversion can be done very easily under Linux with avconv (previously known as ffmpeg):
avconv -i IMGP7212.AVI -acodec libvorbis -ab 256k -ac 2 -vcodec libtheora -qscale 10 IMGP7212.ogg
However, the sound is poor because there are clicks (or thumps or cracks or whatever you want) every second or so. Apparently it is frequent issue that is hardware or software dependent. I get a good sound if I play the video in VLC, apparently the PCM audio is correctly handled. As VLC can convert media files, I used it to get a video with a decent audio.
Let's go through.
- The first step is to open VLC and select the Media > “Convert / Save” menu. Select your file and click on the “Convert / Save” button.
- Select the destination file.
- In the Profile setting, choose “Video – Theora + Flac (OGG)”. You need vorbis audio encoding if you want the sound track to play in Firefox (and probably others), but on my computers the vorbis encoder is broken. We'll care about that later.
- Click on the “Edit selected profile” button just on the right of the profile.
- In the Video codec tab, make sure the Video checkbox is checked, “Keep original video track” is unchecked and Theora is selected as codec. Select a good bitrate (you can go up to 5000 or 10000 kb/s if you want a good quality and your video isn't too long. It'll generate a big video file, but not at all as big as the original AVI anyway, and Mediawiki will resize the video itself when it sends it to the web browsers.).
- Select Frame Rate and Width according to the video options you have set in your K-5. Leave the Scale and Height fields blank (or 0)
- In the Audio codec tab, make sure the Audio checkbox is checked, “Keep original audio track” is unchecked and the Flac codec is selected. I believe Bitrate is ignored. Channels is 1 but we will switch to 2 later anyway, so put what you want here. Sample Rate is 44100.
- Click Save.
- Click Start.
- Wait.
When the conversion is done in VLC, we switch to a command line to re-encode the audio track in vorbis. We set the vorbis codec (-acodec libvorbis), with a good bit rate (-acodec libvorbis) and 2 channels (-ac 2, apparently avconv cannot deal with only 1). We keep the video track intact (-vcodec copy).
avconv -i IMGP2712.ogg -acodec libvorbis -ab 256k -ac 2 -vcodec copy IMGP2712_vorbis.ogg
And that's it! You can now upload your video that doesn't click.
Xavier Robin
Published Wednesday, August 1, 2012 16:34 CEST
Permalink: /blog/2012/08/01/convert-pentax-k-5-avi-video-to-ogg-for-wikipedia-in-ubuntu-precise-pangolin-with-no-clicks
Tags:
Photo
Ubuntu
Comments: 0
Gnome vs. Unity
Until now I was using to the old, stable Lucid and Gnome 2 on all my computers. But I recently installed Precise on my new Dell Latitude E6530 laptop. What a shock! How could so much things change in just two years?
My first impressions with Unity are quite mixed. It is unsettling: no task bar, this dock à la Mac, these ugly dark colors…
Clearly it is a good move, I'm already getting used to it. I like the optimization of the vertical space (that gets so scarce and precious with wide screens) with the dock to the side (I had already done so several years ago with Gnome 2's tasks bar on my laptop, only on the right). I love the dash, even though some programs are still missing and it is not obvious how to add a command there. It is wonderful to launch applications without the mouse.
On the dark side, I don't like the lack of customization (well, in fact it is possible but you have to do a lot of research over the Internet and edit a lot of text files), and I still really miss the task bar (it is tedious to switch between a lot of windows with the launcher). More virtual desktops won't solve the problem, and in addition they are less accessible than they used to be (you need two clicks rather than one, and I couldn't find how to drag and drop windows easily to another desktop, you need to right-click on the title bar and select an action… awfully tedious). The merge of the panel with menu and title bars makes is a bit clumsy and the reaction is quite unpredictable, at least in the beginning. But I think Unity's way is globally more efficient, once you are used to it (and it doesn't get that long).
Out of pure curiosity, I installed and tested Gnome 3. Maybe it could be even better? Its development went quite the same way than Unity: the dash, the launcher (hidden by default), the panel. The activities is a wonderful thing, I wish it would be the same in Unity. But I won't stay with it, next login will be with Unity. Here is why.
- Maybe the most striking difference is the use of vertical space. In Unity the title and menu bars are merged with the panel. In Gnome 3 all this stuff takes 55 more pixels, that is 5% of my screen!It could be OK with a large desktop screen, but on a laptop it is definitely an unacceptable waste.
- Shell extensions sound good, but the website is so slow! Why do we need a remote control over the desktop? I'm suspecting that there are potential security issues too.
- I don't like the lack of a task bar. I already said that. But the hidden dock makes it even worse. To switch between windows you either need to open the activities and select your window, or to use Alt + Tab. It is terminally impossible to quickly switch from one window to another when you have more than two windows open on your desktop.
It's a pity, because the activities window is absolutely amazing!
Xavier Robin
Published Tuesday, July 31, 2012 20:59 CEST
Permalink: /blog/2012/07/31/gnome-vs.-unity
Tags:
Ubuntu
Comments: 0
Installation of Ubuntu Linux (12.04 Precise Pangolin) on a Dell Latitude E6530
I received a Dell Latitude E6530. It is a beautiful and powerful 15.6' laptop. I took 8GB of RAM, 750GB hard drive, the Intel Core i7-3720QM CPU @ 2.60GHz and an nVidia NVS 5200M. The matte (anti-glare) screen (I took the full HD version (1920x1080)) is really nice and well contrasted with vivid colors and deep blacks for a laptop. Pixels are small, but not that small (140dpi), and you can fit a lot in such a big screen.
The keyboard has a numeric pad. Not sure it will be really useful (I rarely use it). The effect is to shift the useful keys a bit to the left. Not so comfortable, but it is not too bad and I am already getting used to it.
As expected from Dell, the laptop is well built and looks robust. It is fast and rather silent, though a bit expensive. It tends to heat a bit, especially on the left side with the fan. It may not be optimal for those who intend to work with it on their lap…
The laptop comes with Windows 7 pre-installed. I installed Ubuntu Precise Pangolin in dual boot, from a USB stick. The process was globally successful, even though a few things still doesn't work. Let's go through what I discovered during this process.
Disclaimer
This post is not a tutorial. It is only a set of notes, aimed at people who know how to use and install Linux.
You perform the following operations at your own risk. I decline any responsibility for all damage, loss of data or anything else (including, but not limited to, the burning of your computer, house or town, the death of a cat, yourself or any one else, the destruction of the Earth or the universe, etc.) that could result directly, indirectly, or in any other way, from performing the following operations. You are warned!
Disabling Optimus
Optimus is a wonderful idea… on the paper! Very shortly: some Intel Cores come with an integrated graphic chip (in this case it is an Intel HD Graphics 4000). The additional nVidia card comes with a system called Optimus which will enable the nVidia card only when the most demanding applications are running. The rest of the time, the nVidia card is disabled to save power. The Intel chip is sufficient for most applications, and certainly for all compiz effects.
But unfortunately nVidia does not provide a Linux driver for Optimus. It isn't clear what actually happens. Is it the Intel or the nVidia card that is enabled? I guess the former is true, but I am quite unsure. To make use of optimus, you need to install Bumblebee to enable/disable it on demand. Basically it will run on the Intel chip and start the nVidia card only when you run the optirun command.
Until now it all looks fine. The only problem is that this setup (with or without bumblebee) causes random kernel freezes. It even happened me once during the install process (luckily not during partitioning, but I guess that could happen and wipe your hard drive). Apparently it is a known bug of the video driver. Until a fix is available, the solution I found is dramatic: disable optimus altogether and use only the nVidia card Ivybrirdge graphics. To avoid potentially destructive crashes during the install process (what if it occurs during the partitionning?) I recommend disabling optimus as the very first step. You can always enable it later and run your own tests with a later kernel that may have fixed this issue.
So before you start the install, during the boot, press F12 to get the boot menu. Choose BIOS Setup, then Video > Optimus, uncheck the box and exit. Plug the USB stick and power on. It is probably a safe idea to install the proprietary drivers (nvidia-current package), unless you want to remain absolutely free.
There was some confusion previously regarding the effect of disabling Optimus. In some older BIOS revisions (probably until A04 or A05) it would disable the Nvidia card and let only the Intel Graphics run. Now (BIOS A07), the Nvidia card is enabled when Optimus is disabled. Nvidia-current drivers are working. This behavior may change with a future BIOS revision, I have no idea.
Booting on the USB stick
The E6530 won't boot from a plugged USB stick automatically. I selected the boot device manually.
Plug the USB stick. Power on. Press F12 to get the boot menu. The USB Storage Device was not working so I selected the UEFI Generic Flash Disk.
Partitionning
The E6530 comes with 3 partitions on the hard drive:
- 39MiB of FAT16 labelled "DellUtility"
- 752MiB of NTFS labelled "RECOVERY"
- The remaining is formatted in NTFS and contains Windows 7 (labelled "OS")
First step: to shrink the Windows partition (I kept 50GiB). It is normally recommended to perform that operation from Windows directly. However I found that I could free only a few GiB, so I did it from gparted in the live Linux.
Then I secured a small partition for the Linux system, a bit of swap (as much as the RAM plus a bit for safety), and all the rest as a shared partition so the data is available both in Linux and Windows.
The next step was to create an extended partition (you cannot have that many partitions without an extended partition). I then created the following 3 partitions:
- I secured 25GiB ext4 for the system (sda5, mounted on "/"). In practice it is more than enough for the system and some files in your home directory (we will put the big data files elsewhere).
- I created 12GiB of swap on sda6. I have 8GiB of RAM, and as much swap is required if you want to hibernate. There are 4 additional GiB to hibernate under high memory load. Probably useless, but also harmless with a 750GB disk.
- All the rest (610GiB, sda7) is formatted as NTFS and mounted on /mnt/data.
- I put the bootloader on the partition mounted on / (here sda5). Anyway it will still boot through the Windows bootloader (we will configure that later).
Do not try to use your big data partition directly for /home. I tried it, and it was a complete failure! The problem is that NTFS doesn't have file permissions. So either all or none of the files are executable. They all have the same owner/group. We will change the default permissions later, but it is not enough and some applications (for instance PulseAudio and Dropbox) won't work correctly.
First boot
I expected to get a Grub menu where I could choose my system. But for some unknown reason I booted in Windows. After some time, I figured out I had to forget about Grub and configure Windows' bootloader instead.
I downloaded and installed EasyBCD (non-commercial) and set it up as instructed (see also this more detailed procedure).
boot-restore
At this point, I can boot on linux, but grub was broken and showed a (rather unfriendly) command line.
After a good old Ctrl+Alt+Del, I read boot-restore, rebooted from the USB stick, did as instructed, checked a few thinks that made sense on the moment (sorry, didn't note what exactly, all I remember is I didn't restore MBR).
Reboot and select Linux.
Welcome in Precise Pangolin!
Hide GRUB
As we make our choice of OS with Windows bootloader, it is useless to make it again with grub.
So I edited /etc/default/grub and added the following line:
GRUB_DISABLE_OS_PROBER=true
To apply: sudo update-grub.
Change the default permissions for /mnt/data
By default the NTFS drives are mounted with files owned by root:plugdev (user:group) with write permissions to the group. As the first user is a member of the plugdev group he can write on it. For some reason (that turned out totally useless) I wanted to tweak that to own the files. You can probably disregard the next step.
Open /etc/fstab with root permissions. Find the line containing /mnt/data. Locate the "defaults,umask=007,gid=46" block.I replaced it with "defaults,fmask=133,dmask=022,gid=1000,uid=1000". Make sure not to include any space.
What it means:
- fmask=133 is the permission for all files. The syntax is quirk and the number meaning is reversed. Basically you have rw for user, and r for group and others. You can't change individual files.
- dmask=022 is for directories. They are executable by everyone.
- gid=1000,uid=1000 is your group and user ids. You can find them in /etc/passwd, just after your user name.
Create symbolic links
Now I have a big partition where I can write all my data. But I don't want to go to /mnt/data each time. So I created symbolic links that pointed the most important directories in my home to /mnt/data.
mv Desktop /mnt/data && ln -s /mnt/data/Desktop . mv Desktop /mnt/data && ln -s /mnt/data/Desktop . mv Documents /mnt/data && ln -s /mnt/data/Documents . mv Images /mnt/data && ln -s /mnt/data/Images . mv Music /mnt/data && ln -s /mnt/data/Music . mv Downloads /mnt/data && ln -s /mnt/data/Downloads . mv Videos /mnt/data && ln -s /mnt/data/Videos .
… and so on. Just repeat this procedure each time a folder grows a bit. You can do the same kind of things in Windows, as explained by Lifehacker.
Enabling hibernate mode
I followed Community♦'s instructions on Ask Ubuntu.
Conclusion
Overall this laptop works really fine. Dell clearly made a laptop that is compatible with Linux. Most issues I described here are in fact dual-boot issues, not Linux issues.
What works out of the box:
- The webcam
- The sound (both in and out, built-in or through the combo jack)
- The sound buttons (mute, sound up and down… but surprisingly they do not operate from the login screen)
- The external display with VGA plug (either duplicate or extended screen modes).
- The WiFi and bluetooth
- The SD slot
- USB 3.0 (100MB/s large files write to a WD My Book Essential, reaching 120MB/s on sequential writes (whole volume with
ddcommand), probably limited by the disks themselves). - Pretty much everything else…
What can be fixed:
- Hibernation mode (see above)
- Kernel freezes (disable Optimus, see above)
- The touchpad is detected as a generic mouse by default. It works in degraded mode, you can move the cursor and click, but there is no scrolling (some other features are probably missing too). It is a known bug which should be fixed in a future kernel. Meanwhile, you can follow resalxh's instructions to apply a patch and have it work (thanks Flix for the pointer).
- The backlight is enabled for only 5 seconds, which makes it mostly useless. You can change its intensity with the Fn key, but not its duration. It can't be changed in the BIOS either. You have to start in Windows, go to the control panel and change the backlight settings there. I selected 1 minute illumination, which is enough this time (thanks Flix for the pointer). I don't know how this could be done from Linux, but it will do well enough like this.
- HDMI external display requires X to run the non-free nvidia driver, so Optimus must be disabled. Install and run nvidia-settings to setup the monitor.
What I couldn't fix yet (by order of importance):
- Intel video driver freezes the kernel.
External monitors (plugged on the VGA slot) get the desktop shifted (by the width of the launcher, so no launcher and a small black band at the right).In fact this was a monitor configuration issue, which must be adjusted (possibly with an auto-adjust setting).Suspend by closing the lid. Works but doesn't wake up properly, I have a black screen with the cursor, I need to switch to a console to restart the X server.Well, somehow this seems to work now, I have no idea why.- The battery charge indicator significantly underestimates the time remaining to complete the recharge. Discharge times are rather correct. Please note that I didn't check if it was better in Windows.
- Alt+SysRq keys work only from external (USB) keyboards.
What wasn't tested:
- eSATA port
- Docking stations
Edit on 2012-08-02: apparently once optimus is disabled only the Intel Ivybridge graphics is active, not the nVidia. At least I failed having the nvidia driver operating properly.
Edit on 2012-10-13: added the patch for the touchpad, and it is possible to change the backlight time. Thanks Flix for the pointers.
Edit on 2012-12-01: HDMI + USB 3.0 were tested. HDMI requires Optimus disabled + Nvidia non-free drivers. Install and start nvidia-settings to configure. Also Nvidia card is active when Optimus is disabled in the latest BIOS revision.
Xavier Robin
Published Saturday, July 28, 2012 21:16 CEST
Permalink: /blog/2012/07/28/installation-of-ubuntu-linux-12.04-precise-pangolin-on-a-dell-latitude-e6530
Tags:
Ubuntu
Comments: 25
pROC 1.5.1 released
I sent a new minor version of pROC (1.5.1) to the CRAN.
This version fixes a bug that would make slow down the loading of pROC on computers with many packages. Thanks to Prof Brian Ripley and Glenn Lawyer for the report.
The new version is available on ExPASy and on the CRAN. To update, type update.packages() or install.packages("pROC") if you want to update pROC only.
Xavier Robin
Published Friday, March 9, 2012 11:03 CET
Permalink: /blog/2012/03/09/proc-1.5.1-released
Tags:
pROC
Comments: 0
La vie après le pétrole, 7 ans après
Il y a près de 7 ans, j'écrivais un article intitulé La vie après le pétrole, après la lecture d'un livre du même intitulé.
7 ans après, que s'est il passé ? Eh bien depuis 2005, la production de pétrole a stagné ! C'est en tous cas ce qu'affirme un commentaire dans Nature, repris par Sandra Hines. Chiffres à l'appui, on découvre le plateau, la tôle ondulée, les prix qui explosent. Faillite de Petroplus, tensions en Iran, tous les ingrédients sont réunis pour le plus gros choc pétrolier de l'Histoire, tel que prédit par Jean-Luc Wingert.
Alors il est vrai que depuis, pas mal de choses ont changé. Les énergies renouvelables ne sont plus une chimère défendue uniquement par les Verts. Nombreux sont ceux qui ont compris que les bénéfices que l'on peut en tirer sont loin d'être uniquement écologiques. Mais le chemin à parcourir pour être totalement indépendant de l'or noir semble encore bien long.
Xavier Robin
Published Saturday, January 28, 2012 18:43 CET
Permalink: /blog/2012/01/28/la-vie-apres-le-petrole-7-ans-apres
Tags:
Politics
Comments: 0
Switching to Catalyst
It should be rather transparent, but I just switched my website from ePerl to Catalyst, as announced before. The application should be a bit more reliable (less error 500 pages, that is after the initial debugging period).
Xavier Robin
Published Saturday, January 7, 2012 16:42 CET
Permalink: /blog/2012/01/07/switching-to-catalyst
Tags:
My website
Comments: 1
pROC 1.5 released
pROC's steady progression goes on with version 1.5. It is avalable for R only. S+ users will need to wait for the upcoming 1.6 release which will introduce power / sample size computations.
This version introduces four new notable features:
- Variance and covariance
- Univariate Log-Concave Density Estimation smoothing
- Improvements to the plotting function
- New return values in coords
Variance and covariance
It is now possible to compute the variance of a ROC curve, and the covariance of two paired ROC curves.
library(pROC) data(aSAH) rocobj <- roc(aSAH$outcome, aSAH$s100b) var(roc1) var(roc2) cov(roc1, roc2)
Two methods are available: bootstrap, DeLong1. The bootstrap is the most versatile method. DeLong is faster but works for full AUC only. For more details, see ?var.roc and ?cov.roc.
Univariate Log-Concave Density Estimation smoothing
Until now, three methods were available to smooth a ROC curve: binormal, density and fitdistr (to fit a distribution with MASS). Now, two new methods are available: logcondens and logcondens.smooth. They are based on Duembgen and Rufibach (2011)2. You first need to install the logcondens package:
install.packages("logcondens")
It doesn't need to be loaded.
plot(rocobj)
rs <- smooth(rocobj, method="binormal")
plot(rs, add=TRUE, col="green")
rs2 <- smooth(rocobj, method="density")
plot(rs2, add=TRUE, col="blue")
rs3 <- smooth(rocobj, method="fitdistr", density="lognormal")
plot(rs3, add=TRUE, col="magenta")
rs4 <- smooth(rocobj, method="logcondens")
plot(rs4, add=TRUE, col="brown")
rs5 <- smooth(rocobj, method="logcondens.smooth")
plot(rs5, add=TRUE, col="orange")
legend("bottomright", legend=c("Empirical", "Binormal", "Density", "Log-normal",
"Log-concave density", "Smoothed log-concave density"),
col=c("black", "green", "blue", "magenta", "brown", "orange"), lwd=2)
Improvements to the plotting function
Several users have been bothered by the fact than in pROC (R version), the sensitivity is plotted as decreasing specificity. Most other software plot increasing 1 – specificity on the X axis. The reason is purely historical: only few statistical software can plot an axis in decreasing direction. For instance S+ cannot do it, and pROC's ROC curve are plotted as 1 – specificity there. However it makes absolutely no difference on the ROC curve itself. As it was possible, I decided plot the modern version on R rather than stick to obsolete conventions.
For those who are disturbed and prefer to stick to obsolete conventions, pROC 1.5 comes with a way to plot increasing 1 – specificity in the R version with the legacy.axes argument.
plot(rocobj, legacy.axes=TRUE)
Note that it makes no difference to the coordinates of the plot, and if you want to add some text you still have to think in the "new" way. Consequently, the following will always be plotted to the top left corner of the curve, whatever legacy.axes you specified:
text(1, 1, auc(rocobj), adj=c(0, 1))
New return values in coords
The retargument of the coords function now accepts several new values:
- "accuracy": (sensivity + specificity) / 2
- "tn": true positives count
- "tp": true negatives count
- "fn": false negtives count (positive observations classified as negative by
predictor) - "fp": false positives count (negative observations classified as positive by
predictor) - "npv": negative predictive value, or tn / (tn + fn)
- "ppv": positive predictive value, or tp / (tp + fp)
In addition, sensitivity, specificity, npv and ppv can be prefixed with 1- in order to get the opposite value. Finally two additional values are recognized:
- "npe": converted to 1-npv
- "ppe": converted to 1-ppv
Here is an example. We take the best threshold of the ROC curve rocobj and display all the parameters of this threshold:
coords(rocobj, "best", ret=c("threshold", "specificity", "sensitivity", "accuracy", "tn", "tp", "fn", "fp", "npv", "ppv", "1-specificity", "1-sensitivity", "1-npv", "1-ppv"))
Coords also accepts a new argument: drop to control the dimension of the return value. If drop is FALSE, a matrix will always be returned, even if it contains only one column. This is especially useful to make scripts more reliable.
Conclusion
Here is the full change log:
- New
covandvarfunctions coordsaccepts newretvalues: "accuracy", "tn", "tp", "fn", "fp", "npv", "ppv", "1-specificity", "1-sensitivity", "1-npv", "1-ppv", "npe" and "ppe"- New
legacy.axesargument toplot1-specificity rather than specificity - New
axesargument to turn off the plotting of the axis - New
logcondensandlogcondens.smooth(Univariate Log-Concave Density Estimation) smoothing methods - New function
has.partial.aucto determine if an AUC is full or partial - New argument
dropforcoords aucandmulticlass.aucobjects now also have secondary classnumeric- Updated load call
- Delong's CI reversed in ROC curves with
direction=">" - Delong's CI AUC returned values > 1 or < 0 in some rare cases
- Minor improvements in documentation
As usual, you can find the new version on ExPASy and on the CRAN. To update, type update.packages() or install.packages("pROC") if you want to update pROC only.
- 1. Elisabeth R. DeLong, David M. DeLong and Daniel L. Clarke-Pearson (1988) “Comparing the areas under two or more correlated receiver operating characteristic curves: a nonparametric approach”. Biometrics 44, 837–845.
- 2. Lutz Duembgen, Kaspar Rufibach (2011) “logcondens: Computations Related to Univariate Log-Concave Density Estimation”. Journal of Statistical Software, 39, 1–28. URL: jstatsoft.org/v39/i06.
Xavier Robin
Published Monday, December 12, 2011 09:27 CET
Permalink: /blog/2011/12/12/proc-1.5-released
Tags:
pROC
Comments: 6

Search
Tags
Recent posts
Calendar
Syndication
Recommend