Question: Currently struggling on lecture problems, please explain thoroughly if possible, thank you! Problem 2: Let x be a vector. Write a function in R called

Currently struggling on lecture problems, please explain thoroughly if possible, thank you!

Currently struggling on lecture problems, please explain thoroughly if possible, thank you!Problem 2: Let x be a vector. Write a function in R

Problem 2: Let x be a vector. Write a function in R called check. sign which returns the "sign" of each coordinate of x. For example, if x = (3, -2, 0, 4, -1) then, check . sign (x) = (1, -1, 0, 1, -1)Problem 3: Start at r = D. After one step either go up by +1 or go down by 1, with equal probabilities. Thus, after one step a: = 1 or a: = 1 with equal probability. If you are currently at :c = 1 then either go up by +1 or down by 1, with equal proba- bility. Likewise if you are currently at a: = 1. And continue this complicated process for 2000 steps. Generate a vector x with :c[1] = D but :r[n] denoting the posi- tion after the nth step. You can visualize the behavior of this \"symmetric random walk\" by typing, plot(1:2000,x,type='1') What does this random walk resemble

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!