I'm trying to simulate survival times from Weibull(or lognormal) distribution with parameters (shape,scale) including (?%) of right-censored observations.I need to obtain observations of a variable, which include some percentage of right-censored data.
I'm wondering how can I simulate a sample of n Weibull distribution lifetimes that include Type I right-censored observations. For instance lets have the n = 3, shape = 3, scale = 1 and the censoring rate = .15, and the censoring time = .88.  I know how to generate a Weibull sample but I do not know how to generate a censored data that have type I right-censored in R.  T = rweibull(3, shape=.5, scale=1)
Resources for Blender How does the ternary operator work? Please demonstrate how the ternary operator works with a regular if/else block. Example:  Boolean isValueBig = value &gt; 100 ? true : false;     Exact Duplicate: How to design the attack class in an RPG game? How do I create a permanent Bash alias? I would like to create an alias to rm command in order to have a confirmation message after executing this command. So I am creating an alias like this alias rm='rm -i'. But as far as I know this is a temporary alias and it lives until you close the terminal.  As it is explained  to save alias permanently I need to execute ~/.bash_aliases or ~/.bashrc commands in terminal and add my alias there. But when I execute ~/.bashrc I get following error message :  bash: /home/bakhtiyor/.bashrc: Permission denied   When I run ~/.bash_aliases I get another error message like this:  bash: /home/bakhtiyor/.bash_aliases: File or directory doesn't exist.   What is the actual problem and how can I solve it? I'm from Western Pennsylvania. Until I moved away, I never realized that when I omitted the to be from phrases like needs to be cleaned, my usage was different than what most English speakers are accustomed to. Is it wrong? Is there any possibility to find my father's lost iPhone? My father has lost his iPhone 6 which was not signed in using an iCloud account. Is there any possibility it can be found? Show that if $f(z)$ is an entire function such that it takes real values on the lines $Im(z)=0$ and $Im(z)=a$ (for some $a \in \mathbb{R}_{\neq 0})$, then $f$ is periodic with period $2 i a$.    So here is my thought process: First of all by reflection principle $f(\bar{z})=\overline{f(z)}$ so if our function $f$ is given in the strip $0 \leq Im(z) \leq a$, then its values on $-a \leq Im(z) \leq a$ follow by reflection principle. Then by imposing $f(z)=f(z+2 ia)$ we can intuitively see that this will define an entire function by looking at how the strips $na \leq Im(z) \leq 2na$ seamlessly stack on top of each other. Is this logical? And how would one prove this analytically? How do I report a bug? Lighting in a Minecraftian World Minecraft is a game that is largely based on a heightmap and uses that heigtmap information to flood the world with light.  From my understanding the highest point in the heightmap is the end of the sunlight influenced area.  Everything above that is lit by sunlight, everything below that just is influenced by light nearby in a radius of 8 blocks.  Thus if you have a floating island on the top of your world everything below that will be seen essentially as a cave.  When two lights influence the same point the brighter light wins (unsure about that).  Either way there are a couple of problems with minecrafts lighting model: first of all, if your world does not have a heightmap it becomes trickier to figure out what exactly is supposed to emit sunlight and what not.  A simple way would be to assume that the world is (in my case) a floating rock and then traverse each axis from both directions and figure out where the rock starts and ends.  But this does not fully eliminate the problem as dents in the rock are not supposed to be in darkness.  Minecraft itself will cache the light information in its chunks together with the information about the material of a block.  Thus only if the world is modified the lighting has to update.  Unfortunately that process is still pretty slow on updates and on quick light changes one can see the lighting lag behind.  That's especially true if a lot of blocks change (TNT, sunset etc.) and you're not running the fastest computer (Or Java on Mac).  From my still limited understanding of 3D graphics lighting a world like minecraft shouldn't be the biggest issue.  How would you tackle the problem?  I think the basic requirements for lighting in a voxel world would be   update fast enough that it could happen in a single frame.  One might be able to do the lighting in the graphics device and download the changed light information to the main RAM. light information must be quickly available for the main game logic so not entirely based on the graphics device: reasoning: light affects the growth of grass, spawning of monsters etc. light updates would have to be local to a chunk or have some other limit so that one does not have to relight the whole world which might be very large in size.   The main idea would be to make the light updates fast, not necessarily more beautiful. For general light rendering performance improvements one could easily add SSAO on top of that which should result in much nicer worlds. Why do games run slow on CPU Maybe my question sounds naive because I'm not a game developer but I dont see objective reasons for this. An average cpu is in times more powerful than an average gpu like a few graphics cards in one. The most repeated reasons in internet:  the GPU isn't as busy as the CPU  If the gpu renders the screen how it can not be busy The modern cpus are powerful enough. They are not busy most of time. For example my cpu's usage is 3%.  many GPU's are designed to process graphics commands in parallel, CPU single threads them  What bothers the games to run a few parallel processes even on one cpu core? In my opinion its not correct to tell that the gpu is better if games never use 100% of the cpu's capacity. To be specific they dont use even 50%.  To clarify my question based on responses in the comments:  Did you mean to ask &quot;Why do games render more slowly on the CPU?&quot;  Yes I mean why the cpu cant do the whole work for games when it is underloaded and especially if it does the largest part of work in any case.  You can not compare GPUs and CPUs directly, because they do different things.  What bothers them to do the same things?  The CPU isn't as well suited to performing rendering calculations  I dont understand what &quot;suited&quot; means. And why the cpu is not suitable for primitive tasks aka paint roller.  adding additional parallel processes doesn't improve performance  Then why do you produce multicore graphics cards and multicore central processing units? Just give various parts of one task to a few processes if one process is slow and 100% of the capacity is not used. What bothers to emulate the gpu? Its also unclear for me why when you play without a separate graphics module the games see only one cpu core when you play with the gpu they see and use all the cpu cores. May be some magic. Starters on Stack Overflow tend to lose interest as soon as their first question starts getting downvotes. Their first question also sometimes gets closed because it was either not framed properly or it missed some very common things.  There should be way to cope with this for instance give some starter bonuses to new users. The legacy tray (see the screenshot below) will be removed in GNOME 3.26. I want to wean myself off it before the change arrives in Ubuntu (17.10 or 18.04).    Can I disable the legacy tray in Ubuntu GNOME 17.04? windows bat file error Let's stop displaying a user's accept rate My feature request (or anti-feature-request perhaps) is the following: Let's stop displaying a user's accept rate.  For those of you who know "Fawlty Towers", the whole issue of a visible accept rate and our behavior towards it starts to feel like .   We generally seem to agree that harassing a user about it is not appropriate and that our decision to answer a question should not depend on it, yet we display it in varying terrorist-threat-levels of color. Yes dear users, please don't pay any attention to the brightly orange colored percentage you see there. And whatever you do, don't bring it up.  But as long as you're displaying the accept rate, people will comment on it, criticize users for it and possibly reconsider answering because of it. And while I'm of the opinion that a low accept rate should not stop you from answering (we're here to make the internet better after all) and that the possible reputation gain (or lack thereof) should not factor in either, I can't blame users for considering it. It's in their face after all. And we're only people.   So let's take the issue off the table. Or at least partially. Information about a user's acceptance behavior can still always be gathered from the profile. But at least that would be less in-your-face.   "But it helps me to see if a user is a help vampire!" I'm still wondering if those are of the sparkly variety as well, but I digress. So what? If the question is bad, downvote it. Evaluate a question on its individual value. There is no need to take a user's history into account. There might be a correlation between the quality of a question and a user's accept rate, but there doesn't have to be. And if there is, the bigger problem is the question's quality.  "Exactly! A user with a low accept rate might indicate there's a problem!" I'm not arguing we should get rid of the accept-rate value within SO/SE. After all, this Q&amp;A works based on up and downvotes, as well as the acceptance of an answer. But why not use it behind the scenes to (very occasionally) nudge the user with a statement like:      "You have received several answers to your questions, yet have not accepted an answer as correct or helpful in a while. You might want to evaluate them and where possible ".    After all, in the various questions with regards to comments on low accept rates, if any comments are encouraged at all, then they are of this soft variety. So why not let the system take care of that?  I feel this would take the whole issue of accept rate off the table, while still providing the user with the information he might have missed or needs. (As a bonus, it would reduce the frequency with which the topic is brought up here on Meta) And those users who would ignore this information are most likely not convinced by a displayed percentage either. I'm passing through Canada, on my way to somewhere else. I'm staying only a short time.   Is there a website, or some other way of find out out if I need a visa? Can we insert or update FieldSets using apex code? Although we can create or update fieldsets using salesforce UI but Is there any way to insert or update FieldSets using apex code (using metadata or API calls) ? Deserialize JSON object into dynamic object using Json.net I got a bunch of files in some directory (along with many other files) that I want to move.   Luckily, all the files I want to move contain a certain identifier in their names, so I can ls | grep IDENTIFIER to get the exact list of files to move.   But, how can I execute mv file /path/to/dest/folder/ at once, and not one by one (there's a lot of files to move)? Do resistances stack? If a creature had resistance to spells, and then cast fire resistance on it, would it take only 1/4 damage from all fire spells? Roman numerals become “too wide” in table of contents Following minimal document:  \documentclass{report}  \begin{document} \renewcommand*\thechapter{\Roman{chapter}} \tableofcontents \setcounter{chapter}{6} % Problem starts at chapter 7 \chapter{Seven} \chapter{Eight} \section{Eight-one} \section{Eight-two} \end{document}   yields this output (cut to size for your convenience):    Clearly, the chapter (and section) headings hang into the chapter (section) numbers. For the previous chapter numbers, this isn’t a problem since all chapter titles are aligned to the same column and the numbers I–VI are sufficiently narrow.  (The same happens regardless of document type, I’m actually using scrreprt with the same result.)  How can I prevent this?