« first day (446 days earlier)      last day (2729 days later) » 

1:27 PM
What the heck. I have to wait 4 hours to accept my own answer.
 
You can be very productive in the mean time.
For instance, you could take a peak at my problem on CV. :P
0
Q: asses density of a function in non-closed form

Roman LuštrikI am working with Rice's Mathematical statistics and data analysis and on page 179 it introduces Monte Carlo Integration. To calculate $I(f) = \int_{0}^1 f(x)dx$ you can generate $X_1, ... X_n$ from a uniform distribution and calculate $\hat{I}(f) = \frac{1}{n} \frac{1}{\sqrt{2 \pi}} \sum_{i=1}...

 
Dense asses?
Damn. I edited your typo, but apparently I am still too lowly to be allowed to commit edits - it has to be peer reviewed.
SE just doesn't trust me today.
 
Looooooooooool.
Ok, I'll edit.
There, I've approved your edit.
 
I don't understand sapply.
This problem is too complicated for me. :D
 
That could probably be vectorized, indeed.
mean(mcint <- sapply(1:1000, function(z, n = 1000) {
			randn <- runif(n = n, min = 0, max = 1.96)
			ihat <- (1/n) * (1/sqrt(2 * pi)) * sum(exp((-randn^2)/2))
			return(ihat)
		}))
 
1:40 PM
And you have arguments that are never used, like z? :)
 
I'm hiding a loop. :P
I'm lazy and I don't wanna bother with preallocating a variable to fill it in using a for loop, so I just use sapply on a vector of n values.
BTW, did you know that "asses" is an ancient Roman copper coin?
 
Hahaha
So what you're telling me is that a Roman likes the feel of hard asses on his lap when he sits down?
Eh, Roman?
Sorry, we were talking about statistics... :)
 
You're getting some technical ideas today. :)
 
Your question is, err..., unusual. I am a stickler when I answer questions on CV...
 
What do you mean, unusual? I'm getting some unexpected behavior from my code and I'm asking about that. Do you think the Q should be on SO?
 
1:46 PM
A brief suggestion: you should modify it to include the description of f in the calculation. Your expression for $\hat{I}(f)$ does not seem to depend on $f$. :)
at this moment, "unusual" = "not how I would word it" :)
 
The thing is that I'm trying to show that I(f) = \hat{I}(f). That's why I keep the (f) notation for \hat{I}.
Do you think the Q in the current form doesn't convey any story on how I got to the last bit of code where it goes wrong?
 
Second suggestion, I would write out the math for the two calculations to show how that motivates the code being written, rather than start with the code. That's not a good practice in the long run - it leads to thinking that code = math. :)
Hehehe, yep, that's what I think. :)
 
2:10 PM
Gah, trying to please you introduces all sorts of problems now. :)
 
You should see how often I edit my own questions. :)
Time to go back to work. Have a great Sunday!
If you can enjoy it in Europe, a place that Republican US Presidential candidates tell us every day (at least lately) is only just this side of hell. :)
(Not that I feel that way, so it cracks me up to see these Presidential debates and the strange fear-mongering.)
 
I will press "Save Edit" quite soon. Thanks for your input. I hope it improves the question substantially. :)
 
No problem! good luck!
 
 
8 hours later…
10:38 PM
Feel free to help close this as a duplicate (or look for a better dupe, that was the best I could find):
0
Q: Getting plot boundaries in R

Max GordonMy question: How do I find the boundaries for the plot area? I'm using the plotHR function for plotting splines from cox regressions. I've done some adaptations found here and the density plot annoys me so I want to be able to change it to a simple regular polygon without the need for using a se...

 

« first day (446 days earlier)      last day (2729 days later) »