power curve fitting with 2 terms [closed] - math

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
How can I fit this equation to a set of data (x,y)
y = a x ^ b + c
I tried least square error method (in Maple software) and power low but it doesn't work!

I solved it!
Y = a x ^ b ; Y = y-c
so 'a' and 'b' can be obtained from least square method, if 'c' is known. Therefor error can be calculate as a function of 'c'. (only 'c' and not 'a' or 'b')
No I should minimize the square error witch is a function of only 'c'.
It's possible to solve this by a numeric method.

Related

how to find expected value of 1000 random number of Poisson Distribution [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Generate a vector of 1000 Poisson random numbers with λ = 3. Make a histogram and a boxplot of the 1000 numbers. Find the expected value of the vector in Rstudio
Try with this:
set.seed(123)
#Code
v <- rpois(1000,lambda = 3)
#Hist
hist(v)
#Boxplot
boxplot(v)
#Mean
mean(v)

Angular Coefficient (b) in R [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
How do I get the coefficient of a regression in R? In the equation of the Regression line, where y = a + bx, the Angular coefficient would be the "b". I would also like to know how to calculate the intercept - the "a" of the equation
I only speak enough spanish to understand a little bit, try:
Model <- lm(y ~ 1 + x)
summary(Model)$coefficients

F Distribution in R [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I can't figure out how to plot the F distribution in R, given two degrees of freedom using standard normal variates. Any suggestions?
You can use curve()
curve(df(x, df1=1, df2=2), from=0, to=5)
Here is the documentation of curve()
df is the density of the F distribution. This can be found in ?distributions and follows the standard naming conventions dnorm for normal distribution, dt for t distribution, etc. The F distribution has two degrees of freedom parameters. Use pf if you want the CDF.
x = seq(0, 5, length = 100)
plot(x, df(x = x, df1 = 1, df2 = 1))

Fastest way to find the maximum real root of cubic function in R [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Whats is the fastest way to find the maximum root of a cubic function in R?
a x^3 + b x^2 + c x + d = 0
Is there anything wrong with the base function polyroot?
Description
Find zeros of a real or complex polynomial.
An example of a cubic
polyroot(c(1,3,3,1))
# [1] -1+0i -1+0i -1-0i
Here is a function to find the maximum non-complex root of a polynomial...
maxReal <- function(params){
x <- polyroot(params)
reals <- sapply(x, function(i) isTRUE(all.equal(Im(i),0)))
max(Re(x)[reals])
}

equivalence of equations [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
A reviewer of a paper I submitted to a scientific journal insists that my function
f1[b_, c_, t_] := 1 - E^((c - t)/b)/2
is "mathematically equivalent" to the function
f2[b0_, b1_, t_] := 1 - b0 E^(-b1 t)
He insists
While the models might appear(superficially) to be different, the f1
model is merely a re-parameterisation of the f2 model, and this can be
seen easily using highschool mathematics.
I survived High School, but I don't see the equivalence, and FullSimplify does not yield the same results. Perhaps I am misunderstanding FullSimplify. Is there a way to authoritatively refute or confirm the assertion of the reviewer?
If c and b are constant, you can factor them out relatively easily given the property of the power operator:
e^(A + B) = e^A x e^B...
so
e^((c - t)/b) = e^(c/b - t/b) = e^(c/b) x e^(-t/b) = b0 x e^(-t/b)
The latter expression is commonly used to simplify linear differential equation.

Resources