Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
0 answers
57 views

I'm struggling to generate samples from a custom distribution defined by its CDF but facing a persistent limitation. The issue boils down to: Limited Range of Samples: Despite having a theoretical ...
0 votes
1 answer
439 views

I am trying to get the inverse of cdf and use it for the QQ plot as follows. cdf<-function(x,b){ 1 - (1+(b*x*(b*x+2)/(b^2+2)))*exp(-b*x) } qf<-function(p,b){ uniroot(function(x) cdf(x,b) - ...
user23245398's user avatar
3 votes
2 answers
175 views

I have this function: a <- 1 b <- 2 get_y <- function (x,a,b) { a * b * x } And I want to create a function that takes in get_y and returns the x that makes y = 4 for example. How would ...
1 vote
1 answer
112 views

Suppose f(u,v)=v(1+theta(1-v)(1-2u))=t, where u and t are uniform(0,1) random samples and theta=0.5. How can I optimize the value of v in R? I tried to make a code using uniroot in r, but it gave me ...
0 votes
0 answers
66 views

I am trying to simulate survival data from a Weibull PH model with a time varying covariate. I wrote a function invS that integrates the hazard function containing the time-varying component. Then I ...
3 votes
2 answers
309 views

Reproducible example: v <- c(-400000.0,-200000.0, 660636.7) d <- c("2021年10月27日","2022年12月23日","2023年01月04日") d1 <- as.Date(d, format="%Y-%m-%d") tvm::...
ottodidakt's user avatar
  • 3,771
0 votes
2 answers
112 views

Just some smaller changes which do not need to be considered.
0 votes
1 answer
419 views

I am using the nls SSlogis function in R to make a model expressing water absorption in a plant, where y=water absorption (g per m^2), and x=minutes in water. For a given y value (in this case max ...
treee's user avatar
  • 13
1 vote
1 answer
104 views

We have a function. t ~ Weibull(alpha, lambda) and c ~ Exponential(beta): Given p = 0.10, alpha = 1, lambda = 4. Find the value of beta. We want to integrate this function for t then to c. Then find ...
0 votes
1 answer
131 views

I am trying to lapp from terra package to solve an equation with raster cells and uniroot function. I am stuck on how to get the final raster output from combining lapp and uniroot functions. I would ...
0 votes
1 answer
56 views

I have a complicated equation for which I have written the code as follows: sigma = 1.336449027; f_t = 0.500185113; alpha = 0.364; #elasticity of capital beta = 0.115; #elasticity of labor R = 3....
1 vote
1 answer
100 views

I am trying to calculate the value of x where y = 0. I could able to do it for single x using the following code lm.model <- lm(y ~ x) cc <- coef(lm.model) f <- function(x) cc[2]*x + cc[1] ...
1 vote
0 answers
47 views

I'm trying to calculate IRRs with cashflow datas that I have for my data's funds. I try this with following code: install.packages("tvm") library(dplyr) library(tvm) var1 <- my_data %>%...
Jaakko's user avatar
  • 11
0 votes
1 answer
129 views

I am working on code that uses the uniroot function to approximate the root of an equation. I am trying to plot the behaviour of the function being passed through uniroot as the value of a free ...
0 votes
1 answer
55 views

I posted similar question a few days later, but now I have more complex problem. I have this dataset product = data.frame(length = c(100, 200, 300, 400), qty = c(1, 2, 1, 3)) And price is defined by ...
onhalu's user avatar
  • 755

15 30 50 per page
1
2 3

AltStyle によって変換されたページ (->オリジナル) /