Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Questions for R / RStudio (Fall 2023) / Re: Question for HW7 Question 2 iii)
« Last post by YuyangWu on October 27, 2023, 07:22:41 pm »
Thank you for previous question suggestion. I meet another question for Q2 iii) similar with the Question 1, I found, if we initiate the theta.st <- NULL and theta.an <- NULL. The ide will returan error for in var(theta.an) : 'x' is NULL. In order solve this question, could we able to use the numeric?
22
Questions for R / RStudio (Fall 2023) / Re: Question for HW7 Question 2 ii)
« Last post by Darth Knight on October 27, 2023, 07:05:19 pm »
Hi,

You should apply the functions g and F^-1 in a right order for u and 1-u.
Please carefully review PAGES 18-19.

23
Questions for R / RStudio (Fall 2023) / Question for HW7 Question 2 ii)
« Last post by YuyangWu on October 27, 2023, 06:59:12 pm »
The question requires us to evaluate the MC approximation by using the similar code in question 1. Therefore, I modify the x generate from Inverse cdf and pass the result into g(x). And the following steps are same with the Question1. However, my result is generate the NaN. I did not what's happened. Thank you so much!
24
Questions for R / RStudio (Fall 2023) / Re: HW7 Problem #4.
« Last post by Darth Knight on October 23, 2023, 09:45:52 pm »
Hi Beryl,

Yes, you are correct.
It's a mistake, and we should remove arctan() when taking the inverse.
Thank you for posting the correction.

I've corrected the HW question and will grade the submitted homework accordingly.
25
Questions for R / RStudio (Fall 2023) / HW7 Problem #4.
« Last post by Beryl on October 23, 2023, 09:19:12 pm »
In Problem(4), I have a question when generating r.v. by using the inverse cdf approach.

I think I am supposed to generate r.v. from X which has a pdf of h(x)=1/(0.87*(1+x^2/2)) by inverse cdf approach to finish the Importance Sampling Apporach of M.C intergral.

But I calculated the Inverse CDF H^-1(x), which is sqrt(2)*tan(0.87*x/sqrt(2)) by calculation of intergral and is not equal to the Inverse cdf which the question provided. I then make a plot by tried both H^-1(x) and check the histogram of r.v. and compared with the h(x) and I found the r.v. generated under my calculated H^-1(x) has a histogram fits the curve of h(x).

Is there anything wrong?

26
Questions for R / RStudio (Fall 2023) / Re: Question for HW6 Plot Picture
« Last post by Darth Knight on October 20, 2023, 07:06:56 pm »
Hi,

You must be using an if statement to distinguish between the cases when z>0 and z<0.

Yes, you need to address the Naive uniform approach.
For the case where z<0, please carefully review the arguments for "runif()"
and the value for the height of f(x).

However, you could consider moving the change of variable (COV) approach outside of the if statement.
You will notice that the COV approach works for any z values.

I hope this provides some help.
27
Questions for R / RStudio (Fall 2023) / Question for HW6 Plot Picture
« Last post by YuyangWu on October 20, 2023, 06:47:53 pm »
I just finished the HW6 Q3. The picture of the plot seems so strange. It does not like we discuss in the class. Is it caused by we consider the any numbers (z > 0 and z < 0)? Thank you!
28
Questions for R / RStudio (Fall 2023) / Re: HW VI seed
« Last post by Darth Knight on October 14, 2023, 12:00:26 am »
No. You don't need to put seeds for this HW.

29
Questions for R / RStudio (Fall 2023) / HW VI seed
« Last post by nhw2 on October 13, 2023, 11:11:02 pm »
Should we set the seed to a particular value for HW VI?
30
Questions for R / RStudio (Fall 2023) / Re: Midterm & Final Exam Dates
« Last post by TH Kim on September 13, 2023, 12:43:17 pm »
Hi aas423,

As mentioned in the syllabus, the midterms are scheduled
for October 5th and November 9th (with a high probability).
I will update the final exam information once it becomes available.
Pages: 1 2 [3] 4 5 ... 10