I'm new to LaTeX, and I have never encountered this problem until now:
When I try to typeset my file with LaTeX, it gives me this error
message:
"(Please type a command or say `\end')"
I did not forget to /end{document} so it is unclear why this is the
case. I also checked to see if I left a verbatim environment open
somewhere, but I did not. What are some other reasons I might get
this message, and how might I fix it?
Hi everyone,
I posted some useful handouts from a probability class to my FAS space. The
documents "Distributions" and "Sums of Independent RVs" are particularly
helpful.
John
I am curious to know what, if any, the syntax for optim is if I have a
function with multiple arguments and I want to maximize over just the first
argument. My previous attempts have resulted in program errors.
Thanks,
Laurence
Cancel that request. I've sorted it. No good sending stuff to a
vector that doesn't exist!
Jeremy
> Can anyone help? I can't get both plots on the same graph.
> Everything else works OK & I can plot each individually. Here's my
> code:
>
> a <- seq(from = -12, to = 12, by = .01)
> out1 <- c()
> for (i in 1:length(a)){
> out1[i] <- fbin.rep(a[i], y=y.bin1)
> out2[i] <- fbin.rep(a[i], y=y.bin2)
> }
> #
> a <- pnorm(a, sd=4)
> plot(a, out2, type="l", lwd=1.5, xlab="Binomial parameter: pi",
> ylab= "log-likelihood")
> lines(a, out1, col="blue", lty="dashed")
> abline(v = pnorm(opt1$par, sd=4), col = "skyblue", lty="dashed")
> abline(v = pnorm(opt2$par, sd=4), col = "hotpink")
>
> Thanks
>
> Jeremy
>
Dr Jeremy Hodgen
Senior Lecturer in Mathematics Education
King's College London
Department of Education and Professional Studies
Franklin-Wilkins Building
Waterloo Bridge Wing
150 Stamford Street
London SE1 9NH
Tel: 020 7848 3102
Fax: 020 7848 3182
E-mail: jeremy.hodgen at kcl.ac.uk
Can anyone help? I can't get both plots on the same graph. Everything
else works OK & I can plot each individually. Here's my code:
a <- seq(from = -12, to = 12, by = .01)
out1 <- c()
for (i in 1:length(a)){
out1[i] <- fbin.rep(a[i], y=y.bin1)
out2[i] <- fbin.rep(a[i], y=y.bin2)
}
#
a <- pnorm(a, sd=4)
plot(a, out2, type="l", lwd=1.5, xlab="Binomial parameter: pi", ylab=
"log-likelihood")
lines(a, out1, col="blue", lty="dashed")
abline(v = pnorm(opt1$par, sd=4), col = "skyblue", lty="dashed")
abline(v = pnorm(opt2$par, sd=4), col = "hotpink")
Thanks
Jeremy
Dr Jeremy Hodgen
Senior Lecturer in Mathematics Education
King's College London
Department of Education and Professional Studies
Franklin-Wilkins Building
Waterloo Bridge Wing
150 Stamford Street
London SE1 9NH
Tel: 020 7848 3102
Fax: 020 7848 3182
E-mail: jeremy.hodgen at kcl.ac.uk
I've implemented the method of bisection using three embedded "while"
loops. My problem is that, when I call for the function, it runs
forever even though I have specified a maximum number of iterations.
It has been running long enough that I suspect it is going to run it
an infinite number of times.
Without revealing my code for the whole problem, I'll show enough
code demonstrate how I am telling it to stop after k iterations.
while(fx(((x+y)/2)) != tol && i < iter.max){
i = i+1
while(){
while(){
}
}
}
So, my first theory was that the other two loops were running
infinitely (or a lot of times) within each iteration of the first
while loop. However, I added "&& i < iter.max" to the end of the
other while loops and this did not help. Other theories?
Just checking - there's just the one problem for homework this week
Jeremy
Dr Jeremy Hodgen
Senior Lecturer in Mathematics Education
King's College London
Department of Education and Professional Studies
Franklin-Wilkins Building
Waterloo Bridge Wing
150 Stamford Street
London SE1 9NH
Tel: 020 7848 3102
Fax: 020 7848 3182
E-mail: jeremy.hodgen at kcl.ac.uk